vue3-sphinx-xml 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +14 -0
- package/README.md +171 -0
- package/dist/BlockQuote.js +43 -0
- package/dist/BlockQuote.js.map +1 -0
- package/dist/CaptionNumber.js +71 -0
- package/dist/CaptionNumber.js.map +1 -0
- package/dist/ColumnGroup.js +44 -0
- package/dist/ColumnGroup.js.map +1 -0
- package/dist/Comment.js +34 -0
- package/dist/Comment.js.map +1 -0
- package/dist/Compound.js +39 -0
- package/dist/Compound.js.map +1 -0
- package/dist/Container.js +80 -0
- package/dist/Container.js.map +1 -0
- package/dist/DirectElementMap.js +22 -0
- package/dist/DirectElementMap.js.map +1 -0
- package/dist/DownloadReference.js +51 -0
- package/dist/DownloadReference.js.map +1 -0
- package/dist/Figure.js +55 -0
- package/dist/Figure.js.map +1 -0
- package/dist/FigureCaption.js +77 -0
- package/dist/FigureCaption.js.map +1 -0
- package/dist/Footnote.js +45 -0
- package/dist/Footnote.js.map +1 -0
- package/dist/FootnoteReference.js +49 -0
- package/dist/FootnoteReference.js.map +1 -0
- package/dist/Image.js +53 -0
- package/dist/Image.js.map +1 -0
- package/dist/Legend.js +45 -0
- package/dist/Legend.js.map +1 -0
- package/dist/LineBlock.js +45 -0
- package/dist/LineBlock.js.map +1 -0
- package/dist/LineSingle.js +46 -0
- package/dist/LineSingle.js.map +1 -0
- package/dist/Literal.js +56 -0
- package/dist/Literal.js.map +1 -0
- package/dist/LiteralBlock.js +50 -0
- package/dist/LiteralBlock.js.map +1 -0
- package/dist/Math.js +25 -0
- package/dist/Math.js.map +1 -0
- package/dist/MathBlock.js +77 -0
- package/dist/MathBlock.js.map +1 -0
- package/dist/Note.js +48 -0
- package/dist/Note.js.map +1 -0
- package/dist/NumberReference.js +60 -0
- package/dist/NumberReference.js.map +1 -0
- package/dist/Problematic.js +45 -0
- package/dist/Problematic.js.map +1 -0
- package/dist/Raw.js +10 -0
- package/dist/Raw.js.map +1 -0
- package/dist/Reference.js +49 -0
- package/dist/Reference.js.map +1 -0
- package/dist/Section.js +53 -0
- package/dist/Section.js.map +1 -0
- package/dist/StandardElement.js +99 -0
- package/dist/StandardElement.js.map +1 -0
- package/dist/Text.js +23 -0
- package/dist/Text.js.map +1 -0
- package/dist/Title.js +66 -0
- package/dist/Title.js.map +1 -0
- package/dist/TodoNode.js +54 -0
- package/dist/TodoNode.js.map +1 -0
- package/dist/Topic.js +49 -0
- package/dist/Topic.js.map +1 -0
- package/dist/Transition.js +9 -0
- package/dist/Transition.js.map +1 -0
- package/dist/basereference.js +42 -0
- package/dist/basereference.js.map +1 -0
- package/dist/entry.js +707 -0
- package/dist/entry.js.map +1 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +21 -0
- package/dist/methods.js +138 -0
- package/dist/methods.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/vue3-sphinx-xml.es.js +9 -0
- package/dist/vue3-sphinx-xml.es.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
Copyright 2022 University of Auckland
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# vue-sphinx-xml
|
|
4
|
+
|
|
5
|
+
[ ](https://www.npmjs.com/package/vue-sphinx-xml)
|
|
6
|
+
[](https://vuejs.org/)
|
|
7
|
+
|
|
8
|
+
Vue component for displaying Sphinx documentation XML content.
|
|
9
|
+
|
|
10
|
+
## Project setup
|
|
11
|
+
|
|
12
|
+
```
|
|
13
|
+
npm install --save vue-sphinx-xml
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Module import
|
|
17
|
+
|
|
18
|
+
vue-sphinx-xml makes use of the vuex store to track data. You must use a vuex store for the component to work.
|
|
19
|
+
**⚠️ You need to install the module with the application like so:**
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
import SphinxXml from 'vue-sphinx-xml'
|
|
23
|
+
|
|
24
|
+
Vue.use(SphinxXml, { store })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Add the above to your `main.js` application file before the line creating a `new Vue({ ... })` instance (this assumes that a standard layout is followed when creating your application).
|
|
28
|
+
|
|
29
|
+
vue-sphinx-xml can make use of vue-highlightjs as an optional package.
|
|
30
|
+
vue-highlightjs adds code highlighting to any code blocks in the documentation. To make use of vue-highlightjs install the package:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
npm install --save vue-highlightjs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
and edit your `main.js` application file to have the following:
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import SphinxXml from 'vue-sphinx-xml'
|
|
40
|
+
import VueHighlightJS from 'vue-highlightjs'
|
|
41
|
+
|
|
42
|
+
import 'highlight.js/styles/xcode.css'
|
|
43
|
+
|
|
44
|
+
Vue.use(SphinxXml, { store })
|
|
45
|
+
Vue.use(VueHighlightJS)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The line `import 'highlight.js/styles/xcode.css'` is one of many styles available from highlightjs that may be imported.
|
|
49
|
+
See [highlightjs styles](https://highlightjs.org/static/demo/) for a comprehensive list of available styles.
|
|
50
|
+
|
|
51
|
+
### Module component
|
|
52
|
+
|
|
53
|
+
To use the vue-sphinx-xml component import it in a view and set the `baseURL` for the source XML.
|
|
54
|
+
Example view `Documentation.vue`:
|
|
55
|
+
|
|
56
|
+
```javascript
|
|
57
|
+
<template>
|
|
58
|
+
<div class="documentation">
|
|
59
|
+
<sphinx-page baseURL="/sphinx-xml-files" />
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<script>
|
|
64
|
+
import { SphinxPage } from 'vue-sphinx-xml'
|
|
65
|
+
|
|
66
|
+
export default {
|
|
67
|
+
name: 'Documentation',
|
|
68
|
+
components: {
|
|
69
|
+
SphinxPage,
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
#### SphinxPage API
|
|
76
|
+
|
|
77
|
+
- props
|
|
78
|
+
|
|
79
|
+
| prop | description | default | type |
|
|
80
|
+
| :---------------- | ----------------------------------------------- | ------------------------- | -------- |
|
|
81
|
+
| `baseURL` | the base URL of the XML files | `'/'` | `String` |
|
|
82
|
+
| `downloadBaseURL` | the base URL for downloads | `baseURL + '/_downloads'` | `String` |
|
|
83
|
+
| `imagesBaseURL` | the base URL for images | `baseURL + '/_images'` | `String` |
|
|
84
|
+
| `indexFileName` | the name of the index file at the base URL | `'index'` | `String` |
|
|
85
|
+
| `scrollDelay` | delay before scrolling to hash location on page | `300` | `Number` |
|
|
86
|
+
|
|
87
|
+
### Module routing
|
|
88
|
+
|
|
89
|
+
vue-sphinx-xml requires that you use vue-router. To add a vue-sphinx-xml route under `documentation` add the following to `routes` object for vue-router:
|
|
90
|
+
|
|
91
|
+
```javascript
|
|
92
|
+
{
|
|
93
|
+
path: '/documentation/:pageName*',
|
|
94
|
+
name: 'Documentation',
|
|
95
|
+
// route level code-splitting
|
|
96
|
+
// this generates a separate chunk (documentation.[hash].js) for this route
|
|
97
|
+
// which is lazy-loaded when the route is visited.
|
|
98
|
+
component: () => import(/* webpackChunkName: "documentation" */ '../views/Documentation.vue')
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Again assuming standard layout.
|
|
103
|
+
|
|
104
|
+
### Module math
|
|
105
|
+
|
|
106
|
+
To render any math in the page vue-sphinx-xml uses Katex.
|
|
107
|
+
Katex is not automatically loaded because it is a large package.
|
|
108
|
+
To render math with Katex you need to install the following packages:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
npm install --save katex vue-katex
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
and edit your `main.js` application file to have the following:
|
|
115
|
+
|
|
116
|
+
```javascript
|
|
117
|
+
import SphinxXml from 'vue-sphinx-xml'
|
|
118
|
+
import VueKatex from 'vue-katex'
|
|
119
|
+
|
|
120
|
+
import 'katex/dist/katex.min.css'
|
|
121
|
+
|
|
122
|
+
Vue.use(SphinxXml, { store })
|
|
123
|
+
Vue.use(VueKatex)
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Examples
|
|
127
|
+
|
|
128
|
+
For a complete example of a Vue application using vue-sphinx-xml look at https://github.com/hsorby/example-vue-sphinx-xml.
|
|
129
|
+
The **main** branch has a basic example of how vue-sphinx-xml may be used and the **multi_version** branch has an example of how vue-sphinx-xml may be used for different versions of Sphinx XML output.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## License
|
|
134
|
+
|
|
135
|
+
[Apache-2.0](https://opensource.org/licenses/Apache-2.0)
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Project setup
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
npm install
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Compiles and hot-reloads for development
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
npm run serve
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Compiles and minifies for production
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
npm run build
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Run your unit tests
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
npm run test:unit
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Lints and fixes files
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
npm run lint
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Customize configuration
|
|
170
|
+
|
|
171
|
+
See [Configuration Reference](https://cli.vuejs.org/config/).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { toRefs, openBlock, createElementBlock, createElementVNode, Fragment, renderList, unref, createBlock, resolveDynamicComponent } from "vue";
|
|
2
|
+
import { u as useChildren } from "./entry.js";
|
|
3
|
+
import "@hsorby/vue3-katex";
|
|
4
|
+
import "katex/dist/katex.min.css";
|
|
5
|
+
import "vue-router";
|
|
6
|
+
import "vuex";
|
|
7
|
+
import "path-to-regexp";
|
|
8
|
+
import "axios";
|
|
9
|
+
const _sfc_main = {
|
|
10
|
+
props: {
|
|
11
|
+
node: {
|
|
12
|
+
type: void 0,
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
componentName: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
properties: {
|
|
19
|
+
type: Object
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const { node } = toRefs(props);
|
|
25
|
+
const { children } = useChildren(node);
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createElementBlock("blockquote", null, [
|
|
28
|
+
createElementVNode("div", null, [
|
|
29
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(children), (c, index) => {
|
|
30
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), {
|
|
31
|
+
key: "section_component_" + index,
|
|
32
|
+
node: c.node,
|
|
33
|
+
componentName: c.name,
|
|
34
|
+
properties: c.properties
|
|
35
|
+
}, null, 8, ["node", "componentName", "properties"]);
|
|
36
|
+
}), 128))
|
|
37
|
+
])
|
|
38
|
+
]);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
export { _sfc_main as default };
|
|
43
|
+
//# sourceMappingURL=BlockQuote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockQuote.js","sources":["../src/components/templates/BlockQuote.vue"],"sourcesContent":["<template>\n <blockquote>\n <div>\n <component\n v-for=\"(c, index) in children\"\n :key=\"'section_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n </blockquote>\n</template>\n\n<script setup>\nimport { toRefs } from 'vue'\n\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n }\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAiCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { toRefs, ref, computed, openBlock, createElementBlock, normalizeProps, guardReactiveProps, Fragment, renderList, unref, createBlock, resolveDynamicComponent } from "vue";
|
|
21
|
+
import { a as useClasses, u as useChildren } from "./entry.js";
|
|
22
|
+
import { u as useMethods } from "./methods.js";
|
|
23
|
+
import "@hsorby/vue3-katex";
|
|
24
|
+
import "katex/dist/katex.min.css";
|
|
25
|
+
import "vue-router";
|
|
26
|
+
import "vuex";
|
|
27
|
+
import "path-to-regexp";
|
|
28
|
+
import "axios";
|
|
29
|
+
const _sfc_main = {
|
|
30
|
+
props: {
|
|
31
|
+
node: {
|
|
32
|
+
type: void 0,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
componentName: {
|
|
36
|
+
type: String
|
|
37
|
+
},
|
|
38
|
+
properties: {
|
|
39
|
+
type: Object
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
setup(__props) {
|
|
43
|
+
const props = __props;
|
|
44
|
+
const { dataObject } = useMethods();
|
|
45
|
+
const { node } = toRefs(props);
|
|
46
|
+
const attrs = ref({});
|
|
47
|
+
const { classes } = useClasses(node);
|
|
48
|
+
const { children } = useChildren(node);
|
|
49
|
+
const combinedClasses = computed(() => {
|
|
50
|
+
return ["caption-number", ...classes.value];
|
|
51
|
+
});
|
|
52
|
+
const result = dataObject(node.value, combinedClasses.value);
|
|
53
|
+
attrs.value = __spreadProps(__spreadValues({}, result.attrs), {
|
|
54
|
+
class: result.class.join(" ")
|
|
55
|
+
});
|
|
56
|
+
return (_ctx, _cache) => {
|
|
57
|
+
return openBlock(), createElementBlock("span", normalizeProps(guardReactiveProps(attrs.value)), [
|
|
58
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(children), (c, index) => {
|
|
59
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), {
|
|
60
|
+
key: "caption_number_" + index,
|
|
61
|
+
node: c.node,
|
|
62
|
+
componentName: c.name,
|
|
63
|
+
properties: c.properties
|
|
64
|
+
}, null, 8, ["node", "componentName", "properties"]);
|
|
65
|
+
}), 128))
|
|
66
|
+
], 16);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
export { _sfc_main as default };
|
|
71
|
+
//# sourceMappingURL=CaptionNumber.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CaptionNumber.js","sources":["../src/components/templates/CaptionNumber.vue"],"sourcesContent":["<template>\n <span :=\"attrs\">\n <component\n v-for=\"(c, index) in children\"\n :key=\"'caption_number_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </span>\n</template>\n\n<script setup>\nimport { computed, toRefs, ref } from 'vue'\n\nimport { useChildren, useClasses } from '../../composables/computed'\nimport { useMethods } from '../../composables/methods'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { dataObject } = useMethods()\nconst { node } = toRefs(props)\nconst attrs = ref({})\nconst { classes } = useClasses(node)\n\nconst { children } = useChildren(node)\n\nconst combinedClasses = computed(() => {\n return ['caption-number', ...classes.value]\n})\n\nconst result = dataObject(node.value, combinedClasses.value)\nattrs.value = {\n ...result.attrs,\n class: result.class.join(' '),\n }\n\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,UAAM,EAAE,eAAe,WAAY;AACnC,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,EAAE,YAAY,WAAW,IAAI;AAEnC,UAAM,EAAE,aAAa,YAAY,IAAI;AAErC,UAAM,kBAAkB,SAAS,MAAM;AACrC,aAAO,CAAC,kBAAkB,GAAG,QAAQ,KAAK;AAAA,IAC5C,CAAC;AAED,UAAM,SAAS,WAAW,KAAK,OAAO,gBAAgB,KAAK;AAC3D,UAAM,QAAQ,iCACP,OAAO,QADA;AAAA,MAEV,OAAO,OAAO,MAAM,KAAK,GAAG;AAAA,IAC7B;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { toRefs, computed, openBlock, createElementBlock, Fragment, renderList, unref, normalizeStyle } from "vue";
|
|
2
|
+
const _sfc_main = {
|
|
3
|
+
props: {
|
|
4
|
+
node: {
|
|
5
|
+
type: void 0,
|
|
6
|
+
default: null
|
|
7
|
+
},
|
|
8
|
+
componentName: {
|
|
9
|
+
type: String
|
|
10
|
+
},
|
|
11
|
+
properties: {
|
|
12
|
+
type: Object
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const { properties } = toRefs(props);
|
|
18
|
+
const columnWidths = computed(() => {
|
|
19
|
+
let sum = 0;
|
|
20
|
+
let widths = [];
|
|
21
|
+
for (const value of properties.value.colspecs) {
|
|
22
|
+
sum += Number(value);
|
|
23
|
+
widths.push(Number(value));
|
|
24
|
+
}
|
|
25
|
+
let percentWidths = [];
|
|
26
|
+
for (const value of widths) {
|
|
27
|
+
percentWidths.push(value / sum * 100);
|
|
28
|
+
}
|
|
29
|
+
return percentWidths;
|
|
30
|
+
});
|
|
31
|
+
return (_ctx, _cache) => {
|
|
32
|
+
return openBlock(), createElementBlock("colgroup", null, [
|
|
33
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(columnWidths), (v, index) => {
|
|
34
|
+
return openBlock(), createElementBlock("col", {
|
|
35
|
+
key: "col_" + index,
|
|
36
|
+
style: normalizeStyle("width: " + v + "%")
|
|
37
|
+
}, null, 4);
|
|
38
|
+
}), 128))
|
|
39
|
+
]);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export { _sfc_main as default };
|
|
44
|
+
//# sourceMappingURL=ColumnGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnGroup.js","sources":["../src/components/templates/ColumnGroup.vue"],"sourcesContent":["<template>\n <colgroup>\n <col\n v-for=\"(v, index) in columnWidths\"\n :key=\"'col_' + index\"\n :style=\"'width: ' + v + '%'\"\n />\n </colgroup>\n</template>\n\n<script setup>\nimport { computed, toRefs } from 'vue'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { properties } = toRefs(props)\n\nconst columnWidths = computed(() => {\n let sum = 0\n let widths = []\n for (const value of properties.value.colspecs) {\n sum += Number(value)\n widths.push(Number(value))\n }\n let percentWidths = []\n for (const value of widths) {\n percentWidths.push((value / sum) * 100)\n }\n\n return percentWidths\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AA0BA,UAAM,EAAE,eAAe,OAAO,KAAK;AAEnC,UAAM,eAAe,SAAS,MAAM;AAClC,UAAI,MAAM;AACV,UAAI,SAAS,CAAE;AACf,iBAAW,SAAS,WAAW,MAAM,UAAU;AAC7C,eAAO,OAAO,KAAK;AACnB,eAAO,KAAK,OAAO,KAAK,CAAC;AAAA,MAC1B;AACD,UAAI,gBAAgB,CAAE;AACtB,iBAAW,SAAS,QAAQ;AAC1B,sBAAc,KAAM,QAAQ,MAAO,GAAG;AAAA,MACvC;AAED,aAAO;AAAA,IACT,CAAC;;;;;;;;;;;;;;"}
|
package/dist/Comment.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createCommentVNode, toRefs, ref, openBlock, createBlock } from "vue";
|
|
2
|
+
const _sfc_main$1 = {
|
|
3
|
+
props: ["content"],
|
|
4
|
+
setup(props) {
|
|
5
|
+
return () => createCommentVNode(props.content || "");
|
|
6
|
+
}
|
|
7
|
+
};
|
|
8
|
+
const _sfc_main = {
|
|
9
|
+
props: {
|
|
10
|
+
node: {
|
|
11
|
+
type: void 0,
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
componentName: {
|
|
15
|
+
type: String
|
|
16
|
+
},
|
|
17
|
+
properties: {
|
|
18
|
+
type: Object
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
setup(__props) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const { node } = toRefs(props);
|
|
24
|
+
const text = ref("");
|
|
25
|
+
for (const n of node.value.childNodes) {
|
|
26
|
+
text.value += n.nodeValue;
|
|
27
|
+
}
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createBlock(_sfc_main$1, { content: text.value }, null, 8, ["content"]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
export { _sfc_main as default };
|
|
34
|
+
//# sourceMappingURL=Comment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Comment.js","sources":["../src/components/CommentNode.vue","../src/components/templates/Comment.vue"],"sourcesContent":["<script>\n import { createCommentVNode } from 'vue'\n export default {\n props: ['content'],\n setup(props) {\n return () => createCommentVNode(props.content || '')\n }\n }\n</script>","<template>\n <comment-node :content=\"text\" />\n</template>\n\n<script setup>\nimport { toRefs, ref } from 'vue'\nimport CommentNode from '../CommentNode.vue'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\nconst text = ref('')\n\nfor (const n of node.value.childNodes) {\n text.value += n.nodeValue\n}\n</script>\n"],"names":["_sfc_main"],"mappings":";AAEE,MAAKA,cAAU;AAAA,EACb,OAAO,CAAC,SAAS;AAAA,EACjB,MAAM,OAAO;AACX,WAAO,MAAM,mBAAmB,MAAM,WAAW,EAAE;AAAA,EACrD;AACF;;;;;;;;;;;;;;;;ACcF,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,OAAO,IAAI,EAAE;AAEnB,eAAW,KAAK,KAAK,MAAM,YAAY;AACrC,WAAK,SAAS,EAAE;AAAA,IAClB;;;;;;;"}
|
package/dist/Compound.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { toRefs, openBlock, createElementBlock, Fragment, renderList, unref, createBlock, resolveDynamicComponent } from "vue";
|
|
2
|
+
import { u as useChildren } from "./entry.js";
|
|
3
|
+
import "@hsorby/vue3-katex";
|
|
4
|
+
import "katex/dist/katex.min.css";
|
|
5
|
+
import "vue-router";
|
|
6
|
+
import "vuex";
|
|
7
|
+
import "path-to-regexp";
|
|
8
|
+
import "axios";
|
|
9
|
+
const _sfc_main = {
|
|
10
|
+
props: {
|
|
11
|
+
node: {
|
|
12
|
+
type: void 0,
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
componentName: {
|
|
16
|
+
type: String
|
|
17
|
+
},
|
|
18
|
+
properties: {
|
|
19
|
+
type: Object
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(__props) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const { node } = toRefs(props);
|
|
25
|
+
const { children } = useChildren(node);
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(unref(children), (c, index) => {
|
|
28
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), {
|
|
29
|
+
key: "compound_component_" + index,
|
|
30
|
+
node: c.node,
|
|
31
|
+
componentName: c.name,
|
|
32
|
+
properties: c.properties
|
|
33
|
+
}, null, 8, ["node", "componentName", "properties"]);
|
|
34
|
+
}), 128);
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export { _sfc_main as default };
|
|
39
|
+
//# sourceMappingURL=Compound.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Compound.js","sources":["../src/components/templates/Compound.vue"],"sourcesContent":["<template>\n <component\n v-for=\"(c, index) in children\"\n :key=\"'compound_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n</template>\n\n<script setup>\nimport { toRefs } from 'vue'\n\nimport { useChildren } from '../../composables/computed'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object\n }\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { toRefs, ref, onMounted, openBlock, createElementBlock, normalizeClass, toHandlerKey, Fragment, renderList, unref, createBlock, resolveDynamicComponent } from "vue";
|
|
2
|
+
import { _ as _export_sfc, u as useChildren, a as useClasses } from "./entry.js";
|
|
3
|
+
import { u as useMethods } from "./methods.js";
|
|
4
|
+
import "@hsorby/vue3-katex";
|
|
5
|
+
import "katex/dist/katex.min.css";
|
|
6
|
+
import "vue-router";
|
|
7
|
+
import "vuex";
|
|
8
|
+
import "path-to-regexp";
|
|
9
|
+
import "axios";
|
|
10
|
+
var Container_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
11
|
+
const _sfc_main = {
|
|
12
|
+
props: {
|
|
13
|
+
node: {
|
|
14
|
+
type: void 0,
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
componentName: {
|
|
18
|
+
type: String
|
|
19
|
+
},
|
|
20
|
+
properties: {
|
|
21
|
+
type: Object
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(__props) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const { node } = toRefs(props);
|
|
27
|
+
const { children } = useChildren(node);
|
|
28
|
+
const { classes } = useClasses(node);
|
|
29
|
+
const { toggleActiveClass } = useMethods();
|
|
30
|
+
const combinedClasses = ref([]);
|
|
31
|
+
const isToggleHeader = ref(false);
|
|
32
|
+
const containerElement = ref(null);
|
|
33
|
+
combinedClasses.value = [...classes.value];
|
|
34
|
+
function toggleHeaderClicked() {
|
|
35
|
+
toggleActiveClass(combinedClasses.value);
|
|
36
|
+
const index = combinedClasses.value.indexOf("active");
|
|
37
|
+
let blockType = index === -1 ? "none" : "block";
|
|
38
|
+
let elementSibling = containerElement.value.nextElementSibling;
|
|
39
|
+
while (elementSibling !== null) {
|
|
40
|
+
elementSibling.style.display = blockType;
|
|
41
|
+
elementSibling = elementSibling.nextElementSibling;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
onMounted(() => {
|
|
45
|
+
if (classes.value.includes("header") || classes.value.includes("header-left")) {
|
|
46
|
+
combinedClasses.value.push("inactive");
|
|
47
|
+
const parent = node.value.parentElement;
|
|
48
|
+
if (parent) {
|
|
49
|
+
if (parent.getAttribute("classes").includes("toggle")) {
|
|
50
|
+
isToggleHeader.value = true;
|
|
51
|
+
combinedClasses.value.push("toggle-header");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (classes.value.includes("tab2name")) {
|
|
56
|
+
console.log("tab2name found");
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return openBlock(), createElementBlock("div", {
|
|
61
|
+
class: normalizeClass(combinedClasses.value),
|
|
62
|
+
[toHandlerKey(isToggleHeader.value && `click`)]: toggleHeaderClicked,
|
|
63
|
+
ref_key: "containerElement",
|
|
64
|
+
ref: containerElement
|
|
65
|
+
}, [
|
|
66
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(children), (c, index) => {
|
|
67
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), {
|
|
68
|
+
key: "container_component_" + index,
|
|
69
|
+
node: c.node,
|
|
70
|
+
componentName: c.name,
|
|
71
|
+
properties: c.properties
|
|
72
|
+
}, null, 8, ["node", "componentName", "properties"]);
|
|
73
|
+
}), 128))
|
|
74
|
+
], 16);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var Container = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a971ffd6"]]);
|
|
79
|
+
export { Container as default };
|
|
80
|
+
//# sourceMappingURL=Container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.js","sources":["../src/components/templates/Container.vue"],"sourcesContent":["<template>\n <div\n :class=\"combinedClasses\"\n @[isToggleHeader&&`click`]=\"toggleHeaderClicked\"\n ref=\"containerElement\"\n >\n <component\n v-for=\"(c, index) in children\"\n :key=\"'container_component_' + index\"\n :is=\"c.component\"\n :node=\"c.node\"\n :componentName=\"c.name\"\n :properties=\"c.properties\"\n />\n </div>\n</template>\n\n<script setup>\nimport { onMounted, ref, toRefs } from 'vue'\n\nimport { useChildren, useClasses } from '../../composables/computed'\nimport { useMethods } from '../../composables/methods'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n properties: {\n type: Object,\n },\n})\n\nconst { node } = toRefs(props)\n\nconst { children } = useChildren(node)\nconst { classes } = useClasses(node)\nconst { toggleActiveClass } = useMethods()\n\nconst combinedClasses = ref([])\nconst isToggleHeader = ref(false)\nconst containerElement = ref(null)\n\ncombinedClasses.value = [...classes.value]\n\nfunction toggleHeaderClicked() {\n toggleActiveClass(combinedClasses.value)\n const index = combinedClasses.value.indexOf('active')\n let blockType = index === -1 ? 'none' : 'block'\n\n let elementSibling = containerElement.value.nextElementSibling\n while (elementSibling !== null) {\n elementSibling.style.display = blockType\n elementSibling = elementSibling.nextElementSibling\n }\n}\n\nonMounted(() => {\n if (\n classes.value.includes('header') ||\n classes.value.includes('header-left')\n ) {\n combinedClasses.value.push('inactive')\n const parent = node.value.parentElement\n if (parent) {\n if (parent.getAttribute('classes').includes('toggle')) {\n isToggleHeader.value = true\n combinedClasses.value.push('toggle-header')\n }\n }\n }\n\n if (classes.value.includes('tab2name')) {\n console.log('tab2name found')\n }\n})\n</script>\n\n<style scoped>\n.toggle-header {\n cursor: pointer;\n}\n</style>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,UAAM,EAAE,SAAS,OAAO,KAAK;AAE7B,UAAM,EAAE,aAAa,YAAY,IAAI;AACrC,UAAM,EAAE,YAAY,WAAW,IAAI;AACnC,UAAM,EAAE,sBAAsB,WAAY;AAE1C,UAAM,kBAAkB,IAAI,EAAE;AAC9B,UAAM,iBAAiB,IAAI,KAAK;AAChC,UAAM,mBAAmB,IAAI,IAAI;AAEjC,oBAAgB,QAAQ,CAAC,GAAG,QAAQ,KAAK;AAEzC,mCAA+B;AAC7B,wBAAkB,gBAAgB,KAAK;AACvC,YAAM,QAAQ,gBAAgB,MAAM,QAAQ,QAAQ;AACpD,UAAI,YAAY,UAAU,KAAK,SAAS;AAExC,UAAI,iBAAiB,iBAAiB,MAAM;AAC5C,aAAO,mBAAmB,MAAM;AAC9B,uBAAe,MAAM,UAAU;AAC/B,yBAAiB,eAAe;AAAA,MACjC;AAAA,IACH;AAEA,cAAU,MAAM;AACd,UACE,QAAQ,MAAM,SAAS,QAAQ,KAC/B,QAAQ,MAAM,SAAS,aAAa,GACpC;AACA,wBAAgB,MAAM,KAAK,UAAU;AACrC,cAAM,SAAS,KAAK,MAAM;AAC1B,YAAI,QAAQ;AACV,cAAI,OAAO,aAAa,SAAS,EAAE,SAAS,QAAQ,GAAG;AACrD,2BAAe,QAAQ;AACvB,4BAAgB,MAAM,KAAK,eAAe;AAAA,UAC3C;AAAA,QACF;AAAA,MACF;AAED,UAAI,QAAQ,MAAM,SAAS,UAAU,GAAG;AACtC,gBAAQ,IAAI,gBAAgB;AAAA,MAC7B;AAAA,IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { openBlock, createBlock, resolveDynamicComponent, withCtx, createElementBlock, Fragment, renderList } from "vue";
|
|
2
|
+
const _sfc_main = {
|
|
3
|
+
setup(__props) {
|
|
4
|
+
return (_ctx, _cache) => {
|
|
5
|
+
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), null, {
|
|
6
|
+
default: withCtx(() => [
|
|
7
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.children, (c, index) => {
|
|
8
|
+
return openBlock(), createBlock(resolveDynamicComponent(c.component), {
|
|
9
|
+
key: "standard_element_component_" + index,
|
|
10
|
+
node: c.node,
|
|
11
|
+
componentName: c.name,
|
|
12
|
+
properties: c.properties
|
|
13
|
+
}, null, 8, ["node", "componentName", "properties"]);
|
|
14
|
+
}), 128))
|
|
15
|
+
]),
|
|
16
|
+
_: 1
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export { _sfc_main as default };
|
|
22
|
+
//# sourceMappingURL=DirectElementMap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectElementMap.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { toRefs, computed, ref, openBlock, createElementBlock, unref, normalizeClass, toDisplayString } from "vue";
|
|
2
|
+
import { useRoute } from "vue-router";
|
|
3
|
+
import { useStore } from "vuex";
|
|
4
|
+
import { d as determineRouteUrl } from "./entry.js";
|
|
5
|
+
import "@hsorby/vue3-katex";
|
|
6
|
+
import "katex/dist/katex.min.css";
|
|
7
|
+
import "path-to-regexp";
|
|
8
|
+
import "axios";
|
|
9
|
+
const _hoisted_1 = ["href", "download"];
|
|
10
|
+
const _sfc_main = {
|
|
11
|
+
props: {
|
|
12
|
+
node: {
|
|
13
|
+
type: void 0,
|
|
14
|
+
default: null
|
|
15
|
+
},
|
|
16
|
+
componentName: {
|
|
17
|
+
type: String
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(__props) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const { node } = toRefs(props);
|
|
23
|
+
const route = useRoute();
|
|
24
|
+
const store = useStore();
|
|
25
|
+
const href = computed(() => {
|
|
26
|
+
let downloadHref = node.value.getAttribute("filename");
|
|
27
|
+
if (downloadHref && !downloadHref.startsWith("/") && !downloadHref.startsWith("http")) {
|
|
28
|
+
const routeURL = determineRouteUrl(route);
|
|
29
|
+
downloadHref = [
|
|
30
|
+
store.getters["sphinx/getDownloadURL"](routeURL),
|
|
31
|
+
downloadHref
|
|
32
|
+
].join("/");
|
|
33
|
+
}
|
|
34
|
+
return downloadHref;
|
|
35
|
+
});
|
|
36
|
+
const targetParts = node.value.getAttribute("reftarget").split("/");
|
|
37
|
+
const downloadName = targetParts[targetParts.length - 1];
|
|
38
|
+
const classes = ["reference", "internal", node.value.getAttribute("reftype")];
|
|
39
|
+
const saveFilename = ref("not-set");
|
|
40
|
+
saveFilename.value = downloadName;
|
|
41
|
+
return (_ctx, _cache) => {
|
|
42
|
+
return openBlock(), createElementBlock("a", {
|
|
43
|
+
href: unref(href),
|
|
44
|
+
download: saveFilename.value,
|
|
45
|
+
class: normalizeClass(classes)
|
|
46
|
+
}, toDisplayString(saveFilename.value), 9, _hoisted_1);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
export { _sfc_main as default };
|
|
51
|
+
//# sourceMappingURL=DownloadReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadReference.js","sources":["../src/components/templates/DownloadReference.vue"],"sourcesContent":["<template>\n <a :href=\"href\" :download=\"saveFilename\" :class=\"classes\" >{{ saveFilename }}</a>\n</template>\n\n<script setup>\nimport { computed, toRefs, ref } from 'vue'\nimport { useRoute } from 'vue-router'\nimport { useStore } from 'vuex'\n\nimport { determineRouteUrl } from '../../js/utilities'\n\nconst props = defineProps({\n node: {\n type: undefined,\n default: null,\n },\n componentName: {\n type: String,\n },\n})\n\nconst { node } = toRefs(props)\nconst route = useRoute()\nconst store = useStore()\n\nconst href = computed(() => {\n let downloadHref = node.value.getAttribute('filename')\n if (\n downloadHref &&\n !downloadHref.startsWith('/') &&\n !downloadHref.startsWith('http')\n ) {\n const routeURL = determineRouteUrl(route)\n downloadHref = [\n store.getters['sphinx/getDownloadURL'](routeURL),\n downloadHref,\n ].join('/')\n }\n return downloadHref\n})\n\nconst targetParts = node.value.getAttribute('reftarget').split('/')\nconst downloadName = targetParts[targetParts.length - 1]\nconst classes = ['reference', 'internal', node.value.getAttribute('reftype')]\n\n// Need to use a refernce variable in the template bound attributes.\nconst saveFilename = ref('not-set')\nsaveFilename.value = downloadName\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqBA,UAAM,EAAE,SAAS,OAAO,KAAK;AAC7B,UAAM,QAAQ,SAAU;AACxB,UAAM,QAAQ,SAAU;AAExB,UAAM,OAAO,SAAS,MAAM;AAC1B,UAAI,eAAe,KAAK,MAAM,aAAa,UAAU;AACrD,UACE,gBACA,CAAC,aAAa,WAAW,GAAG,KAC5B,CAAC,aAAa,WAAW,MAAM,GAC/B;AACA,cAAM,WAAW,kBAAkB,KAAK;AACxC,uBAAe;AAAA,UACb,MAAM,QAAQ,yBAAyB,QAAQ;AAAA,UAC/C;AAAA,QACN,EAAM,KAAK,GAAG;AAAA,MACX;AACD,aAAO;AAAA,IACT,CAAC;AAED,UAAM,cAAc,KAAK,MAAM,aAAa,WAAW,EAAE,MAAM,GAAG;AAClE,UAAM,eAAe,YAAY,YAAY,SAAS;AACtD,UAAM,UAAU,CAAC,aAAa,YAAY,KAAK,MAAM,aAAa,SAAS,CAAC;AAG5E,UAAM,eAAe,IAAI,SAAS;AAClC,iBAAa,QAAQ;;;;;;;;;;;"}
|