Skip to content

Commit 7d9f6d0

Browse files
committed
Do not display unused context references in the context section
1 parent bc140c4 commit 7d9f6d0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Each block sequence consists of blocks with the following keys:`id`, `property`,
2525
- The `example` key refers to on or more blocks with `label` and `json` keys, providing a (JSON) example with a title. These examples are placed, in the HTML version, to the end of the section referring to a term (the examples are ignored in the Turtle and the JSON-LD versions). Care should be taken to use the `"|"` [block style indicator](https://yaml-multiline.info) in the YAML file for the examples.
2626

2727
- Top level blocks:
28-
- `vocab`: a block with the `id` and the `value` keys defining the prefix and the URL of the vocabulary, respectively. The `id` provides a prefix that can be used in the vocabulary descriptions, e.g., for cross-references. The additional, optional `context` key may provide a default context file reference (as a URI), used by all terms unless locally overwritten (see above).
28+
- `vocab`: a block with the `id` and the `value` keys defining the prefix and the URL of the vocabulary, respectively. The `id` provides a prefix that can be used in the vocabulary descriptions, e.g., for cross-references. The additional, optional `context` key may provide a default context file reference (as a URI), used by all terms unless locally overwritten (see above). Note that the `context` key is required if the HTML template includes a context section.
2929

3030
- `prefix`: definition of a prefixes, and corresponding URLs, for each external vocabulary in use, defined by the `id` and `value` keys, respectively.
3131

lib/html.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,10 @@ export function toHTML(vocab: Vocab, template_text: string): string {
472472
if (ctx_keys.length > 0) {
473473
// An item for each context file
474474
for (const ctx of ctx_keys) {
475+
if (global.context_mentions[ctx].length === 0) {
476+
continue;
477+
}
478+
475479
const li = document.addChild(ctx_ul, 'li');
476480

477481
const a = document.addChild(li, 'a', `<code>${ctx}</code>`);

0 commit comments

Comments
 (0)