Skip to content

Commit

Permalink
chore(release): v6.2.1
Browse files Browse the repository at this point in the history
* test: New test case.
* fix: Identifier-based cross-linking doesn't provide glossary term preview for bottom page links (#242)
* test: New baseline.
  • Loading branch information
about-code committed Jul 12, 2022
1 parent f4c8741 commit 5194d9e
Show file tree
Hide file tree
Showing 16 changed files with 104 additions and 14 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [6.2.1](https://github.com/about-code/glossarify-md/compare/v6.2.0...v6.2.1) (2022-07-12)


### Bug Fixes

* Identifier-based cross-linking doesn't provide glossary term preview for bottom page links ([#242](https://github.com/about-code/glossarify-md/issues/242)) ([ff28d49](https://github.com/about-code/glossarify-md/commit/ff28d49295ab0fa61f6adaa8cee85d13823e5265))


### Documentation Updates

* Fix TOC. ([888d01c](https://github.com/about-code/glossarify-md/commit/888d01c3143c9e59d8c27801155f7670c78a9eb4))
* Improve plug-ins doc. ([2e9b5ca](https://github.com/about-code/glossarify-md/commit/2e9b5caaa3e4d23ee65588767282bc4236528833))
* Separate Installing and Writing of Plug-ins ([83c6889](https://github.com/about-code/glossarify-md/commit/83c6889308daae53f8daeca433b4071367fbc9ba))

## [6.2.0](https://github.com/about-code/glossarify-md/compare/v6.1.0...v6.2.0) (2022-04-10)


Expand Down
1 change: 1 addition & 0 deletions lib/linker.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ function getLinkVisitor(context, vFile, indexEntriesMap) {
if (termDefinitionIndexEntry && termDefinitionIndexEntry.length === 1) {
// anchor is unique (Rule 1)
lNode.url = resolveGlossaryUrl(context, vFile, termDefinitionIndexEntry[0].node);
lNode.title = lNode.title || termDefinitionIndexEntry[0].node.getShortDescription();
}
// else {
// if there is a local definition, then Rule 2 can be satisifed by doing nothing.
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "glossarify-md",
"version": "6.2.0",
"version": "6.2.1",
"description": "Scans markdown files for glossary terms and replaces each occurrence with a link to a glossary file.",
"author": {
"name": "Andreas Martin"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Test

See https://github.com/about-code/glossarify-md/issues/242

## Test Case 1: Term-Based Auto-Linking

GIVEN a term *Test*
THEN the system MUST linkify *Test*
AND the link MUST have the term's *short description* as a link title.

## Test Case 2: Identifier-Based Cross-Linking

GIVEN a [specific link](#test-id) with a term's custom id
AND the Markdown author DOES NOT provide a link title on its own
THEN the system SHOULD add the term's *short description* as a link title.

## Test Case 3: Identifier-Based Cross-Linking with custom link title

GIVEN a [specific link](#test-id "Custom Link Title") with a term's custom id
AND the Markdown author DOES provide a custom link title on its own
THEN the system SHOULD keep "Custom Link Title" as the link title.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "../../../../../conf/v5/schema.json",
"baseDir": ".",
"outDir": "../../../../output-actual/pandoc/config-linking/242-headingIdPandoc-with-short-desc"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Glossary

## Test term

A generic test term to test our glossary.

## Specific link test term {#test-id}

A specific link test term to test exact links to glossary definitions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@

[3]: #tc-2-1

[4]: ./glossary.md#tc-2-2
[4]: ./glossary.md#tc-2-2 "MUST be resolved by id-based cross-link path resolution"

[5]: #tc-2-3

[6]: #tc-2-4

[7]: ./glossary.md#tc-2-5
[7]: ./glossary.md#tc-2-5 "MUST be resolved by id-based cross-link path resolution"

[8]: #tc-2-6
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# [Test](#test)

See [https://github.com/about-code/glossarify-md/issues/242][1]

## [Test Case 1: Term-Based Auto-Linking](#test-case-1-term-based-auto-linking)

GIVEN a term *Test*
THEN the system MUST linkify *Test*
AND the link MUST have the term's *short description* as a link title.

## [Test Case 2: Identifier-Based Cross-Linking](#test-case-2-identifier-based-cross-linking)

GIVEN a [specific link][2] with a term's custom id
AND the Markdown author DOES NOT provide a link title on its own
THEN the system SHOULD add the term's *short description* as a link title.

## [Test Case 3: Identifier-Based Cross-Linking with custom link title](#test-case-3-identifier-based-cross-linking-with-custom-link-title)

GIVEN a [specific link][3] with a term's custom id
AND the Markdown author DOES provide a custom link title on its own
THEN the system SHOULD keep "Custom Link Title" as the link title.

[1]: https://github.com/about-code/glossarify-md/issues/242

[2]: ./glossary.md#test-id "A specific link test term to test exact links to glossary definitions."

[3]: ./glossary.md#test-id "Custom Link Title"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "../../../../../conf/v5/schema.json",
"baseDir": ".",
"outDir": "../../../../output-actual/pandoc/config-linking/242-headingIdPandoc-with-short-desc"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Glossary](#glossary)

## [Test term](#test-term)

A generic test term to test our glossary.

## [Specific link test term](#test-id)

A specific link test term to test exact links to glossary definitions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ THEN

* the term *[HashId][1]* MUST be linkified AND MUST use an MD5 url fragment
* the term *[PandocId][2]* MUST be linkified AND MUST use the #pandoc-id fragment
* a link *[arbitrary][3]* MUST be linked to the definition of *[PandocId][2]*
* a link *[arbitrary][2]* MUST be linked to the definition of *[PandocId][2]*

[1]: ./glossary.md#md5-de0b62fa03c4c0dcffcc53b3d6d330be "A term which expects an id hash to be generated."

[2]: ./glossary.md#pandoc-id "A term with a custom pandoc-id"

[3]: ./glossary.md#pandoc-id
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ This MUST link to [../../document0.md#section-0-1][1].

Text

[1]: ../../document0.md#section-0-1
[1]: ../../document0.md#section-0-1 "GIVEN a document file document0.md AND a document file depth1/document1.md AND a document file depth1/depth2/document2.md WITH document file document0.md declaring a heading of arbitrary wording AND declaring a unique pandoc-style heading id {#section-0-1} THEN any occurrence of [foo](#section-0-1) in depth1/document1.md MUST resolve to../document0#section-0-1 AND any occurrence of [bar](#section-0-1) in depth2/document2.md MUST resolve to../../document0#section-0-1."
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ This MUST link to [../document0.md#section-0-1][1].

Text

[1]: ../document0.md#section-0-1
[1]: ../document0.md#section-0-1 "GIVEN a document file document0.md AND a document file depth1/document1.md AND a document file depth1/depth2/document2.md WITH document file document0.md declaring a heading of arbitrary wording AND declaring a unique pandoc-style heading id {#section-0-1} THEN any occurrence of [foo](#section-0-1) in depth1/document1.md MUST resolve to../document0#section-0-1 AND any occurrence of [bar](#section-0-1) in depth2/document2.md MUST resolve to../../document0#section-0-1."
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ THEN

[1]: https://github.com/about-code/glossarify-md/issues/122

[2]: ./depth1/document1.md#section-1-2
[2]: ./depth1/document1.md#section-1-2 "Text"

[3]: ./depth1/depth2/document2.md#section-2-2
[3]: ./depth1/depth2/document2.md#section-2-2 "Text"
5 changes: 3 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,9 @@
"test_p16__00": "node . --config ./input/config-unified/internal/glossarify-md.conf.json",
"test_p16__01": "node . --config ./input/config-unified/external/glossarify-md.conf.json",
"test_p17__00": "node . --config ./input/pandoc/config-linking/headingIdPandoc/glossarify-md.conf.json",
"test_p17__01": "node . --config ./input/pandoc/config-linking/headingIdAlgorithm/mixed-with-pandoc-ids/glossarify-md.conf.json",
"test_p17__02": "node . --config ./input/pandoc/config-glossaries/uri-from-heading-id/glossarify-md.conf.json",
"test_p17__01": "node . --config ./input/pandoc/config-linking/242-headingIdPandoc-with-link-titles/glossarify-md.conf.json",
"test_p17__02": "node . --config ./input/pandoc/config-linking/headingIdAlgorithm/mixed-with-pandoc-ids/glossarify-md.conf.json",
"test_p17__03": "node . --config ./input/pandoc/config-glossaries/uri-from-heading-id/glossarify-md.conf.json",
"test_p18__00": "node . --config ./input/term-uris/uri-none-baseUrl-none-paths-relative/glossarify-md.conf.json",
"test_p18__01": "node . --config ./input/term-uris/uri-none-baseUrl-none-paths-absolute/glossarify-md.conf.json",
"test_p18__02": "node . --config ./input/term-uris/uri-none-baseUrl-fallback-paths-relative/glossarify-md.conf.json",
Expand Down

0 comments on commit 5194d9e

Please sign in to comment.