Class: Appium::Lint::H1Missing
- Defined in:
- lib/appium_doc_lint/lint/h1_missing.rb
Overview
Each file must have a h1 This forms the title for the document and is used to anchor the #filename.md link.
The file should start with the h1. This rule will fail if the document doesn’t contain at least one h1
Constant Summary collapse
- FAIL =
'h1 is missing'
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Appium::Lint::Base
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 |
# File 'lib/appium_doc_lint/lint/h1_missing.rb', line 11 def call # either the doc has a h1 or it doesn't # attach warning to line 0 h1_missing = !input.data.match(/^#[^#]/m) h1_missing ? warn(0) : warnings end |
#fail ⇒ Object
20 21 22 |
# File 'lib/appium_doc_lint/lint/h1_missing.rb', line 20 def fail FAIL end |