Skip to content

Commit

Permalink
Add lint for docs (visgl#1719)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress authored Apr 20, 2018
1 parent fc3d6b2 commit 0e91aba
Show file tree
Hide file tree
Showing 4 changed files with 384 additions and 308 deletions.
10 changes: 10 additions & 0 deletions .markdownlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"default": true,
"colors": true,
"line-length": false,
"ul-style": {"style": "sublist"},
"no-duplicate-header": false,
"no-inline-html": false,
"no-hard-tabs": false,
"whitespace": false
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"clean": "rm -rf node_modules && lerna clean --yes",
"cover": "NODE_ENV=test nyc --reporter html --reporter cobertura --reporter=lcov npm run test cover",
"lint": "scripts/lint.sh",
"lint-markdown": "scripts/lint-markdown.sh",
"publish-prod": "npm run build && npm run test && npm run test dist && scripts/publish.sh prod",
"publish-beta": "npm run build && npm run test && npm run test dist && scripts/publish.sh beta",
"start": "(cd examples/layer-browser && (path-exists node_modules || npm i) && npm run start-local)",
Expand Down Expand Up @@ -52,6 +53,7 @@
"html-webpack-plugin": "^3.1.0",
"jsdom": "^9.11.0",
"lerna": "^2.9.1",
"markdownlint-cli": "^0.8.1",
"module-alias": "^2.0.0",
"nyc": "^10.2.0",
"png.js": "^0.1.1",
Expand Down
9 changes: 9 additions & 0 deletions scripts/lint-markdown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
# Script to check code styles

set -e

# https://serverfault.com/questions/59262/bash-print-stderr-in-red-color
color()(set -o pipefail;"$@" 2>&1>&3|sed -E $'s,^.*.md,\e[33m&\e[m,'|sed -E $'s,MD[a-zA-Z0-9/\\-]+,\e[31m&\e[m,'|sed -E $'s,\\[Context: .*\\],\e[90m&\e[m,'>&2)3>&1

color markdownlint docs
Loading

0 comments on commit 0e91aba

Please sign in to comment.