spec-up-t 1.3.0-beta → 1.3.1
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/assets/compiled/body.js +3 -3
- package/assets/compiled/head.css +2 -1
- package/assets/css/counter.css +92 -0
- package/assets/css/{pdf-download.css → download-pdf-docx.css} +9 -5
- package/assets/js/addAnchorsToTerms.js +1 -1
- package/assets/js/collapse-definitions.js +0 -3
- package/assets/js/custom-elements.js +25 -27
- package/assets/js/download-pdf-docx.js +68 -0
- package/assets/js/highlight-heading-plus-sibling-nodes.test.js +120 -0
- package/config/asset-map.json +3 -2
- package/index.js +1 -1
- package/package.json +3 -2
- package/sonar-project.properties +7 -6
- package/src/create-docx.js +1 -1
- package/src/html-dom-processor.js +15 -15
- package/src/install-from-boilerplate/boilerplate/.github/workflows/menu.yml +78 -77
- package/src/install-from-boilerplate/boilerplate/spec/spec-head.md +1 -1
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/composability.md +3 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/compost.md +3 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/fertilizer.md +3 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/mulch.md +3 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/pruning.md +3 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/seedling.md +3 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/soil.md +11 -0
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/watering.md +3 -0
- package/src/install-from-boilerplate/boilerplate/specs.json +22 -9
- package/src/install-from-boilerplate/config-system-files.js +0 -1
- package/assets/js/pdf-download.js +0 -46
- package/src/install-from-boilerplate/boilerplate/.github/workflows/fetch-and-push-xrefs.yml.old +0 -42
- package/src/install-from-boilerplate/boilerplate/.github/workflows/render-specs.yml +0 -47
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-1.md +0 -13
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-2.md +0 -3
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-3.md +0 -3
- package/src/install-from-boilerplate/boilerplate/spec/terms-definitions/term-4.md +0 -3
- package/test-default-definitions.js +0 -55
- package/test-edge-cases.md +0 -20
- package/test-fix-markdown.js +0 -11
- package/test-no-def.md +0 -22
|
@@ -145,18 +145,18 @@ function fixDefinitionListStructure(html) {
|
|
|
145
145
|
function collectDtDdGroup(startNode) {
|
|
146
146
|
const group = [];
|
|
147
147
|
let currentNode = startNode;
|
|
148
|
-
|
|
148
|
+
|
|
149
149
|
// Collect the dt and all following dd elements
|
|
150
150
|
while (currentNode && (currentNode.tagName === 'DT' || currentNode.tagName === 'DD')) {
|
|
151
151
|
group.push(currentNode);
|
|
152
152
|
currentNode = currentNode.nextSibling;
|
|
153
|
-
|
|
153
|
+
|
|
154
154
|
// Skip text nodes (whitespace) between elements
|
|
155
155
|
while (currentNode && currentNode.nodeType === 3 && !currentNode.textContent.trim()) {
|
|
156
156
|
currentNode = currentNode.nextSibling;
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
|
-
|
|
159
|
+
|
|
160
160
|
return group;
|
|
161
161
|
}
|
|
162
162
|
|
|
@@ -166,7 +166,7 @@ function fixDefinitionListStructure(html) {
|
|
|
166
166
|
if (dt.parentElement !== mainDl) {
|
|
167
167
|
// Collect the dt and its associated dd elements
|
|
168
168
|
const group = collectDtDdGroup(dt);
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
// Move all elements in the group to the main dl
|
|
171
171
|
group.forEach(element => {
|
|
172
172
|
if (element.parentNode) {
|
|
@@ -190,15 +190,15 @@ function fixDefinitionListStructure(html) {
|
|
|
190
190
|
// Process all subsequent content
|
|
191
191
|
while (currentNode) {
|
|
192
192
|
// Save the next node before potentially modifying the DOM
|
|
193
|
-
|
|
193
|
+
let nextNode = currentNode.nextSibling;
|
|
194
194
|
|
|
195
195
|
// Handle different node types
|
|
196
196
|
if (currentNode.nodeType === 1) { // 1 = Element node
|
|
197
197
|
if (currentNode.tagName === 'DL') {
|
|
198
198
|
// Check if this is a reference list (contains dt elements with id="ref:...")
|
|
199
|
-
const hasRefIds = currentNode.innerHTML.includes('id="ref:') ||
|
|
200
|
-
|
|
201
|
-
|
|
199
|
+
const hasRefIds = currentNode.innerHTML.includes('id="ref:') ||
|
|
200
|
+
currentNode.classList.contains('reference-list');
|
|
201
|
+
|
|
202
202
|
if (!hasRefIds) {
|
|
203
203
|
// Only move non-reference definition lists - move all its children to the main dl
|
|
204
204
|
while (currentNode.firstChild) {
|
|
@@ -212,11 +212,11 @@ function fixDefinitionListStructure(html) {
|
|
|
212
212
|
else if (currentNode.tagName === 'DT') {
|
|
213
213
|
// Check if this dt has a ref: id (spec reference)
|
|
214
214
|
const hasRefId = currentNode.id?.startsWith('ref:');
|
|
215
|
-
|
|
215
|
+
|
|
216
216
|
if (!hasRefId) {
|
|
217
217
|
// Collect the dt and its associated dd elements
|
|
218
218
|
const group = collectDtDdGroup(currentNode);
|
|
219
|
-
|
|
219
|
+
|
|
220
220
|
// Move all elements in the group to the main dl
|
|
221
221
|
group.forEach(element => {
|
|
222
222
|
if (element.parentNode) {
|
|
@@ -225,7 +225,7 @@ function fixDefinitionListStructure(html) {
|
|
|
225
225
|
element.parentNode.removeChild(element);
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
|
-
|
|
228
|
+
|
|
229
229
|
// Skip the nodes we just processed
|
|
230
230
|
let skipNodes = group.length - 1; // -1 because currentNode will be advanced anyway
|
|
231
231
|
while (skipNodes > 0 && nextNode) {
|
|
@@ -241,7 +241,7 @@ function fixDefinitionListStructure(html) {
|
|
|
241
241
|
// Handle orphaned dd elements - move them to the main dl if they don't belong to a reference
|
|
242
242
|
const dtBefore = currentNode.previousSibling;
|
|
243
243
|
let hasAssociatedDt = false;
|
|
244
|
-
|
|
244
|
+
|
|
245
245
|
// Check if there's a dt before this dd (walking backwards through siblings)
|
|
246
246
|
let checkNode = currentNode.previousSibling;
|
|
247
247
|
while (checkNode) {
|
|
@@ -250,7 +250,7 @@ function fixDefinitionListStructure(html) {
|
|
|
250
250
|
checkNode = checkNode.previousSibling;
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
|
-
|
|
253
|
+
|
|
254
254
|
if (checkNode.tagName === 'DT') {
|
|
255
255
|
hasAssociatedDt = true;
|
|
256
256
|
break;
|
|
@@ -258,10 +258,10 @@ function fixDefinitionListStructure(html) {
|
|
|
258
258
|
// Found a non-dt, non-dd element, so this dd is orphaned
|
|
259
259
|
break;
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
|
|
262
262
|
checkNode = checkNode.previousSibling;
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
|
|
265
265
|
// If this dd doesn't have an associated dt in the same context, move it to main dl
|
|
266
266
|
if (!hasAssociatedDt) {
|
|
267
267
|
const ddClone = currentNode.cloneNode(true);
|
|
@@ -3,23 +3,27 @@ name: Run Menu
|
|
|
3
3
|
on:
|
|
4
4
|
workflow_dispatch:
|
|
5
5
|
inputs:
|
|
6
|
-
|
|
7
|
-
description: '
|
|
8
|
-
type: choice
|
|
6
|
+
action_type:
|
|
7
|
+
description: 'Action to perform'
|
|
9
8
|
required: true
|
|
10
|
-
default: '
|
|
9
|
+
default: 'render'
|
|
10
|
+
type: choice
|
|
11
11
|
options:
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
- render
|
|
13
|
+
- topdf
|
|
14
|
+
- todocx
|
|
15
|
+
- freeze
|
|
16
|
+
- custom-update
|
|
17
|
+
- collectExternalReferences
|
|
18
|
+
repository:
|
|
19
|
+
description: 'Repository'
|
|
20
|
+
required: false
|
|
21
|
+
branch:
|
|
22
|
+
description: 'Branch'
|
|
23
|
+
required: false
|
|
24
|
+
triggered_by:
|
|
25
|
+
description: 'Triggered by'
|
|
26
|
+
required: false
|
|
23
27
|
|
|
24
28
|
jobs:
|
|
25
29
|
build-and-deploy-spec:
|
|
@@ -58,82 +62,79 @@ jobs:
|
|
|
58
62
|
env:
|
|
59
63
|
MY_PAT: ${{ secrets.MY_PAT }} # Make the secret available as an env var
|
|
60
64
|
run: |
|
|
61
|
-
case "${{ github.event.inputs.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
case "${{ github.event.inputs.action_type }}" in
|
|
66
|
+
render)
|
|
67
|
+
npm run render
|
|
68
|
+
;;
|
|
69
|
+
topdf)
|
|
70
|
+
npm run topdf
|
|
71
|
+
;;
|
|
72
|
+
todocx)
|
|
73
|
+
npm run todocx
|
|
74
|
+
;;
|
|
75
|
+
freeze)
|
|
76
|
+
npm run freeze
|
|
77
|
+
;;
|
|
78
|
+
custom-update)
|
|
79
|
+
npm run custom-update
|
|
80
|
+
;;
|
|
81
|
+
collectExternalReferences)
|
|
82
|
+
npm run collectExternalReferences
|
|
83
|
+
;;
|
|
84
|
+
*)
|
|
85
|
+
echo "Unknown action_type: ${{ github.event.inputs.action_type }}"
|
|
86
|
+
exit 1
|
|
87
|
+
;;
|
|
88
|
+
esac
|
|
89
|
+
|
|
90
|
+
- name: Commit and push changes
|
|
91
|
+
if: success()
|
|
92
|
+
run: |
|
|
93
|
+
git config --global user.email "actions@github.com"
|
|
94
|
+
git config --global user.name "GitHub Actions"
|
|
95
|
+
|
|
96
|
+
# Add all changes
|
|
97
|
+
git add .
|
|
98
|
+
|
|
99
|
+
# Commit with appropriate message
|
|
100
|
+
case "${{ github.event.inputs.action_type }}" in
|
|
101
|
+
render)
|
|
70
102
|
git commit -m "Render specification: Update files" || echo "No changes to commit"
|
|
71
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
72
103
|
;;
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
# ;;
|
|
76
|
-
"Collect external references")
|
|
77
|
-
node --no-warnings -e "require('spec-up-t/src/collect-external-references.js').collectExternalReferences({ pat: process.env.MY_PAT })"
|
|
78
|
-
git config --global user.email "actions@github.com"
|
|
79
|
-
git config --global user.name "GitHub Actions"
|
|
80
|
-
git add .
|
|
81
|
-
git commit -m "Collect external references" || echo "No changes to commit"
|
|
82
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
104
|
+
topdf)
|
|
105
|
+
git commit -m "Export to PDF" || echo "No changes to commit"
|
|
83
106
|
;;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
git config --global user.email "actions@github.com"
|
|
87
|
-
git config --global user.name "GitHub Actions"
|
|
88
|
-
git add .
|
|
89
|
-
git commit -m "Convert to PDF" || echo "No changes to commit"
|
|
90
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
107
|
+
todocx)
|
|
108
|
+
git commit -m "Export to DOCX" || echo "No changes to commit"
|
|
91
109
|
;;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
git add .
|
|
110
|
+
collectExternalReferences)
|
|
111
|
+
git commit -m "Collect external references" || echo "No changes to commit"
|
|
112
|
+
;;
|
|
113
|
+
freeze)
|
|
97
114
|
git commit -m "Freeze specification" || echo "No changes to commit"
|
|
98
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
99
115
|
;;
|
|
100
|
-
|
|
101
|
-
# node -e "require('spec-up-t/src/references.js')"
|
|
102
|
-
# ;;
|
|
103
|
-
# "Show help")
|
|
104
|
-
# cat ./node_modules/spec-up-t/src/install-from-boilerplate/help.txt || echo "Help file not found"
|
|
105
|
-
# ;;
|
|
106
|
-
# "Add/remove xref source")
|
|
107
|
-
# node --no-warnings -e "require('spec-up-t/src/add-remove-xref-source.js')"
|
|
108
|
-
# ;;
|
|
109
|
-
# "Configure specification")
|
|
110
|
-
# node --no-warnings -e "require('spec-up-t/src/configure.js')"
|
|
111
|
-
# ;;
|
|
112
|
-
"Custom update")
|
|
113
|
-
npm update && node -e "require('spec-up-t/src/install-from-boilerplate/custom-update.js')"
|
|
114
|
-
git config --global user.email "actions@github.com"
|
|
115
|
-
git config --global user.name "GitHub Actions"
|
|
116
|
-
git add .
|
|
116
|
+
custom-update)
|
|
117
117
|
git commit -m "Custom update: Copy files from spec-up-t" || echo "No changes to commit"
|
|
118
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
119
118
|
;;
|
|
120
119
|
*)
|
|
121
|
-
|
|
122
|
-
exit 1
|
|
120
|
+
git commit -m "Update files: ${{ github.event.inputs.action_type }}" || echo "No changes to commit"
|
|
123
121
|
;;
|
|
124
122
|
esac
|
|
123
|
+
|
|
124
|
+
# Push changes
|
|
125
|
+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
125
126
|
|
|
126
|
-
- name:
|
|
127
|
-
if: success()
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
127
|
+
- name: Commit output files
|
|
128
|
+
if: success()
|
|
129
|
+
run: |
|
|
130
|
+
git config --global user.email "actions@github.com"
|
|
131
|
+
git config --global user.name "GitHub Actions"
|
|
132
|
+
git add "$OUTPUT_PATH"
|
|
133
|
+
git commit -m "Update output files in $OUTPUT_PATH" || echo "No changes to commit in output directory"
|
|
134
|
+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
134
135
|
|
|
135
136
|
- name: Clean up
|
|
136
137
|
if: always()
|
|
137
138
|
run: |
|
|
138
139
|
echo "Cleaning up..."
|
|
139
|
-
rm -rf node_modules
|
|
140
|
+
rm -rf node_modules
|
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
|
|
5
5
|
This is a default Spec-Up-T installation. Find information on the [Spec-Up-T documentation website](https://blockchainbird.github.io/spec-up-t-website/).
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
This is a demo site for Spec-Up-T. The subject matter – gardening and related terms – is used purely as an example to demonstrate how the system works. You can replace these demo terms and definitions with your own content to suit your documentation needs.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
[[def: compost, composting, Compost]]
|
|
2
|
+
|
|
3
|
+
~ Compost is a mixture of decayed organic matter used to fertilize soil. It is created through the process of composting, where materials like leaves, food scraps, and grass clippings break down over time. Compost improves soil structure and provides nutrients for plants. See also [[ref: Mulch]], [[ref: Soil]], [[ref: Fertilizer]], [[ref: Seedling]], [[ref: Watering]].
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
[[def: fertilizer, fertilizing, Fertilizer]]
|
|
2
|
+
|
|
3
|
+
~ Fertilizer is a substance added to soil or plants to supply essential nutrients and promote growth. Fertilizers can be organic, like compost, or synthetic. Proper fertilizing ensures healthy plant development. See also [[ref: Compost]], [[ref: Mulch]], [[ref: Soil]], [[ref: Watering]], [[ref: Seedling]].
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
[[def: mulch, mulching, Mulch]]
|
|
2
|
+
|
|
3
|
+
~ Mulch is a layer of material, such as wood chips or straw, spread on the surface of soil to retain moisture, suppress weeds, and regulate temperature. Mulching helps improve plant health and soil quality. Related terms: [[ref: Compost]], [[ref: Soil]], [[ref: Fertilizer]].
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
[[def: soil, soils, Soil]]
|
|
2
|
+
|
|
3
|
+
~ Soil is the upper layer of earth in which plants grow. It consists of a mixture of organic matter, minerals, gases, liquids, and organisms that together support life. Healthy soil is essential for gardening and agriculture.
|
|
4
|
+
|
|
5
|
+
~ Refs examples: [[ref: Compost]], [[ref: Mulch]], [[ref: Fertilizer]].
|
|
6
|
+
|
|
7
|
+
~ Xref example: [[xref: KERISuite, composability ]]
|
|
8
|
+
|
|
9
|
+
~ This Xref example does not work: [[xref: does-not-exist, Foo]]
|
|
10
|
+
|
|
11
|
+
~ Soil quality affects water retention, nutrient availability, and plant health. Amending soil with compost or mulch can improve its structure and fertility. Fertilizer may be added to supplement nutrients as needed.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
[[def: watering, Watering]]
|
|
2
|
+
|
|
3
|
+
~ Watering is the act of supplying water to plants to help them grow. Proper watering is essential for healthy roots and overall plant development. Overwatering or underwatering can harm plants. See also [[ref: Soil]], [[ref: Seedling]], [[ref: Mulch]].
|
|
@@ -23,19 +23,32 @@
|
|
|
23
23
|
},
|
|
24
24
|
"external_specs": [
|
|
25
25
|
{
|
|
26
|
-
"external_spec": "
|
|
27
|
-
"gh_page": "https://
|
|
28
|
-
"url": "https://github.com/
|
|
29
|
-
"terms_dir": "spec/
|
|
26
|
+
"external_spec": "vLEI",
|
|
27
|
+
"gh_page": "https://henkvancann.github.io/vlei-glossary/",
|
|
28
|
+
"url": "https://github.com/henkvancann/vlei-glossary",
|
|
29
|
+
"terms_dir": "spec/terms-definitions"
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
"external_spec": "
|
|
33
|
-
"gh_page": "https://
|
|
34
|
-
"url": "https://github.com/
|
|
35
|
-
"terms_dir": "spec/
|
|
32
|
+
"external_spec": "KERISuite",
|
|
33
|
+
"gh_page": "https://weboftrust.github.io/kerisuite-glossary/",
|
|
34
|
+
"url": "https://github.com/weboftrust/kerisuite-glossary",
|
|
35
|
+
"terms_dir": "spec/terms-definitions"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"external_spec": "ToIP",
|
|
39
|
+
"gh_page": "https://glossary.trustoverip.org/",
|
|
40
|
+
"url": "https://github.com/trustoverip/ctwg-main-glossary",
|
|
41
|
+
"terms_dir": "spec/terms-definitions"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"external_spec": "GenIT",
|
|
45
|
+
"gh_page": "https://trustoverip.github.io/ctwg-general-glossary/",
|
|
46
|
+
"url": "https://github.com/trustoverip/ctwg-general-glossary",
|
|
47
|
+
"terms_dir": "spec/terms-definitions"
|
|
36
48
|
}
|
|
37
49
|
],
|
|
38
|
-
"katex": false
|
|
50
|
+
"katex": false,
|
|
51
|
+
"anchor_symbol": "§"
|
|
39
52
|
}
|
|
40
53
|
]
|
|
41
54
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author Kor Dwarshuis
|
|
3
|
-
* @contact kor@dwarshuis.com
|
|
4
|
-
* @created 2024-09-07
|
|
5
|
-
* @description This script adds a button next to the search bar that allows users to download the page as a PDF.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
function pdfDownload() {
|
|
9
|
-
fetch('./index.pdf', { method: 'HEAD' })
|
|
10
|
-
.then(response => {
|
|
11
|
-
if (response.ok) {
|
|
12
|
-
let buttonPdfDownload = document.createElement("a");
|
|
13
|
-
buttonPdfDownload.classList.add("button-pdf-download");
|
|
14
|
-
buttonPdfDownload.classList.add("btn", "d-block", "btn-sm", "btn-outline-secondary");
|
|
15
|
-
buttonPdfDownload.target = "_blank";
|
|
16
|
-
buttonPdfDownload.rel = "noopener noreferrer";
|
|
17
|
-
buttonPdfDownload.href = "./index.pdf";
|
|
18
|
-
buttonPdfDownload.title = "Download this page as a PDF";
|
|
19
|
-
|
|
20
|
-
// Add PDF icon with transparent fill and text for better visual representation
|
|
21
|
-
buttonPdfDownload.innerHTML = `
|
|
22
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.5" class="me-1" viewBox="0 0 16 16">
|
|
23
|
-
<path d="M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.5L9.5 0H4zm0 1h5v4h4v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1zm7 4h-1V2l3 3h-2z"/>
|
|
24
|
-
<path d="M6.5 10.5a.5.5 0 0 1-.5-.5V7.5a.5.5 0 0 1 .5-.5H8a.5.5 0 0 1 .5.5V10a.5.5 0 0 1-.5.5H6.5z"/>
|
|
25
|
-
</svg>
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
// Add additional styling directly to the button
|
|
29
|
-
buttonPdfDownload.style.display = "inline-flex";
|
|
30
|
-
buttonPdfDownload.style.alignItems = "center";
|
|
31
|
-
buttonPdfDownload.style.justifyContent = "center";
|
|
32
|
-
|
|
33
|
-
document.querySelector('.service-menu').prepend(buttonPdfDownload);
|
|
34
|
-
} else {
|
|
35
|
-
console.log('PDF file does not exist. No PDF download button will be added.');
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
.catch(error => {
|
|
39
|
-
console.error('Error checking PDF file:', error);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
document.addEventListener("DOMContentLoaded", function () {
|
|
45
|
-
pdfDownload();
|
|
46
|
-
});
|
package/src/install-from-boilerplate/boilerplate/.github/workflows/fetch-and-push-xrefs.yml.old
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
name: fetch and push xrefs
|
|
3
|
-
|
|
4
|
-
on:
|
|
5
|
-
# push:
|
|
6
|
-
# branches:
|
|
7
|
-
# - main
|
|
8
|
-
workflow_dispatch:
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build-and-deploy-spec:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout 🛎️
|
|
17
|
-
uses: actions/checkout@v3
|
|
18
|
-
with:
|
|
19
|
-
persist-credentials: false
|
|
20
|
-
|
|
21
|
-
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
|
|
22
|
-
run: |
|
|
23
|
-
echo "start install"
|
|
24
|
-
npm install
|
|
25
|
-
echo "end install"
|
|
26
|
-
echo "Spec-Up-T version:"
|
|
27
|
-
npm list spec-up-t
|
|
28
|
-
echo "start fetching xrefs"
|
|
29
|
-
node -e "require('spec-up-t/src/get-xrefs-data.js').updateXrefs()"
|
|
30
|
-
rm -rf node_modules
|
|
31
|
-
|
|
32
|
-
- name: Commit and Push Changes
|
|
33
|
-
env:
|
|
34
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
35
|
-
run: |
|
|
36
|
-
git config --local user.email "action@github.com"
|
|
37
|
-
git config --local user.name "GitHub Action"
|
|
38
|
-
git add .
|
|
39
|
-
git commit -m "Update Xrefs data via Github Action" || echo "No changes to commit"
|
|
40
|
-
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }} HEAD:refs/heads/main
|
|
41
|
-
|
|
42
|
-
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
name: spec-up-t render
|
|
3
|
-
|
|
4
|
-
on:
|
|
5
|
-
# push:
|
|
6
|
-
# branches:
|
|
7
|
-
# - main
|
|
8
|
-
workflow_dispatch:
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
build-and-deploy-spec:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
permissions:
|
|
14
|
-
contents: write
|
|
15
|
-
steps:
|
|
16
|
-
- name: Checkout 🛎️
|
|
17
|
-
uses: actions/checkout@v2
|
|
18
|
-
with:
|
|
19
|
-
persist-credentials: false
|
|
20
|
-
- name: Extract output_path from JSON
|
|
21
|
-
# TODO: .specs[0] is a hack to get the first spec. This should be fixed.
|
|
22
|
-
run: |
|
|
23
|
-
OUTPUT_PATH=$(jq -r '.specs[0].output_path' specs.json)
|
|
24
|
-
echo "OUTPUT_PATH=$OUTPUT_PATH" >> $GITHUB_ENV
|
|
25
|
-
|
|
26
|
-
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
|
|
27
|
-
run: |
|
|
28
|
-
echo "start install"
|
|
29
|
-
npm install
|
|
30
|
-
echo "end install"
|
|
31
|
-
echo "Spec-Up-T version:"
|
|
32
|
-
npm list spec-up-t
|
|
33
|
-
echo "start render"
|
|
34
|
-
node -e "require('spec-up-t')({ nowatch: true })"
|
|
35
|
-
echo "end render"
|
|
36
|
-
rm -rf node_modules
|
|
37
|
-
|
|
38
|
-
# This is a GitHub Action to deploy your static files to GitHub Pages
|
|
39
|
-
- name: Deploy
|
|
40
|
-
uses: peaceiris/actions-gh-pages@v3.7.3
|
|
41
|
-
with:
|
|
42
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
43
|
-
publish_dir: ${{ env.OUTPUT_PATH }} # Use the OUTPUT_PATH environment variable
|
|
44
|
-
allow_empty_commit: true
|
|
45
|
-
force_orphan: true
|
|
46
|
-
|
|
47
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
[[def: term 1, term one, Term One]]
|
|
2
|
-
|
|
3
|
-
~ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum faucibus volutpat justo, sed ornare velit.
|
|
4
|
-
|
|
5
|
-
~ Refs examples: [[ref: Term 2]], [[ref: Term Two]], [[ref: Term 3]].
|
|
6
|
-
|
|
7
|
-
~ Xref example: [[xref: test-1, Aal]]
|
|
8
|
-
|
|
9
|
-
~ This Xref example does not work: [[xref: does-not-exist, Foo]]
|
|
10
|
-
|
|
11
|
-
~ Donec aliquam et ligula id congue. Sed eu urna et tellus placerat viverra. Quisque ut posuere magna, nec accumsan augue. Nullam mauris tortor, semper finibus elementum maximus, imperdiet in felis. Suspendisse quis imperdiet nibh, eget ultrices justo. Pellentesque vitae malesuada justo. Vestibulum quis scelerisque lectus, non rutrum odio. Aenean leo orci, semper non massa sed, facilisis ornare ipsum. Morbi at sem orci. Integer eros mi, faucibus sed lorem id, pharetra imperdiet nisl. Integer viverra enim vel luctus lobortis. Ut turpis tellus, consequat nec lectus et, dictum elementum nunc. Integer rhoncus venenatis molestie. Donec egestas condimentum ligula in porttitor. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
|
|
12
|
-
|
|
13
|
-
~ Extra text for testing purposes.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
[[def: term 2, term two, Term Two]]
|
|
2
|
-
|
|
3
|
-
~ Pellentesque suscipit ipsum varius, mattis diam in, elementum nunc [[ref: Term 1]], [[ref: Term Three]], [[ref: Term 3]], [[ref: Term 4]]. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec placerat, elit sed tempor viverra, magna ligula porttitor tortor, eget suscipit erat enim vel nisl. Integer vel urna in quam viverra dignissim at in orci. Aliquam erat volutpat. Nam vitae neque nibh. In sollicitudin felis vitae ex finibus, in eleifend lectus efficitur. Vestibulum enim ex, condimentum nec accumsan ut, vestibulum at lacus. Maecenas non vulputate ante. Sed porttitor et eros sit amet venenatis.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
[[def: term 3, term three, Term Three]]
|
|
2
|
-
|
|
3
|
-
~ Nam euismod augue sed tempus imperdiet. Pellentesque ac porta ipsum, sed sodales leo. Suspendisse molestie est sit amet est porta, sit amet molestie dolor pharetra. Duis porta mollis sem vel aliquam. Maecenas laoreet turpis nunc, vitae mattis urna auctor ac. Donec mattis quis urna nec porta. Sed sit amet viverra ligula. Vivamus vitae sem sodales, malesuada dui sit amet, viverra lectus. Integer ullamcorper molestie ante, in blandit nunc tempus auctor.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
[[def: term 4, term four, Term Four]]
|
|
2
|
-
|
|
3
|
-
~ Sed lorem nunc, ultricies nec nibh eu, bibendum sollicitudin arcu. Nullam porttitor condimentum elit ac commodo. Aenean ac augue quis arcu congue aliquam vitae in massa. Aliquam erat volutpat. Curabitur lobortis, sapien vitae mattis dignissim, risus augue iaculis risus, sed tempus sapien ex nec massa. Integer quis maximus nunc. Nunc ultrices sapien erat, at congue augue mattis sit amet. Aliquam condimentum luctus nunc, ut euismod augue commodo in.
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const { fixMarkdownFiles } = require('./src/fix-markdown-files');
|
|
2
|
-
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
|
|
5
|
-
// Test cases for the default definition functionality
|
|
6
|
-
function testDefaultDefinitions() {
|
|
7
|
-
console.log('Running tests for default definition functionality...');
|
|
8
|
-
|
|
9
|
-
const testContent = [
|
|
10
|
-
'[[def: test-term, test-term]]',
|
|
11
|
-
'',
|
|
12
|
-
'[[tref: another-term, another-term]]',
|
|
13
|
-
'',
|
|
14
|
-
'[[def: term-with-def, term-with-def]]',
|
|
15
|
-
'',
|
|
16
|
-
'~ This term already has a definition',
|
|
17
|
-
'',
|
|
18
|
-
'[[tref: final-term, final-term]]'
|
|
19
|
-
].join('\n');
|
|
20
|
-
|
|
21
|
-
// Write test content to a temp file
|
|
22
|
-
const tempFile = './temp-test.md';
|
|
23
|
-
fs.writeFileSync(tempFile, testContent, 'utf8');
|
|
24
|
-
|
|
25
|
-
// Process the file
|
|
26
|
-
fixMarkdownFiles('.');
|
|
27
|
-
|
|
28
|
-
// Read and verify results
|
|
29
|
-
const result = fs.readFileSync(tempFile, 'utf8');
|
|
30
|
-
console.log('Test result:');
|
|
31
|
-
console.log(result);
|
|
32
|
-
|
|
33
|
-
// Clean up
|
|
34
|
-
fs.unlinkSync(tempFile);
|
|
35
|
-
|
|
36
|
-
// Verify expected content
|
|
37
|
-
const lines = result.split('\n');
|
|
38
|
-
let hasDefaultDefs = 0;
|
|
39
|
-
|
|
40
|
-
for (let i = 0; i < lines.length; i++) {
|
|
41
|
-
if (lines[i] === '~ No local definition found.') {
|
|
42
|
-
hasDefaultDefs++;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
console.log(`Found ${hasDefaultDefs} default definitions`);
|
|
47
|
-
|
|
48
|
-
if (hasDefaultDefs === 3) { // Should be 3: test-term, another-term, final-term
|
|
49
|
-
console.log('✅ Test passed: All terms without definitions got default definitions');
|
|
50
|
-
} else {
|
|
51
|
-
console.log('❌ Test failed: Expected 3 default definitions');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
testDefaultDefinitions();
|
package/test-edge-cases.md
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
[[def: term1, term1]]
|
|
2
|
-
|
|
3
|
-
~ No local definition found.
|
|
4
|
-
|
|
5
|
-
[[def: term2, term2]]
|
|
6
|
-
|
|
7
|
-
~ This term has a definition
|
|
8
|
-
|
|
9
|
-
[[tref: term3, term3]]
|
|
10
|
-
|
|
11
|
-
~ No local definition found.
|
|
12
|
-
|
|
13
|
-
[[def: term4, term4]]
|
|
14
|
-
|
|
15
|
-
~ This term also has a definition
|
|
16
|
-
~ With multiple lines
|
|
17
|
-
|
|
18
|
-
[[tref: term5, term5]]
|
|
19
|
-
|
|
20
|
-
~ No local definition found.
|