Skip to content

Commit

Permalink
Use superscript for links to definitions of ambiguously defined terms (
Browse files Browse the repository at this point in the history
…#57)

feat: Use superscript to link ambiguously defined terms to all their definitions. Update related to #2.
  • Loading branch information
about-code authored Dec 25, 2019
1 parent c891c87 commit 1bf9f37
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/linker.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function linkify(paragraphNode, headingNode, termDefs, context, vFile) {
const glossUrl = getGlossaryUrl(context, t, vFile);
const shortDesc = t.getShortDescription();
return link(glossUrl, shortDesc,
text(j === 0 ? ` (${j})` : `, (${j})`)
html(j === 0 ? `<sup>${j+1})</sup>` : `<sup> ${j+1})</sup>`)
);
})
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# [Two Glossaries A and B with shared set of terms](#two-glossaries-a-and-b-with-shared-set-of-terms)

GIVEN there are two glossaries 'Glossary A' AND 'Glossary B' (or more)
AND a shared set of terms '[Term Shared A][1][ (0)][1][, (1)][2]', '[Term Shared B][3][ (0)][3][, (1)][4]'
AND a shared set of terms '[Term Shared A][1][<sup>1)</sup>][1][<sup> 2)</sup>][2]', '[Term Shared B][3][<sup>1)</sup>][3][<sup> 2)</sup>][4]'
THEN those terms MUST be linked with both glossaries 'Glossary A' AND 'Glossary B' (or more).

## [Paragraph with two occurrences of a shared term](#paragraph-with-two-occurrences-of-a-shared-term)

GIVEN there are two glossaries 'Glossary A' AND 'Glossary B' (or more)
AND a shared term '[Term Shared A][1][ (0)][1][, (1)][2]'
AND term '[Term Shared A][1][ (0)][1][, (1)][2]' is mentioned twice in a paragraph, like this one,
AND a shared term '[Term Shared A][1][<sup>1)</sup>][1][<sup> 2)</sup>][2]'
AND term '[Term Shared A][1][<sup>1)</sup>][1][<sup> 2)</sup>][2]' is mentioned twice in a paragraph, like this one,
THEN each occurrence of the term MUST be linked with both glossaries 'Glossary A' AND 'Glossary B'.

[1]: shared-terms-glossary-a.md#term-shared-a "'Term Shared A' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## [Term Shared A](#term-shared-a)

'[Term Shared A][1][ (0)][1][, (1)][2]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.
'[Term Shared A][1][<sup>1)</sup>][1][<sup> 2)</sup>][2]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.

## [Term Shared B](#term-shared-b)

'[Term Shared B][3][ (0)][3][, (1)][4]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.
'[Term Shared B][3][<sup>1)</sup>][3][<sup> 2)</sup>][4]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.

[1]: shared-terms-glossary-a.md#term-shared-a "'Term Shared A' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## [Term Shared A](#term-shared-a)

'[Term Shared A][1][ (0)][1][, (1)][2]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.
'[Term Shared A][1][<sup>1)</sup>][1][<sup> 2)</sup>][2]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.

## [Term Shared B](#term-shared-b)

'[Term Shared B][3][ (0)][3][, (1)][4]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.
'[Term Shared B][3][<sup>1)</sup>][3][<sup> 2)</sup>][4]' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'.

[1]: shared-terms-glossary-a.md#term-shared-a "'Term Shared A' MUST be linked WITH both glossaries 'Glossary A' AND 'Glossary B'."

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AND the index MUST contain links to the correct glossary.

## [Shared set of terms](#shared-set-of-terms)

GIVEN term '[In Glossary A and B][3][ (0)][3][, (1)][4]'
GIVEN term '[In Glossary A and B][3][<sup>1)</sup>][3][<sup> 2)</sup>][4]'
AND the term is defined in both glossaries
THEN the index MUST contain the term only once AND link to both glossaries

Expand Down

0 comments on commit 1bf9f37

Please sign in to comment.