Skip to content

Commit

Permalink
chore(release): 3.6.0
Browse files Browse the repository at this point in the history
* feat: Sort terms in a glossary (#66)

  New option `glossaries.[].sort` with values "asc" or "desc" and new option `i18n`
  to apply locale-specific sorting.

* test: New baseline.
  • Loading branch information
about-code committed Apr 10, 2020
1 parent a5d3a4d commit 610da99
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 49 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

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.

## [3.6.0](https://github.com/about-code/glossarify-md/compare/v3.4.1...v3.6.0) (2020-04-10)


### Features

* Minor performance improvements. Write outputs in parallel. ([f7720e8](https://github.com/about-code/glossarify-md/commit/f7720e8))
* Sort terms in a glossary ([#66](https://github.com/about-code/glossarify-md/issues/66)) ([1846929](https://github.com/about-code/glossarify-md/commit/1846929))

## [3.5.0](https://github.com/about-code/glossarify-md/compare/v3.4.1...v3.5.0) (2020-03-01)

### Features
Expand Down
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,32 @@ In contrast to [`listOfTables`](#list-of-tables) or [`listOfFigures`](#list-of-f
1. Preceding section heading if `id` is just the list prefix (`<a id="prefix"></a>`)
1. Filename if `id` is just the list prefix and there is no preceding section heading, either.


### Sorting your glossaries

> **Since v3.6.0**
Maintaining terms in alphabetical order manually, can become tedious and computers are quite good at sorting. So let *glossarify-md* sort the output glossary for you by adding a `sort` direction to your glossaries:

*glossarify-md.conf.json*
```json
"glossaries": [
{ "file":"./glossary.md", "termHint": "", "sort": "asc" }
]
```
Internally we use `Intl.Collator` and fall back to `String.localeCompare` if the
`Intl` API is missing on your version of node. Thus you can use options
available for those APIs and best documented on [Mozilla Developer Portal](https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Collator):

*glossarify-md.conf.json*
```json
"i18n": {
"locale": "de",
"ignorePunctuation": true,
// and others from JavaScript's Intl.Collator
},
```

## Options

#### `help` \| `--h`
Expand Down Expand Up @@ -480,6 +506,14 @@ high-level sections doesn't mean that only links to the high-level sections are
generated. Where it makes sense links to low-level sections of occurrence are
just being shortened.

#### `i18n`

- **Range**:` { locale: string, [localeMatcher: string],
[caseFirst: string], [ignorePunctuation: boolean],
[numeric: boolean], [sensitivity: string], [usage: string] }`

Locale options to control [sorting](#sorting-your-glossaries). See also: [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator/Collator).

#### `keepRawFiles` \| `--r`

- **Range:** `string[]`
Expand Down
8 changes: 4 additions & 4 deletions conf.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@
"type": "string",
"enum": ["upper", "lower", "false"]
},
"ignorePunctuation": {
"description": "Whether punctuation should be ignored. Default: false. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator/Collator",
"type": "boolean"
},
"locale": {
"description": "The locale to use for operations such as sorting. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator/Collator",
"type": "string"
Expand All @@ -216,10 +220,6 @@
"description": "Whether to use numeric collation. Default: false. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator/Collator",
"type": "boolean"
},
"ignorePunctuation": {
"description": "Whether punctuation should be ignored. Default: false. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator/Collator",
"type": "boolean"
},
"sensitivity": {
"description": "Which differences in the strings should lead to non-zero result values. Default: 'variant' for sorts, locale dependent for searches. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator/Collator",
"type": "string",
Expand Down
115 changes: 72 additions & 43 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": "3.5.0",
"version": "3.6.0",
"description": "Scans markdown files for glossary terms and replaces each occurrence with a link to a glossary file.",
"author": {
"name": "Andreas Martin"
Expand Down
2 changes: 1 addition & 1 deletion test/package-lock.json

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

0 comments on commit 610da99

Please sign in to comment.