spec-up-t 1.3.0 → 1.4.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/.github/copilot-instructions.md +13 -0
- package/assets/compiled/body.js +18 -12
- package/assets/compiled/head.css +8 -6
- package/assets/css/collapse-definitions.css +0 -1
- package/assets/css/counter.css +10 -22
- package/assets/css/create-pdf.css +4 -2
- package/assets/css/create-term-filter.css +4 -4
- package/assets/css/definition-buttons-container.css +60 -0
- package/assets/css/{pdf-download.css → download-pdf-docx.css} +9 -5
- package/assets/css/insert-trefs.css +7 -0
- package/assets/css/sidebar-toc.css +2 -1
- package/assets/css/terms-and-definitions.css +73 -22
- package/assets/js/add-href-to-snapshot-link.js +16 -9
- package/assets/js/addAnchorsToTerms.js +2 -2
- package/assets/js/charts.js +10 -0
- package/assets/js/collapse-definitions.js +13 -2
- package/assets/js/collapse-meta-info.js +11 -9
- package/assets/js/definition-button-container-utils.js +82 -0
- package/assets/js/download-pdf-docx.js +68 -0
- package/assets/js/edit-term-buttons.js +77 -20
- package/assets/js/github-issues.js +35 -0
- package/assets/js/github-repo-info.js +144 -0
- package/assets/js/highlight-heading-plus-sibling-nodes.test.js +18 -0
- package/assets/js/insert-trefs.js +62 -13
- package/assets/js/mermaid-diagrams.js +11 -0
- package/assets/js/terminology-section-utility-container/README.md +107 -0
- package/assets/js/terminology-section-utility-container/create-alphabet-index.js +17 -0
- package/assets/js/{create-term-filter.js → terminology-section-utility-container/create-term-filter.js} +11 -44
- package/assets/js/terminology-section-utility-container/hide-show-utility-container.js +21 -0
- package/assets/js/terminology-section-utility-container/search.js +203 -0
- package/assets/js/terminology-section-utility-container.js +203 -0
- package/assets/js/tooltips.js +283 -0
- package/config/asset-map.json +26 -18
- package/index.js +57 -390
- package/package.json +5 -2
- package/src/add-remove-xref-source.js +20 -21
- package/src/collect-external-references.js +8 -337
- package/src/collect-external-references.test.js +440 -33
- package/src/configure.js +8 -109
- package/src/create-docx.js +7 -6
- package/src/create-pdf.js +15 -14
- package/src/freeze-spec-data.js +46 -0
- package/src/git-info.test.js +76 -0
- package/src/health-check/destination-gitignore-checker.js +5 -3
- package/src/health-check/external-specs-checker.js +5 -4
- package/src/health-check/specs-configuration-checker.js +2 -1
- package/src/health-check/term-references-checker.js +5 -3
- package/src/health-check/terms-intro-checker.js +2 -1
- package/src/health-check/tref-term-checker.js +8 -7
- package/src/health-check.js +8 -7
- package/src/init.js +3 -2
- package/src/install-from-boilerplate/add-gitignore-entries.js +3 -2
- package/src/install-from-boilerplate/add-scripts-keys.js +5 -4
- package/src/install-from-boilerplate/boilerplate/.github/workflows/menu.yml +74 -97
- package/src/install-from-boilerplate/boilerplate/README.md +1 -1
- package/src/install-from-boilerplate/boilerplate/spec/example-markup-in-markdown.md +1 -1
- package/src/install-from-boilerplate/boilerplate/spec/spec-head.md +2 -2
- 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 +24 -10
- package/src/install-from-boilerplate/config-scripts-keys.js +3 -3
- package/src/install-from-boilerplate/config-system-files.js +0 -1
- package/src/install-from-boilerplate/copy-boilerplate.js +2 -1
- package/src/install-from-boilerplate/copy-system-files.js +4 -3
- package/src/install-from-boilerplate/custom-update.js +12 -1
- package/src/install-from-boilerplate/help.txt +1 -1
- package/src/install-from-boilerplate/menu.sh +6 -6
- package/src/json-key-validator.js +17 -11
- package/src/markdown-it/README.md +207 -0
- package/src/markdown-it/definition-lists.js +397 -0
- package/src/markdown-it/index.js +83 -0
- package/src/markdown-it/link-enhancement.js +98 -0
- package/src/markdown-it/plugins.js +118 -0
- package/src/markdown-it/table-enhancement.js +97 -0
- package/src/markdown-it/template-tag-syntax.js +152 -0
- package/src/parsers/index.js +16 -0
- package/src/parsers/spec-parser.js +152 -0
- package/src/parsers/spec-parser.test.js +109 -0
- package/src/parsers/template-tag-parser.js +277 -0
- package/src/parsers/template-tag-parser.test.js +107 -0
- package/src/pipeline/configuration/configure-starterpack.js +200 -0
- package/src/{create-external-specs-list.js → pipeline/configuration/create-external-specs-list.js} +13 -12
- package/src/{create-term-index.js → pipeline/configuration/create-term-index.js} +19 -18
- package/src/{create-versions-index.js → pipeline/configuration/create-versions-index.js} +4 -3
- package/src/{insert-term-index.js → pipeline/configuration/insert-term-index.js} +2 -2
- package/src/pipeline/configuration/prepare-spec-configuration.js +70 -0
- package/src/pipeline/parsing/apply-markdown-it-extensions.js +35 -0
- package/src/pipeline/parsing/create-markdown-parser.js +94 -0
- package/src/pipeline/parsing/create-markdown-parser.test.js +49 -0
- package/src/{html-dom-processor.js → pipeline/postprocessing/definition-list-postprocessor.js} +69 -10
- package/src/{escape-handler.js → pipeline/preprocessing/escape-processor.js} +3 -1
- package/src/{fix-markdown-files.js → pipeline/preprocessing/normalize-terminology-markdown.js} +41 -31
- package/src/pipeline/references/collect-external-references.js +307 -0
- package/src/pipeline/references/external-references-service.js +231 -0
- package/src/pipeline/references/fetch-terms-from-index.js +198 -0
- package/src/pipeline/references/match-term.js +34 -0
- package/src/{collectExternalReferences/matchTerm.test.js → pipeline/references/match-term.test.js} +8 -2
- package/src/pipeline/references/process-xtrefs-data.js +94 -0
- package/src/pipeline/references/xtref-utils.js +166 -0
- package/src/pipeline/rendering/render-spec-document.js +146 -0
- package/src/pipeline/rendering/render-utils.js +154 -0
- package/src/utils/LOGGER.md +81 -0
- package/src/utils/{doesUrlExist.js → does-url-exist.js} +4 -3
- package/src/utils/fetch.js +5 -4
- package/src/utils/file-opener.js +3 -2
- package/src/utils/git-info.js +77 -0
- package/src/utils/logger.js +74 -0
- package/src/utils/regex-patterns.js +471 -0
- package/src/utils/regex-patterns.test.js +281 -0
- package/templates/template.html +56 -21
- package/assets/js/create-alphabet-index.js +0 -60
- package/assets/js/hide-show-utility-container.js +0 -16
- package/assets/js/index.js +0 -87
- package/assets/js/pdf-download.js +0 -46
- package/assets/js/search.js +0 -365
- package/src/collectExternalReferences/fetchTermsFromIndex.js +0 -284
- package/src/collectExternalReferences/matchTerm.js +0 -32
- package/src/collectExternalReferences/processXTrefsData.js +0 -108
- package/src/freeze.js +0 -90
- 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/src/markdown-it-extensions.js +0 -395
- package/src/references.js +0 -114
- /package/assets/css/{bootstrap.min.css → embedded-libraries/bootstrap.min.css} +0 -0
- /package/assets/css/{prism.css → embedded-libraries/prism.css} +0 -0
- /package/assets/css/{prism.dark.css → embedded-libraries/prism.dark.css} +0 -0
- /package/assets/css/{prism.default.css → embedded-libraries/prism.default.css} +0 -0
- /package/assets/js/{bootstrap.bundle.min.js → embedded-libraries/bootstrap.bundle.min.js} +0 -0
- /package/assets/js/{chart.js → embedded-libraries/chart.js} +0 -0
- /package/assets/js/{diff.min.js → embedded-libraries/diff.min.js} +0 -0
- /package/assets/js/{font-awesome.js → embedded-libraries/font-awesome.js} +0 -0
- /package/assets/js/{mermaid.js → embedded-libraries/mermaid.js} +0 -0
- /package/assets/js/{notyf.js → embedded-libraries/notyf.js} +0 -0
- /package/assets/js/{popper.js → embedded-libraries/popper.js} +0 -0
- /package/assets/js/{prism.dark.js → embedded-libraries/prism.dark.js} +0 -0
- /package/assets/js/{prism.default.js → embedded-libraries/prism.default.js} +0 -0
- /package/assets/js/{prism.js → embedded-libraries/prism.js} +0 -0
- /package/assets/js/{tippy.js → embedded-libraries/tippy.js} +0 -0
- /package/src/{escape-mechanism.js → pipeline/preprocessing/escape-placeholder-utils.js} +0 -0
- /package/src/utils/{isLineWithDefinition.js → is-line-with-definition.js} +0 -0
package/src/init.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
|
+
const Logger = require('./utils/logger');
|
|
3
4
|
const outputDir = path.join(process.cwd(), '.cache');
|
|
4
5
|
const initFlagPath = path.join(outputDir, 'init.flag');
|
|
5
6
|
|
|
@@ -20,9 +21,9 @@ async function initialize() {
|
|
|
20
21
|
// Create the init flag file
|
|
21
22
|
await fs.writeFile(initFlagPath, 'Initialization completed.');
|
|
22
23
|
|
|
23
|
-
|
|
24
|
+
Logger.success('Initialization complete.');
|
|
24
25
|
} catch (error) {
|
|
25
|
-
|
|
26
|
+
Logger.error(`Initialization failed: ${error.message}`);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const fs = require('fs').promises;
|
|
2
|
+
const Logger = require('../utils/logger');
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Reads the content of a file or returns an empty string if the file does not exist.
|
|
@@ -42,9 +43,9 @@ async function updateGitignore(gitignorePath, filesToAdd) {
|
|
|
42
43
|
// Write the updated content back to the .gitignore file
|
|
43
44
|
await fs.writeFile(gitignorePath, updatedGitignoreContent, 'utf8');
|
|
44
45
|
|
|
45
|
-
|
|
46
|
+
Logger.success('Updated .gitignore file');
|
|
46
47
|
} catch (error) {
|
|
47
|
-
|
|
48
|
+
Logger.error('Error updating .gitignore:', error.message);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const path = require('path');
|
|
3
|
+
const Logger = require('../utils/logger');
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Adds scripts to the package.json file.
|
|
@@ -15,7 +16,7 @@ function addScriptsKeys(scriptKeys, overwriteKeys = {}) {
|
|
|
15
16
|
// Read the package.json file
|
|
16
17
|
fs.readFile(packageJsonPath, 'utf8', (err, data) => {
|
|
17
18
|
if (err) {
|
|
18
|
-
|
|
19
|
+
Logger.error('Error reading package.json:', err);
|
|
19
20
|
return;
|
|
20
21
|
}
|
|
21
22
|
|
|
@@ -38,13 +39,13 @@ function addScriptsKeys(scriptKeys, overwriteKeys = {}) {
|
|
|
38
39
|
// Write the updated package.json back to disk
|
|
39
40
|
fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8', (err) => {
|
|
40
41
|
if (err) {
|
|
41
|
-
|
|
42
|
+
Logger.error('Error writing package.json:', err);
|
|
42
43
|
} else {
|
|
43
|
-
|
|
44
|
+
Logger.success('Scripts added to package.json successfully!');
|
|
44
45
|
}
|
|
45
46
|
});
|
|
46
47
|
} catch (parseError) {
|
|
47
|
-
|
|
48
|
+
Logger.error('Error parsing package.json:', parseError);
|
|
48
49
|
}
|
|
49
50
|
});
|
|
50
51
|
}
|
|
@@ -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,106 +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
|
-
echo "You can do this by editing local files in an editor or by going to your repository on GitHub."
|
|
65
|
-
echo "More info: https://blockchainbird.github.io/spec-up-t-website/docs/various-roles/content-authors-guide/introduction"
|
|
65
|
+
case "${{ github.event.inputs.action_type }}" in
|
|
66
|
+
render)
|
|
67
|
+
npm run render
|
|
66
68
|
;;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
git config --global user.email "actions@github.com"
|
|
70
|
-
git config --global user.name "GitHub Actions"
|
|
71
|
-
git add .
|
|
72
|
-
git commit -m "Render specification: Update files" || echo "No changes to commit"
|
|
73
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
69
|
+
topdf)
|
|
70
|
+
npm run topdf
|
|
74
71
|
;;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
node -e "require('spec-up-t/src/create-docx.js')"
|
|
78
|
-
git config --global user.email "actions@github.com"
|
|
79
|
-
git config --global user.name "GitHub Actions"
|
|
80
|
-
git add .
|
|
81
|
-
git commit -m "Export to DOCX" || echo "No changes to commit"
|
|
82
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
72
|
+
todocx)
|
|
73
|
+
npm run todocx
|
|
83
74
|
;;
|
|
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 "Collect external references" || echo "No changes to commit"
|
|
90
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
75
|
+
freeze)
|
|
76
|
+
npm run freeze
|
|
91
77
|
;;
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
git config --global user.email "actions@github.com"
|
|
95
|
-
git config --global user.name "GitHub Actions"
|
|
96
|
-
git add .
|
|
97
|
-
git commit -m "Export to PDF" || echo "No changes to commit"
|
|
98
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
78
|
+
custom-update)
|
|
79
|
+
npm run custom-update
|
|
99
80
|
;;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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)
|
|
102
|
+
git commit -m "Render specification: Update files" || echo "No changes to commit"
|
|
107
103
|
;;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
git config --global user.email "actions@github.com"
|
|
111
|
-
git config --global user.name "GitHub Actions"
|
|
112
|
-
git add .
|
|
113
|
-
git commit -m "Add, remove or view xref source" || echo "No changes to commit"
|
|
114
|
-
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"
|
|
115
106
|
;;
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
git config --global user.email "actions@github.com"
|
|
119
|
-
git config --global user.name "GitHub Actions"
|
|
120
|
-
git add .
|
|
121
|
-
git commit -m "Configure" || echo "No changes to commit"
|
|
122
|
-
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"
|
|
123
109
|
;;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
git config --global user.email "actions@github.com"
|
|
127
|
-
git config --global user.name "GitHub Actions"
|
|
128
|
-
git add .
|
|
129
|
-
git commit -m "Run health check" || echo "No changes to commit"
|
|
130
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
110
|
+
collectExternalReferences)
|
|
111
|
+
git commit -m "Collect external references" || echo "No changes to commit"
|
|
131
112
|
;;
|
|
132
|
-
|
|
133
|
-
echo "
|
|
134
|
-
echo "Please visit the URL manually: https://blockchainbird.github.io/spec-up-t-website/"
|
|
113
|
+
freeze)
|
|
114
|
+
git commit -m "Freeze specification" || echo "No changes to commit"
|
|
135
115
|
;;
|
|
136
|
-
|
|
137
|
-
npm update && node -e "require('spec-up-t/src/install-from-boilerplate/custom-update.js')"
|
|
138
|
-
git config --global user.email "actions@github.com"
|
|
139
|
-
git config --global user.name "GitHub Actions"
|
|
140
|
-
git add .
|
|
116
|
+
custom-update)
|
|
141
117
|
git commit -m "Custom update: Copy files from spec-up-t" || echo "No changes to commit"
|
|
142
|
-
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
143
118
|
;;
|
|
144
119
|
*)
|
|
145
|
-
|
|
146
|
-
exit 1
|
|
120
|
+
git commit -m "Update files: ${{ github.event.inputs.action_type }}" || echo "No changes to commit"
|
|
147
121
|
;;
|
|
148
122
|
esac
|
|
123
|
+
|
|
124
|
+
# Push changes
|
|
125
|
+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
|
|
149
126
|
|
|
150
|
-
- name:
|
|
151
|
-
if: success()
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
|
158
135
|
|
|
159
136
|
- name: Clean up
|
|
160
137
|
if: always()
|
|
161
138
|
run: |
|
|
162
139
|
echo "Cleaning up..."
|
|
163
|
-
rm -rf node_modules
|
|
140
|
+
rm -rf node_modules
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Intro
|
|
4
4
|
|
|
5
|
-
This is a default Spec-Up-T installation. Find information on the [Spec-Up-T documentation website](https://
|
|
5
|
+
This is a default Spec-Up-T installation. Find information on the [Spec-Up-T documentation website](https://trustoverip.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]].
|
|
@@ -19,23 +19,37 @@
|
|
|
19
19
|
"source": {
|
|
20
20
|
"host": "github",
|
|
21
21
|
"account": "trustoverip",
|
|
22
|
-
"repo": "spec-up-t-starter-pack"
|
|
22
|
+
"repo": "spec-up-t-starter-pack",
|
|
23
|
+
"branch": "main"
|
|
23
24
|
},
|
|
24
25
|
"external_specs": [
|
|
25
26
|
{
|
|
26
|
-
"external_spec": "
|
|
27
|
-
"gh_page": "https://
|
|
28
|
-
"url": "https://github.com/
|
|
29
|
-
"terms_dir": "spec/
|
|
27
|
+
"external_spec": "vLEI",
|
|
28
|
+
"gh_page": "https://henkvancann.github.io/vlei-glossary/",
|
|
29
|
+
"url": "https://github.com/henkvancann/vlei-glossary",
|
|
30
|
+
"terms_dir": "spec/terms-definitions"
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
|
-
"external_spec": "
|
|
33
|
-
"gh_page": "https://
|
|
34
|
-
"url": "https://github.com/
|
|
35
|
-
"terms_dir": "spec/
|
|
33
|
+
"external_spec": "KERISuite",
|
|
34
|
+
"gh_page": "https://weboftrust.github.io/kerisuite-glossary/",
|
|
35
|
+
"url": "https://github.com/weboftrust/kerisuite-glossary",
|
|
36
|
+
"terms_dir": "spec/terms-definitions"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"external_spec": "ToIP",
|
|
40
|
+
"gh_page": "https://glossary.trustoverip.org/",
|
|
41
|
+
"url": "https://github.com/trustoverip/ctwg-main-glossary",
|
|
42
|
+
"terms_dir": "spec/terms-definitions"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"external_spec": "GenIT",
|
|
46
|
+
"gh_page": "https://trustoverip.github.io/ctwg-general-glossary/",
|
|
47
|
+
"url": "https://github.com/trustoverip/ctwg-general-glossary",
|
|
48
|
+
"terms_dir": "spec/terms-definitions"
|
|
36
49
|
}
|
|
37
50
|
],
|
|
38
|
-
"katex": false
|
|
51
|
+
"katex": false,
|
|
52
|
+
"anchor_symbol": "§"
|
|
39
53
|
}
|
|
40
54
|
]
|
|
41
55
|
}
|
|
@@ -2,11 +2,11 @@ const configScriptsKeys = {
|
|
|
2
2
|
"edit": "node -e \"require('spec-up-t')()\"",
|
|
3
3
|
"render": "node --no-warnings -e \"require('spec-up-t/index.js')({ nowatch: true })\"",
|
|
4
4
|
"dev": "node -e \"require('spec-up-t')({ dev: true })\"",
|
|
5
|
-
"collectExternalReferences": "node --no-warnings -e \"require('spec-up-t/src/collect-external-references.js').collectExternalReferences()\"",
|
|
5
|
+
"collectExternalReferences": "node --no-warnings -e \"require('spec-up-t/src/pipeline/references/collect-external-references.js').collectExternalReferences()\"",
|
|
6
6
|
"topdf": "node -e \"require('spec-up-t/src/create-pdf.js')\"",
|
|
7
7
|
"todocx": "node -e \"require('spec-up-t/src/create-docx.js')\"",
|
|
8
|
-
"freeze": "node -e \"require('spec-up-t/src/freeze.js')\"",
|
|
9
|
-
"references": "node -e \"require('spec-up-t/src/references.js')\"",
|
|
8
|
+
"freeze": "node -e \"require('spec-up-t/src/freeze-spec-data.js')\"",
|
|
9
|
+
"references": "node -e \"require('spec-up-t/src/pipeline/references/external-references-service.js')\"",
|
|
10
10
|
"help": "cat ./node_modules/spec-up-t/src/install-from-boilerplate/help.txt",
|
|
11
11
|
"menu": "bash ./node_modules/spec-up-t/src/install-from-boilerplate/menu.sh",
|
|
12
12
|
"addremovexrefsource": "node --no-warnings -e \"require('spec-up-t/src/add-remove-xref-source.js')\"",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
|
+
const Logger = require('../utils/logger');
|
|
3
4
|
|
|
4
5
|
function copyBoilerplate() {
|
|
5
6
|
const sourceDir = path.join(__dirname, './', 'boilerplate');
|
|
@@ -16,7 +17,7 @@ function copyBoilerplate() {
|
|
|
16
17
|
const gitignoreDestPath = path.join(__dirname, '../../../../', '.gitignore');
|
|
17
18
|
fs.renameSync(gitignorePath, gitignoreDestPath);
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
Logger.success('Copied spec-up-t-boilerplate to current directory');
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
module.exports = copyBoilerplate;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const fs = require('fs-extra');
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const { systemFiles } = require('./config-system-files.js');
|
|
4
|
+
const Logger = require('../utils/logger');
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Copies system files from the boilerplate directory to the root of the project.
|
|
@@ -18,13 +19,13 @@ function copySystemFiles() {
|
|
|
18
19
|
|
|
19
20
|
try {
|
|
20
21
|
fs.cpSync(srcPath, destPath, { recursive: true });
|
|
21
|
-
|
|
22
|
+
Logger.success(`Copied ${item} to ${destPath}`);
|
|
22
23
|
} catch (error) {
|
|
23
|
-
|
|
24
|
+
Logger.error(`Failed to copy ${item} to ${destPath}:`, error);
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
Logger.success('Copied system files to current directory');
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
module.exports = copySystemFiles;
|
|
@@ -10,4 +10,15 @@ addScriptsKeys(configScriptsKeys, configOverwriteScriptsKeys);
|
|
|
10
10
|
copySystemFiles();
|
|
11
11
|
updateGitignore(gitIgnoreEntries.gitignorePath, gitIgnoreEntries.filesToAdd);
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
const Logger = require('../utils/logger');
|
|
14
|
+
|
|
15
|
+
// We can use this file to do any custom updates during post-install.
|
|
16
|
+
const customUpdate = () => {
|
|
17
|
+
// Custom logic here
|
|
18
|
+
// ...
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Call custom update
|
|
22
|
+
customUpdate();
|
|
23
|
+
|
|
24
|
+
Logger.success("Custom update done");
|
|
@@ -21,7 +21,7 @@ function handle_choice() {
|
|
|
21
21
|
echo " ${options[index]}"
|
|
22
22
|
echo -e " ************************************\n\n"
|
|
23
23
|
show_progress
|
|
24
|
-
${options[index + 1]}
|
|
24
|
+
"${options[index + 1]}"
|
|
25
25
|
else
|
|
26
26
|
clear
|
|
27
27
|
echo -e "\n\n ************************************"
|
|
@@ -69,7 +69,7 @@ function prompt_input() {
|
|
|
69
69
|
|
|
70
70
|
function do_add_content() {
|
|
71
71
|
clear
|
|
72
|
-
echo -e "\n\n\n ********************\n\n\n You can start adding your content to the markdown files in the "spec" directory.\n\n You can do this by editing local files in an editor or by going to your repository on GitHub.\n\n More info: https://
|
|
72
|
+
echo -e "\n\n\n ********************\n\n\n You can start adding your content to the markdown files in the "spec" directory.\n\n You can do this by editing local files in an editor or by going to your repository on GitHub.\n\n More info: https://trustoverip.github.io/spec-up-t-website/docs/various-roles/content-authors-guide/introduction\n\n\n ********************"
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function do_render() { clear; npm run render; }
|
|
@@ -83,14 +83,14 @@ function do_freeze() { clear; npm run freeze; }
|
|
|
83
83
|
|
|
84
84
|
function do_help() {
|
|
85
85
|
clear
|
|
86
|
-
echo -e "\n\n\n You will be redirected to the documentation website\n\n (https://
|
|
86
|
+
echo -e "\n\n\n You will be redirected to the documentation website\n\n (https://trustoverip.github.io/spec-up-t-website/)."
|
|
87
87
|
sleep 2
|
|
88
88
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
89
|
-
open "https://
|
|
89
|
+
open "https://trustoverip.github.io/spec-up-t-website/"
|
|
90
90
|
elif [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|
91
|
-
xdg-open "https://
|
|
91
|
+
xdg-open "https://trustoverip.github.io/spec-up-t-website/"
|
|
92
92
|
elif [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" || "$OSTYPE" == "win32" ]]; then
|
|
93
|
-
start "https://
|
|
93
|
+
start "https://trustoverip.github.io/spec-up-t-website/"
|
|
94
94
|
else
|
|
95
95
|
echo "Unsupported OS."
|
|
96
96
|
fi
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const fs = require('fs');
|
|
12
12
|
const readlineSync = require('readline-sync');
|
|
13
|
+
const Logger = require('./utils/logger');
|
|
13
14
|
|
|
14
15
|
let errorFound = false;
|
|
15
16
|
|
|
@@ -25,6 +26,11 @@ function loadData() {
|
|
|
25
26
|
|
|
26
27
|
// This function recursively checks if the required keys are present in the object
|
|
27
28
|
function checkKeysSync(object, expectedKeys, parentKey = '') {
|
|
29
|
+
// Guard against undefined or non-iterable expected key definitions so the validator fails gracefully instead of throwing.
|
|
30
|
+
if (!Array.isArray(expectedKeys)) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
|
|
28
34
|
for (let key of expectedKeys) {
|
|
29
35
|
if (Array.isArray(object)) {
|
|
30
36
|
// If the object is an array, check each item within the array
|
|
@@ -34,7 +40,7 @@ function checkKeysSync(object, expectedKeys, parentKey = '') {
|
|
|
34
40
|
} else if (typeof object === 'object') {
|
|
35
41
|
// If the key is missing from the object, log an error
|
|
36
42
|
if (!(key in object)) {
|
|
37
|
-
|
|
43
|
+
Logger.error(`Error: Missing key '${key}'\n We cannot guarantee that Spec-Up-T will work properly.\n Here is an example specs.json file:\n https://github.com/trustoverip/spec-up-t-starter-pack/blob/main/spec-up-t-boilerplate/specs.json`);
|
|
38
44
|
errorFound = true;
|
|
39
45
|
pauseForEnterSync(); // Pause synchronously to allow user to acknowledge the error
|
|
40
46
|
}
|
|
@@ -61,7 +67,7 @@ function runJsonKeyValidatorSync() {
|
|
|
61
67
|
"logo",
|
|
62
68
|
"logo_link",
|
|
63
69
|
"source",
|
|
64
|
-
"external_specs"
|
|
70
|
+
// "external_specs"
|
|
65
71
|
// "assets" // Commented out: We no longer check for 'assets' in the specs object
|
|
66
72
|
],
|
|
67
73
|
source: [
|
|
@@ -69,12 +75,12 @@ function runJsonKeyValidatorSync() {
|
|
|
69
75
|
"account",
|
|
70
76
|
"repo"
|
|
71
77
|
],
|
|
72
|
-
external_specs: [
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
],
|
|
78
|
+
// external_specs: [
|
|
79
|
+
// "gh_page",
|
|
80
|
+
// "external_spec",
|
|
81
|
+
// "url",
|
|
82
|
+
// "terms_dir"
|
|
83
|
+
// ],
|
|
78
84
|
// Removed the 'assets' block entirely, as it's no longer part of the required keys:
|
|
79
85
|
// assets: [
|
|
80
86
|
// "path",
|
|
@@ -85,7 +91,7 @@ function runJsonKeyValidatorSync() {
|
|
|
85
91
|
|
|
86
92
|
// Iterate over each spec entry in the specs array from the JSON file
|
|
87
93
|
for (let [index, spec] of data.specs.entries()) {
|
|
88
|
-
|
|
94
|
+
Logger.info(`Checking spec #${index + 1}`);
|
|
89
95
|
|
|
90
96
|
// Check for keys defined in expectedKeys.specs
|
|
91
97
|
checkKeysSync(spec, expectedKeys.specs, `specs[${index}]`);
|
|
@@ -96,7 +102,7 @@ function runJsonKeyValidatorSync() {
|
|
|
96
102
|
}
|
|
97
103
|
|
|
98
104
|
// Check for keys inside the 'external_specs' array, if present
|
|
99
|
-
if (spec.external_specs) {
|
|
105
|
+
if (spec.external_specs && Array.isArray(expectedKeys.external_specs)) {
|
|
100
106
|
checkKeysSync(spec.external_specs, expectedKeys.external_specs, `specs[${index}].external_specs`);
|
|
101
107
|
}
|
|
102
108
|
|
|
@@ -108,7 +114,7 @@ function runJsonKeyValidatorSync() {
|
|
|
108
114
|
|
|
109
115
|
// If no errors were found, print a success message
|
|
110
116
|
if (!errorFound) {
|
|
111
|
-
|
|
117
|
+
Logger.success('All keys are present. No errors found. Continuing…');
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
120
|
|