From 192a191f76a1639cf4edeb31f9c0e8a89fbf2eba Mon Sep 17 00:00:00 2001 From: Ca5e Date: Wed, 29 Nov 2023 14:48:12 +0100 Subject: [PATCH] Add HRGT --- docs/glossary.md | 8 ++++++- docs/terminology-config.yaml | 41 +++++++++++++++++++++++------------- package.json | 3 ++- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/docs/glossary.md b/docs/glossary.md index 7fb7f8aa5..afdedf136 100644 --- a/docs/glossary.md +++ b/docs/glossary.md @@ -5,7 +5,13 @@ sidebar_label: Glossary date: 20210601 --- +# eSSIF-Lab Glossary + :::info Editor's note An introduction paragraph is needed. -The remainder of file will need to be generated (by some appropriate tool). +The remainder of this file is generated by the [HRGT](@tev2). ::: + +{% hrg="" converter="" %} + +--- diff --git a/docs/terminology-config.yaml b/docs/terminology-config.yaml index 29c572d58..ce62f54ea 100644 --- a/docs/terminology-config.yaml +++ b/docs/terminology-config.yaml @@ -1,23 +1,34 @@ # TNO Terminology Design tools configuration file (yaml) ## General -scopedir: docs # path of the scope directory where the SAF is located -onNotExist: warn # the action in case a `vsntag` was specified, but wasn't found in the SAF - +scopedir: docs # path of the scope directory where the SAF is located +onNotExist: warn # the action in case a `vsntag` was specified, but wasn't found in the SAF +output: . # (root) directory for output files to be written to ## Machine Readable Glossary Tool -vsntag: # versiontag for which the MRG needs to be (re)generated. Leave empty to process all versions +mrgt: + vsntag: # versiontag for which the MRG needs to be (re)generated. Leave empty to process all versions +## Human Readable Glossary Tool +hrgt: + interpreter: basic + converter: | + ### [{{#if glossaryTerm}}{{glossaryTerm}}{{else}}{{capFirst term}}{{/if}}]({{localize navurl}})\n + {{#if glossaryText}}{{glossaryText}}{{else}}no `glossaryText` was specified for this entry.{{/if}}\n + force: true + input: + - "docs/glossary.md" ## Term Reference Resolution Tool -output: . # (root) directory for output files to be written -interpreter: # type of interpreter, either: a regex, "alt", or "basic" - (?:(?<=[^`\\])|^)\[(?=[^@\]]+\]\([#a-z0-9_-]*@[:a-z0-9_-]*\))(?[^\n\]@]+)\]\((?:(?[a-z0-9_-]*)?(?:#(?[a-z0-9_-]+))?)?@(?[a-z0-9_-]*)(?::(?[a-z0-9_-]+))?\) -converter: >- # Type of converter, either: a mustache template, "http", or "markdown" - {{showtext}} -force: true # toggle overwriting of existing files -input: # glob pattern strings for files to be processed by the TRRT - - "**/*.md" +trrt: + interpreter: # type of interpreter, either: a regex, "alt", or "basic" + (?:(?<=[^`\\])|^)\[(?=[^@\]]+\]\([#a-z0-9_-]*@[:a-z0-9_-]*\))(?[^\n\]@]+)\]\((?:(?[a-z0-9_-]*)?(?:#(?[a-z0-9_-]+))?)?@(?[a-z0-9_-]*)(?::(?[a-z0-9_-]+))?\) + converter: + > # Type of converter, either: a mustache template, "http", or "markdown" + {{showtext}} + force: true # toggle overwriting of existing files + input: # glob pattern strings for files to be processed by the TRRT + - "**/*.md" diff --git a/package.json b/package.json index 973264b09..905e51d0f 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,10 @@ "scripts": { "start": "docusaurus start", "build": "docusaurus build", - "build:terminology": "npm run build:mrg-import && npm run build:mrgt && npm run build:trrt", + "build:terminology": "npm run build:mrg-import && npm run build:mrgt && npm run build:hrgt && npm run build:trrt", "build:mrg-import": "bun mrg-import -c $npm_package_config_terminology", "build:mrgt": "bun mrgt -c $npm_package_config_terminology", + "build:hrgt": "bun hrgt -c $npm_package_config_terminology", "build:trrt": "bun trrt -c $npm_package_config_terminology", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy",