Class: Uniword::Validation::Rules::StyleReferencesRule
- Inherits:
-
Base
- Object
- Base
- Uniword::Validation::Rules::StyleReferencesRule
show all
- Defined in:
- lib/uniword/validation/rules/style_references_rule.rb
Overview
Validates style references exist in styles.xml.
DOC-001: Style IDs referenced in document.xml exist in styles.xml DOC-002: Default paragraph style exists DOC-003: Style references in numbering.xml exist in styles.xml
Constant Summary
collapse
- W_NS =
"http://schemas.openxmlformats.org/wordprocessingml/2006/main"
Instance Method Summary
collapse
Methods inherited from Base
#description, #validity_rule
Instance Method Details
#applicable?(context) ⇒ Boolean
20
21
22
23
|
# File 'lib/uniword/validation/rules/style_references_rule.rb', line 20
def applicable?(context)
context.part_exists?("word/document.xml") &&
context.part_exists?("word/styles.xml")
end
|
#category ⇒ Object
17
|
# File 'lib/uniword/validation/rules/style_references_rule.rb', line 17
def category = :styles
|
#check(context) ⇒ Object
25
26
27
28
29
30
31
32
|
# File 'lib/uniword/validation/rules/style_references_rule.rb', line 25
def check(context)
issues = []
defined_ids = context.style_ids
check_document_refs(context, defined_ids, issues)
check_default_style(context, defined_ids, issues)
check_numbering_refs(context, defined_ids, issues)
issues
end
|
#code ⇒ Object
16
|
# File 'lib/uniword/validation/rules/style_references_rule.rb', line 16
def code = "DOC-001"
|
#severity ⇒ Object
18
|
# File 'lib/uniword/validation/rules/style_references_rule.rb', line 18
def severity = "error"
|