Class: Metanorma::Standoc::Cleanup
- Inherits:
-
Object
- Object
- Metanorma::Standoc::Cleanup
- Extended by:
- Forwardable
- Includes:
- Amend, Asciibib, Attachment, Bibdata, Bibitem, Block, Boilerplate, Dochistory, Footnotes, Image, Index, Inline, Maths, Metadata, Ref, Reqt, Review, Section, SectionNames, Symbols, Table, Terms, TermsDesignations, Text, Toc, Xref
- Defined in:
- lib/metanorma/cleanup/log.rb,
lib/metanorma/cleanup/cleanup.rb,
lib/metanorma/cleanup/merge_bibitems.rb,
lib/metanorma/cleanup/spans_to_bibitem.rb,
lib/metanorma/cleanup/spans_to_bibitem_preprocessing.rb
Defined Under Namespace
Classes: MergeBibitems, SpansToBibitem
Constant Summary collapse
- RELATON_SEVERITIES =
{ "INFO": "RELATON_4", "WARN": "RELATON_3", "ERROR": "RELATON_2", "FATAL": "RELATON_1", "UNKNOWN": "RELATON_4" }.freeze
- NORM_REF =
XPath expressions for boilerplate insertion
"//bibliography/references[@normative = 'true'][not(@hidden)] | " \ "//bibliography/clause[.//references[@normative = 'true']]".freeze
- TERM_CLAUSE =
"//sections//terms[not(.//ancestor::clause[@type = 'terms'])] | " \ "//sections/clause[descendant::terms][@type = 'terms'] | " \ "//sections/clause[not(@type = 'terms')]//terms".freeze
- TEXT_ELEMS =
%w{status language script version author name callout phone email street city state country postcode identifier referenceFrom surname referenceTo docidentifier docnumber prefix initial addition forename title draft secretariat title-main title-intro title-part verbal-definition non-verbal-representation}.freeze
Constants included from TermsDesignations
Constants included from Text
Text::IGNORE_QUOTES_ELEMENTS, Text::IGNORE_TEXT_ELEMENTS, Text::PRESERVE_LINEBREAK_ELEMENTS, Text::STRIP_LINEBREAK_ELEMENTS
Constants included from Image
Image::IRI_TAG_PROPERTIES_MAP, Image::SVG_NS
Constants included from Maths
Maths::MATHML_NS, Maths::MATHVARIANT_OVERRIDE, Maths::UNITSML_NS
Constants included from Regex
Regex::CONN_REGEX_STR, Regex::ISO_REF, Regex::ISO_REF_ALL_PARTS, Regex::ISO_REF_NO_YEAR, Regex::LOCALITIES, Regex::LOCALITY_REGEX_STR, Regex::LOCALITY_REGEX_STR_TRIPLEDASH, Regex::LOCALITY_REGEX_VALUE_ONLY_STR, Regex::NON_ISO_REF, Regex::NON_ISO_REF1, Regex::NUMERIC_REGEX, Regex::TERM_REFERENCE_RE, Regex::TERM_REFERENCE_RE_STR
Constants included from Inline
Inline::STEM_ATTRS, Inline::XREF_ATTRS
Constants included from Utils
Utils::SECTION_CONTAINERS, Utils::SUBCLAUSE_XPATH
Constants included from Terms
Constants included from Index
Index::DESIGNATIONS, Index::EMPTY_INDEX_XPATH
Constants included from SectionNames
SectionNames::ABBR_NO_SYM, SectionNames::NO_SYMABBR, SectionNames::SYMABBR, SectionNames::SYM_NO_ABBR
Constants included from Section
Section::MAIN_CLAUSE_NAMES, Section::PREFACE_CLAUSE_NAMES, Section::SECTIONTYPE_STREAMLINE
Constants included from Bibitem
Constants included from Boilerplate
Boilerplate::ADOC_MACRO_PATTERN
Constants included from Ref
Constants included from Footnotes
Constants included from Block
Class Attribute Summary collapse
-
._file ⇒ Object
Returns the value of attribute _file.
Instance Attribute Summary collapse
-
#files_to_delete ⇒ Object
readonly
Returns the value of attribute files_to_delete.
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Class Method Summary collapse
-
.inherited(konv) ⇒ Object
rubocop:disable Lint/MissingSuper.
Instance Method Summary collapse
- #cleanup(xmldoc) ⇒ Object
-
#copied_instance_variables ⇒ Object
Use metaprogramming to copy instance variables from converter.
- #element_name_cleanup(xmldoc) ⇒ Object
- #empty_element_cleanup(xmldoc) ⇒ Object
-
#initialize(converter) ⇒ Cleanup
constructor
A new instance of Cleanup.
- #relaton_iev_cleanup(xmldoc) ⇒ Object
- #relaton_key_eqv?(sought, found) ⇒ Boolean
- #relaton_log_add?(entry) ⇒ Boolean
- #relaton_log_cleanup(_xmldoc) ⇒ Object
-
#script_cleanup(xmldoc) ⇒ Object
it seems Nokogiri::XML is treating the content of
Returns a new instance of Cleanup.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
# File 'lib/metanorma/cleanup/cleanup.rb', line 68 def initialize(converter) @conv= converter @anchor_alias = {} @internal_eref_namespaces = [] # Shadow instance variables from converter (attributes/accessors) @log = converter.log @bibdb = converter.bibdb @lang = converter.lang @script = converter.script @libdir = converter.libdir @locale = converter.locale @novalid = converter.novalid @output_dir = converter.output_dir @filename = converter.filename @files_to_delete = converter.files_to_delete copied_instance_variables.each do |var| instance_variable_set("@#{var}", converter.instance_variable_get("@#{var}")) end # Special handling for derived values @i18n = @isodoc&.i18n # Reuse converter's relaton_log instead of creating a new one @relaton_log = converter.relaton_log end