mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 07:59:02 +08:00
docs: add mdl for Markdown linting
Run with `mdl -c docs/.mdlrc docs/*.md`.
This commit is contained in:
parent
c75aaed831
commit
45bf8b0118
7
docs/.mdl_ruleset.rb
Normal file
7
docs/.mdl_ruleset.rb
Normal file
@ -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
|
7
docs/.mdl_style.rb
Normal file
7
docs/.mdl_style.rb
Normal file
@ -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
|
4
docs/.mdlrc
Normal file
4
docs/.mdlrc
Normal file
@ -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"]
|
@ -4,5 +4,6 @@ gem "github-pages", group: :jekyll_plugins
|
||||
|
||||
group :test do
|
||||
gem "html-proofer"
|
||||
gem "mdl"
|
||||
gem "rake"
|
||||
end
|
||||
|
@ -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
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user