Skip to content

Commit

Permalink
Add HRGT
Browse files Browse the repository at this point in the history
  • Loading branch information
Ca5e committed Nov 29, 2023
1 parent 64a567c commit 192a191
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
8 changes: 7 additions & 1 deletion docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -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="" %}

---
41 changes: 26 additions & 15 deletions docs/terminology-config.yaml
Original file line number Diff line number Diff line change
@@ -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_-]*\))(?<showtext>[^\n\]@]+)\]\((?:(?<id>[a-z0-9_-]*)?(?:#(?<trait>[a-z0-9_-]+))?)?@(?<scopetag>[a-z0-9_-]*)(?::(?<vsntag>[a-z0-9_-]+))?\)
converter: >- # Type of converter, either: a mustache template, "http", or "markdown"
<a
href="{{localize navurl}}{{#if trait}}#{{trait}}{{/if}}"
hovertext="{{#if hoverText}}{{hoverText}}{{else}}{{#if glossaryTerm}}{{glossaryTerm}}{{else}}{{capFirst term}}{{/if}}: {{noRefs glossaryText type="markdown"}}{{/if}}"
>{{showtext}}</a>
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_-]*\))(?<showtext>[^\n\]@]+)\]\((?:(?<id>[a-z0-9_-]*)?(?:#(?<trait>[a-z0-9_-]+))?)?@(?<scopetag>[a-z0-9_-]*)(?::(?<vsntag>[a-z0-9_-]+))?\)
converter:
> # Type of converter, either: a mustache template, "http", or "markdown"
<a
href="{{localize navurl}}{{#if trait}}#{{trait}}{{/if}}"
hovertext="{{#if hoverText}}{{hoverText}}{{else}}{{#if glossaryTerm}}{{glossaryTerm}}{{else}}{{capFirst term}}{{/if}}: {{noRefs glossaryText type="markdown"}}{{/if}}"
>{{showtext}}</a>
force: true # toggle overwriting of existing files
input: # glob pattern strings for files to be processed by the TRRT
- "**/*.md"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 192a191

Please sign in to comment.