diff --git a/docs/.mdl_ruleset.rb b/docs/.mdl_ruleset.rb new file mode 100644 index 0000000000..a32f752d2e --- /dev/null +++ b/docs/.mdl_ruleset.rb @@ -0,0 +1,7 @@ +rule 'HB034', 'Bare unstyled URL used' do + tags :links, :url + aliases 'no-bare-unstyled-urls' + check do |doc| + doc.matching_text_element_lines(%r{(?<=\s)https?://}) + end +end diff --git a/docs/.mdl_style.rb b/docs/.mdl_style.rb new file mode 100644 index 0000000000..3466dc4ffd --- /dev/null +++ b/docs/.mdl_style.rb @@ -0,0 +1,7 @@ +all +rule 'MD026', punctuation: ',;:' # Trailing punctuation in header +exclude_rule 'MD013' # Line length +exclude_rule 'MD029' # Ordered list item prefix +exclude_rule 'MD033' # Inline HTML +exclude_rule 'MD034' # Bare URL used (replaced by HB034) +exclude_rule 'MD046' # Code block style diff --git a/docs/.mdlrc b/docs/.mdlrc new file mode 100644 index 0000000000..7bb460e414 --- /dev/null +++ b/docs/.mdlrc @@ -0,0 +1,4 @@ +git_recurse true +ignore_front_matter true +style "#{File.dirname(__FILE__)}/.mdl_style.rb" +rulesets ["#{File.dirname(__FILE__)}/.mdl_ruleset.rb"] diff --git a/docs/Gemfile b/docs/Gemfile index ca9b7428d0..50368eba34 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -4,5 +4,6 @@ gem "github-pages", group: :jekyll_plugins group :test do gem "html-proofer" + gem "mdl" gem "rake" end diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index c03269e605..68ce3450af 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -9,6 +9,8 @@ GEM zeitwerk (~> 2.2, >= 2.2.2) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) + chef-utils (17.8.25) + concurrent-ruby coffee-script (2.4.1) coffee-script-source execjs @@ -226,6 +228,12 @@ GEM listen (3.7.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) + mdl (0.11.0) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.1) + mixlib-cli (~> 2.1, >= 2.1.1) + mixlib-config (>= 2.2.1, < 4) + mixlib-shellout mercenary (0.3.6) mini_portile2 (2.6.1) minima (2.5.1) @@ -233,6 +241,11 @@ GEM jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.14.4) + mixlib-cli (2.1.8) + mixlib-config (3.0.9) + tomlrb + mixlib-shellout (3.2.5) + chef-utils multipart-post (2.1.1) nokogiri (1.12.5) mini_portile2 (~> 2.6.1) @@ -272,6 +285,7 @@ GEM terminal-table (1.8.0) unicode-display_width (~> 1.1, >= 1.1.1) thread_safe (0.3.6) + tomlrb (2.0.1) typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (1.2.9) @@ -289,7 +303,8 @@ PLATFORMS DEPENDENCIES github-pages html-proofer + mdl rake BUNDLED WITH - 1.17.2 + 1.17.3 diff --git a/docs/Rakefile b/docs/Rakefile index 8218ea9a26..042dfa64d1 100644 --- a/docs/Rakefile +++ b/docs/Rakefile @@ -7,7 +7,12 @@ task :build do sh "jekyll", "build" end -desc "Run html proofer to validate the HTML output." +desc "Run Markdownlint to validate the Markdown style." +task lint: :build do + sh "mdl", "." +end + +desc "Run HTMLProofer to validate the HTML output." task test: :build do require "html-proofer" HTMLProofer.check_directory(