Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Terminology Design tools integration #177

Merged
merged 25 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 27 additions & 37 deletions .github/workflows/framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,37 @@ name: framework

on:
pull_request:
branches: [master]
branches:
- master
push:
branches: [master]
branches:
- master
workflow_dispatch:

jobs:
checks:
if: github.event_name != 'push'
deploy:
name: Run Terminology Design tools and deploy docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Test Build
- name: Setup Bun
uses: oven-sh/setup-bun@v1

- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: bun install

- name: Run Terminology Design tools
run: npm run build:terminology

- name: Build and Deploy
run: |
yarn install --frozen-lockfile
STAGING=true yarn docusaurus parse
STAGING=true yarn docusaurus glossary
STAGING=true yarn build
mv build public
gh-release:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '16.x'
- uses: webfactory/[email protected]
npx docusaurus build --out-dir build
touch build/.nojekyll

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Release to GitHub Pages
env:
USE_SSH: true
GIT_USER: "MarIliadi"
run: |
git config --global user.email "[email protected]"
git config --global user.name "MarIliadi"
yarn install --frozen-lockfile
STAGING=true yarn docusaurus parse
STAGING=true yarn docusaurus glossary
STAGING=true yarn build
mv build public
STAGING=true yarn deploy
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build
2 changes: 1 addition & 1 deletion docs/saf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ scope:
#
scopes: #
- scopetag: tev2 # definition of (scope) tag(s) that are used within this scope to refer to a specific terminology
scopedir: https://github.com/tno-terminology-design/tev2/tree/master/docs/tev2 # URL of the scope-directory
scopedir: https://github.com/tno-terminology-design/tev2-specifications/tree/main/docs # URL of the scope-directory
#
# The third section specifies the versions that are actively maintained by the curators.
# For each version, the set of terms is selected that constitute the terminology.
Expand Down
23 changes: 23 additions & 0 deletions docs/terminology-config.yaml
Ca5e marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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


## Machine Readable Glossary Tool
vsntag: # versiontag for which the MRG needs to be (re)generated. Leave empty to process all versions


## 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"
2 changes: 1 addition & 1 deletion docs/terms/identify.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that when texts are encountered that would not work, they somehow get logged with messages that help curators to fix the problem. (I cannot tell whether or not they currently are).

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ formPhrases: identify, identifies, identifying, identifiable, identified, identi
status: draft
grouptags:
hoverText: "Identify: an Act, by or on behalf of a Party, that results in the selection of either (a) a single Partial identity that the party Owns, given some (observed or received) data, or (b) a single Entity from a given set of entities that is the Subject of a specified Partial identity that the party Owns."
glossaryText: "an [act](action@), by or on behalf of a [party](@), that results in the selection of either\n- a single [partial identity](@) that the party [owns](@), given some (observed or received) data, or\n- a single [entity](@) from a given set of entities that is the [subject](@) of a specified [partial identity](@) that the party [owns](@)."
glossaryText: "an [act](action@), by or on behalf of a [party](@), that results in the selection of either&#10;- a single [partial identity](@) that the party [owns](@), given some (observed or received) data, or&#10;- a single [entity](@) from a given set of entities that is the [subject](@) of a specified [partial identity](@) that the party [owns](@)."
date: 20210812
---

Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
title: 'eSSIF-Lab',
tagline: 'eSSIF-Lab Framework',
url: 'https://essif-lab.github.io',
baseUrl: process.env.STAGING && process.env.STAGING === 'true' ? '/framework/' : '/',
baseUrl: '/framework/',
favicon: 'images/favicon.ico',
organizationName: 'essif-lab',
projectName: 'framework',
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
"name": "essif-lab",
"version": "0.0.0",
"private": true,
"config": {
"terminology": "docs/terminology-config.yaml"
},
"scripts": {
"start": "docusaurus start",
"build": "docusaurus build",
"build:terminology": "npm run build:mrg-import && npm run build:mrgt && 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:trrt": "bun trrt -c $npm_package_config_terminology",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"parse": "docusaurus parse",
Expand All @@ -16,6 +23,9 @@
"@docusaurus/core": "^2.4.0",
"@docusaurus/preset-classic": "^2.4.0",
"@material-ui/core": "^4.11.0",
"@tno-terminology-design/mrg-import": "^0.1.5",
"@tno-terminology-design/mrgt": "^0.1.5",
"@tno-terminology-design/trrt": "^1.0.7",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
Expand Down
34 changes: 34 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,37 @@ html[data-theme='dark'] {
.button.button--secondary.button--outline:not(.button--active):not(:hover) {
color: var(--ifm-color-secondary);
}

a[hovertext] {
position: relative;
cursor: help;
font-weight: 600;
}

a[hovertext]::after {
content: attr(hoverText);
position: absolute;
width: max-content;
background: var(--ifm-color-content);
color: var(--ifm-color-content-inverse);
font-size: var(--ifm-code-font-size);
font-weight: 400;
max-width: 25vw;
padding: 4px 8px;
border-radius: 4px;
line-height: 1.2em;
white-space: pre-wrap;
word-break: break-word;
top: calc(100% + 10px);
transform: translateX(-50%);
transition: opacity 0.3s, visibility 0.3s;
pointer-events: none;
z-index: 1;
opacity: 0;
visibility: hidden;
}

a[hovertext]:hover::after {
visibility: visible;
opacity: .95;
}
Loading