From 126a61a080ae7766af86669f7276bd306b857fec Mon Sep 17 00:00:00 2001 From: Sequoia McDowell Date: Fri, 7 Oct 2016 17:12:26 -0400 Subject: [PATCH] adding markdown linting script --- .markdownlintrc | 5 +++++ README.md | 10 ++++++++++ _config.yml | 1 + package.json | 6 ++++-- 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 .markdownlintrc diff --git a/.markdownlintrc b/.markdownlintrc new file mode 100644 index 000000000..bfaf38e82 --- /dev/null +++ b/.markdownlintrc @@ -0,0 +1,5 @@ +{ + "default": true, + "MD018": true, + "MD003": { "style": "atx" } +} diff --git a/README.md b/README.md index 4eca8c8df..0e1d861e7 100644 --- a/README.md +++ b/README.md @@ -66,3 +66,13 @@ summary: A brief tutorial on creating an Angular client app using the Loopback A {% include readmes/loopback-example-angular.md %} ``` + +### Linting Readmes + +There is an additional `npm script` that "lints" the readmes for markdown formatting problems. It is currently "experimental", see #49 for more info. + +You can run this script thus: + +```js +$ npm run lint-readmes +``` \ No newline at end of file diff --git a/_config.yml b/_config.yml index 877dd2eb6..0c457c1ef 100644 --- a/_config.yml +++ b/_config.yml @@ -28,6 +28,7 @@ port: 4001 exclude: - .idea/ - .gitignore + - node_modules # these are the files and directories that jekyll will exclude from the build feedback_email: rmckinn@us.ibm.com diff --git a/package.json b/package.json index 6403ab66d..3d2df6630 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,15 @@ "version": "1.0.0", "description": "This file: Node-dependant workflow scripts for the jekyll-based site", "scripts": { - "fetch-readmes": "get-readmes --repos=./_data --out=./_includes/readmes" + "fetch-readmes": "get-readmes --repos=./_data --out=./_includes/readmes", + "lint-readmes" : "markdownlint _includes/readmes/" }, "repository": { "type": "git", "url": "git+https://github.com/Strongloop/loopback.io.git" }, "devDependencies": { - "getreadmes": "github:strongloop/get-readmes" + "getreadmes": "github:strongloop/get-readmes", + "markdownlint-cli": "github:sequoia/markdownlint-cli" } }