Unverified Commit 3d38b8f7 authored by anarcat's avatar anarcat
Browse files

add a way to silence warnings from GitLab's [[_TOC_]] things

parent 4fab3340
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
#!/bin/sh

# This script will pass provided arguments to markdownlint (mdl), with
# Kramdown warnings enabled, but with the GitLab-specific (and
# non-standard) [[_TOC_]] blob removed. This only works on single
# files, if provided a directory, it will just throw the entire thing
# at mdl.
for path in "$@"; do
    if [ -f "$path" ]; then
        sed 's/^\[\[_TOC_\]\]/TOC_PLACEHOLDER/' "$path" | markdownlint -
    else
        markdownlint "$path"
    fi
done