Skip to content

Commit

Permalink
now also for tables
Browse files Browse the repository at this point in the history
Signed-off-by: Rieks <RieksJ@users.noreply.github.com>
  • Loading branch information
RieksJ committed Feb 29, 2024
1 parent 54e772c commit 328a058
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/tev2-glossaries-demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,19 +110,27 @@ The [MRGRef](@) that is used is `{%` `hrg="" con[1]="markdown-table-row" con[2]=
<TabItem value="glossary-with-notes">

:::info
This is the [glossary](@) that shows that you can add notes to a glossary entry.\
This is the [glossary](@) that shows that you can add notes to a glossary entry.
For this purpose, we use a custom converter that

1. only creates an entry for MRG entries that have an existing, non-empty `glossaryNotes` field
2. shows the notes.

We have simplified the handlebars expression so that it becomes easier for readers to focus on what we have been trying to do here.

The [MRGRef](@) that is used is `{%` `hrg="" converter="tbd"` `%}`
The [MRGRef](@) that is used is `{%` `hrg="" converter="{{#if glossaryNotes}}## {{noRefs glossaryTerm}}\n\n{{glossaryText}}\n\n### Notes\n\n{{#each glossaryNotes}}- {{this}}\n{{/each}}\n{{/if}}"` `%}`
:::

## Glossary (Markdown style)

{% hrg="" converter="{{#if glossaryNotes}}## {{noRefs glossaryTerm}}\n\n{{glossaryText}}\n\n### Notes\n\n{{#each glossaryNotes}}- {{this}}\n{{/each}}\n{{/if}}" %}

## Glossary (Table style)

| Term | Description |
| ---- | ----------- |
{% hrg="" converter="{{#if glossaryNotes}}| {{noRefs glossaryTerm}} | {{glossaryText}}{{#if glossaryNotes}}<br/><br/>**Notes**<br/>{{#each glossaryNotes}}<br/>- {{this}}{{/each}}{{/if}}{{/if}} |" %}

</TabItem>

</Tabs>

0 comments on commit 328a058

Please sign in to comment.