Skip to content

Commit

Permalink
Merge pull request jannis-baum#96 from jannis-baum/issue/95-lint-mark…
Browse files Browse the repository at this point in the history
…down

Lint Markdown
  • Loading branch information
jannis-baum authored Jul 15, 2024
2 parents 83d29ed + 25dcede commit eb29b9f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/.markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
globs:
- '**/*.md'

ignores:
- 'node_modules/**/*'
- 'tests/**/*'
18 changes: 18 additions & 0 deletions .github/workflows/lint-markdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Lint Markdown

on:
push:
branches:
- '**'
paths:
- '**.md'

jobs:
lint:
name: Lint Markdown
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v16
with:
config: .github/.markdownlint-cli2.yaml
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,13 @@ use the `viv` executable in the repository.
You can find files to test Vivify's rendering/parsing capabilities in the
[`tests/`](tests/) directory. Please make sure to add to this in case you add
anything new related to this.

## Writing Markdown

We use
[markdownlint](https://github.com/DavidAnson/markdownlint?tab=readme-ov-file) in
its default configuration to ensure consistent style across Markdown files. You
can install [markdownlint-cli2](https://github.com/DavidAnson/markdownlint-cli2)
to lint your files locally with `yarn lint-markdown` or rely on on your editor,
e.g. with [coc-markdownlint](https://github.com/fannheyward/coc-markdownlint)
for Vim with coc.nvim.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ following optional keys:
variable `VIV_TIMEOUT` (default is 10000)
- **`"katexOptions"`**\
[available KaTeX options](https://katex.org/docs/options.html), such as

```json
{
"errorColor": "#cc0000",
Expand All @@ -73,6 +74,7 @@ following optional keys:
}
}
```

- **`"pageTitle"`**\
JavaScript code that will be evaluated to determine the viewer's page title.
Here, the variable `components` is set to a string array of path components
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"dev": "VIV_TIMEOUT=0 VIV_PORT=3000 NODE_ENV=development nodemon --exec node --loader ts-node/esm src/app.ts",
"viv": "VIV_PORT=3000 node --loader ts-node/esm src/app.ts",
"lint": "eslint src static"
"lint": "eslint src static",
"lint-markdown": "markdownlint-cli2 --config .github/.markdownlint-cli2.yaml"
},
"type": "module",
"dependencies": {
Expand Down

0 comments on commit eb29b9f

Please sign in to comment.