2020-07-05 15:37:23 +02:00
|
|
|
# Development on documentation
|
|
|
|
|
|
|
|
## tl;dr
|
|
|
|
|
2020-07-05 16:07:53 +02:00
|
|
|
**You will need to use following `npm scripts` before creating a pull request!**
|
2020-07-05 15:37:23 +02:00
|
|
|
|
2020-07-05 16:07:53 +02:00
|
|
|
1. `npm install`
|
|
|
|
2. `npm test`
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
* Linting of markdown documents
|
|
|
|
* Link checking
|
|
|
|
|
|
|
|
## Specifications
|
|
|
|
|
|
|
|
This repository checks against following specification:
|
|
|
|
|
|
|
|
* [Markdown Commonmark](https://spec.commonmark.org/)
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
2022-01-08 12:49:01 +01:00
|
|
|
Install the Node.js 16 Active LTS version of [Node.js](https://nodejs.org/en/) (which includes npm).
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2020-07-14 11:33:51 +02:00
|
|
|
For linting and all the checks you need several npm packages. The following command installs all necessary npm dependencies:
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
```shell
|
2020-07-05 16:07:53 +02:00
|
|
|
npm install
|
2020-07-05 15:37:23 +02:00
|
|
|
```
|
|
|
|
|
2020-07-05 16:07:53 +02:00
|
|
|
This installs all dependencies into a local `node_modules` folder.
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
## Checks
|
|
|
|
|
2022-06-09 12:05:08 +02:00
|
|
|
To enforce specification conformity there are several checks defined as `npm run-script` targets. To run all checks please execute:
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
```shell
|
2020-07-05 16:07:53 +02:00
|
|
|
npm test
|
2020-07-05 15:37:23 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
### Individual checks
|
|
|
|
|
|
|
|
If you want to run individual checks see the targets and the description below.
|
2020-07-05 16:07:53 +02:00
|
|
|
Every individual check can be run like so:
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
```shell
|
2022-06-09 12:05:08 +02:00
|
|
|
npm run-script my-individual-check
|
2020-07-05 15:37:23 +02:00
|
|
|
```
|
2020-07-14 15:19:00 +02:00
|
|
|
|
2022-01-31 16:43:59 +01:00
|
|
|
See the [package.json](package.json) file for the currently available scripts.
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
#### Markdown linter
|
|
|
|
|
|
|
|
Markdown linting. See the rules [here](https://github.com/DavidAnson/markdownlint).
|
|
|
|
|
|
|
|
```shell
|
2020-07-05 16:07:53 +02:00
|
|
|
npm run-script markdownlint
|
2020-07-05 15:37:23 +02:00
|
|
|
```
|
|
|
|
|
2020-07-14 15:19:00 +02:00
|
|
|
##### Markdown linter overrides
|
2020-07-05 15:37:23 +02:00
|
|
|
|
2022-06-09 12:05:08 +02:00
|
|
|
Sometimes it is not possible to be commonmark conform. In these rare cases an inline tag to skip linting is possible.
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
Candidates are tables.
|
|
|
|
|
|
|
|
```html
|
|
|
|
<!-- markdownlint-disable-->
|
|
|
|
| Column 1 | Column 2 | Column 3 |
|
|
|
|
|----------|----------|----------|
|
|
|
|
<!-- markdownlint-enable-->
|
|
|
|
```
|
|
|
|
|
2020-07-14 15:19:00 +02:00
|
|
|
Additionally HTML image tags can be allowed globally. This is useful if you need
|
|
|
|
to resize images, since commonmark has no annotation for this.
|
2020-07-05 15:37:23 +02:00
|
|
|
|
2020-07-14 15:19:00 +02:00
|
|
|
This is done with a .markdownlint.json override file which would look something
|
|
|
|
like this:
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"no-inline-html": {
|
|
|
|
"allowed_elements": [
|
|
|
|
"img",
|
|
|
|
"table"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2020-07-14 15:19:00 +02:00
|
|
|
For more information how to tweak overrides consult the markdown linter
|
|
|
|
documentation mentioned above.
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
#### Link resolver
|
|
|
|
|
|
|
|
All cross references and external URLs are resolved.
|
|
|
|
|
|
|
|
```shell
|
2020-07-05 16:07:53 +02:00
|
|
|
npm run-script checklinks
|
2020-07-05 15:37:23 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Inconsiderate language scanner
|
|
|
|
|
2022-06-09 12:05:08 +02:00
|
|
|
This checks against profanity and inconsiderate language. This is helpful for
|
2020-07-14 15:19:00 +02:00
|
|
|
non-natives to detect words that could be inconsiderate. This utilizes [alex](https://github.com/get-alex/alex)
|
2020-07-05 15:37:23 +02:00
|
|
|
|
|
|
|
```shell
|
2020-07-05 16:07:53 +02:00
|
|
|
npm run-script detect-inconsiderate-language
|
2020-07-05 15:37:23 +02:00
|
|
|
```
|