Skip to content

Latest commit

 

History

History
130 lines (87 loc) · 4.85 KB

File metadata and controls

130 lines (87 loc) · 4.85 KB

markdown-ci-reference-implementation

A reference implementation for running CI on Markdown files.


Table of Contents


Implementations

Travis

Travis Build Status

Build Status

Travis Build Definition

Link to .travis.yml

Notes

We use the Node environment as not all of the tools used have docker images provided through the node package manager.

❗ Please Note: at this time in order to use yarn you must have a yarn.lock file. (See here for more)

Azure DevOps

Azure DevOps Build Status

Build Status

Azure DevOps Build Definition

Link to azure-pipelines.yml

Static Code Analysis - Linting

Error Checking

We use the popular markdownlint library for linting our markdown files. We will do this through the markdownlint-cli command line tool running in a docker container for portability.

Link to markdownlint tools

Command to run markdownlint-cli

We are also leaving the default ruleset. These rules can be customized see Instructions here.

docker run -v $PWD:/markdown 06kellyjac/markdownlint-cli -i node_modules **/*.md

Spell Checking

We use the cspell tool for checking the spelling in our markdown files. There currently is no docker image for this tool and so must be installed through npm or yarn.

Link to SpellCheck tools

Command to run cspell

Please note: You will need to customize this command to do so follow these instructions

cspell **/*.md --color

Link Checker

We use the markdown-link-check to ensure that all of the links we are referencing in our markdown file point to valid web sites. We are using the docker image for this tool to ensure a consistent run environment.

Link to Link Checker Tool

Command to run Link Checker

Please Note: The markdown link checker does not have functionality to exclude folders so we are using the find command to search for all markdown that aren't in the node_modules folder.
Due to the use of find this command is best run on posix compatible operating systems

find . -not -path './**/node_modules/*' -name "*.md" | \
xargs docker run --rm --read-only -v $PWD:/data robertbeal/markdown-link-checker

Special Thanks

Thanks goes to the IT Strategy Team at ESDC. Most of this information is copied from their work in automating their markdown strategy documentation.