Class: Metanorma::Standoc::Converter
- Inherits:
-
Object
- Object
- Metanorma::Standoc::Converter
- Includes:
- Asciidoctor::Converter, Asciidoctor::Writer, Base, Blocks, Front, Inline, Lists, Refs, Section, Table, Utils
- Defined in:
- lib/metanorma/converter/converter.rb,
lib/metanorma/converter/log.rb
Overview
A Converter implementation that generates Standoc output, and a document schema encapsulation of the document for validation
Constant Summary collapse
- STANDOC_LOG_MESSAGES =
rubocop:disable Naming/VariableNumber
{ STANDOC_1: { category: "Include", error: "Specified boilerplate file does not exist: %s", severity: 0 }, STANDOC_2: { category: "Table", error: "Empty table", severity: 0 }, STANDOC_3: { category: "Crossreferences", error: "invalid index \"%s\" cross-reference: " \ "wrong number of attributes in `index:%s[%s]`", severity: 0 }, STANDOC_4: { category: "Table", error: "Table rows in table %s: check rowspan", severity: 0 }, STANDOC_5: { category: "Table", error: "Table exceeds maximum number of columns defined (%s)", severity: 0 }, STANDOC_6: { category: "Maths", error: "Malformed MathML: %s\n%s", severity: 0 }, STANDOC_7: { category: "Metanorma XML Syntax", error: "%s", severity: 2 }, STANDOC_8: { category: "Anchors", error: "Malformed URI: %s", severity: 0 }, STANDOC_9: { category: "Bibliography", error: "Attachment %s does not exist", severity: 0 }, STANDOC_10: { category: "Anchors", error: "The following reference is missing an anchor:\n%s", severity: 1 }, STANDOC_11: { category: "Bibliography", error: "Reference %s is missing a title", severity: 1 }, STANDOC_12: { category: "Bibliography", error: "Reference %s is missing a document identifier (docid)", severity: 1 }, STANDOC_13: { category: "AsciiDoc Input", error: "term reference not in expected format:%s", severity: 1 }, STANDOC_14: { category: "Style", error: "Style override set for ordered list", severity: 2 }, STANDOC_15: { category: "Crossreferences", error: "Could not resolve footnoteblock:[%s]", severity: 1 }, STANDOC_16: { category: "AsciiDoc Input", error: "Section not marked up as [bibliography]!", severity: 2 }, STANDOC_17: { category: "Bibliography", error: "ERROR: No document identifier retrieved for %s", severity: 2 }, STANDOC_18: { category: "Bibliography", error: "ERROR: No title retrieved for %s", severity: 2 }, STANDOC_19: { category: "Bibliography", error: "Cannot find reference %s for local Relaton " \ "data source %s", severity: 0 }, STANDOC_20: { category: "AsciiDoc Input", error: "Metadata definition list does not follow a term designation", severity: 2 }, STANDOC_21: { category: "Terms", error: "Removed duplicate designation %s", severity: 2 }, STANDOC_22: { category: "Bibliography", error: "Term \"%s\" does not match IEV %s \"%s\"", severity: 1 }, STANDOC_23: { category: "Anchors", error: "Concept cross-reference error: %s", severity: 0 }, STANDOC_24: { category: "Terms", error: "Term %s occurs twice as preferred designation: %s", severity: 1 }, STANDOC_25: { category: "Terms", severity: 0, error: <<~ERROR.freeze }, STANDOC_26: { category: "AsciiDoc Input", error: "Error: Symbol reference in `symbol[%s]` missing: \"%s\" is not defined in document", severity: 1 }, STANDOC_27: { category: "AsciiDoc Input", error: "Error: Term reference to `%s` missing: \"%s\" is not defined in document%s", severity: 1 }, STANDOC_28: { category: "Crossreferences", error: "term source %s not referenced", severity: 1 }, STANDOC_29: { category: "AsciiDoc Input", error: "converter missing for %s node in Metanorma backend", severity: 1 }, STANDOC_30: { category: "Crossreferences", error: "%s does not have a corresponding anchor ID in the bibliography!", severity: 2 }, STANDOC_31: { category: "Crossreferences", error: "Illegal cross-reference connective: %s", severity: 0 }, STANDOC_32: { category: "Crossreferences", error: "%s does not have a corresponding anchor ID in the bibliography!", severity: 2 }, STANDOC_33: { category: "Maths", error: "Invalid MathML: %s\n %s%s", severity: 0 }, STANDOC_34: { category: "Style", error: "There is an instance of %s nested within %s", severity: 2 }, STANDOC_35: { category: "Style", error: "There is a crossreference to an instance of %s nested within %s: %s", severity: 2 }, STANDOC_36: { category: "Anchors", error: "ID %s has already been used at line %s", severity: 0 }, STANDOC_37: { category: "Bibliography", error: "Cannot process format %s for local Relaton data source %s", severity: 0 }, STANDOC_38: { category: "Anchors", error: "Crossreference target %s is undefined", severity: 1 }, STANDOC_39: { category: "Blocks", error: "%s is empty", severity: 1 }, STANDOC_40: { category: "Bibliography", error: "Could not retrieve %s: no access to online site", severity: 1 }, STANDOC_41: { category: "Include", error: "Unresolved directive %s", severity: 0 }, STANDOC_42: { category: "Metanorma XML Syntax", error: "Invalid passthrough content: %s\n" \ "This is not valid Metanorma XML. If you intended a different format, such as HTML, you need to specify `format=` on the pass markup;\n" \ "refer to https://www.metanorma.org/author/topics/blocks/passthroughs/", severity: 0 }, STANDOC_43: { category: "AsciiDoc Input", error: <<~REF.freeze, severity: 1 }, STANDOC_44: { category: "Images", error: "Image not found: %s", severity: 0 }, STANDOC_45: { category: "Images", error: "Corrupt PNG image detected: %s", severity: 2 }, STANDOC_46: { category: "Images", error: "Image too large for Data URI encoding: disable Data URI encoding (`:data-uri-image: false`), or set `:data-uri-maxsize: 0`", severity: 0 }, STANDOC_47: { category: "Crossreferences", error: "mismatch of callouts (%s) and annotations (%s)", severity: 0 }, STANDOC_48: { category: "Style", error: "(generic warning) %s", severity: 2 }, STANDOC_49: { category: "Bibliography", error: "Numeric reference in normative references", severity: 1 }, STANDOC_50: { category: "Fatal Error", error: "%s", severity: 0 }, STANDOC_51: { category: "Maths", error: "latexmlmath failed to process equation:\n%s", severity: 1 }, STANDOC_52: { category: "Bibliography", error: "Bibliographic spans: %s", severity: 0 }, STANDOC_53: { category: "Bibliography", error: "Bibliographic spans: %s", severity: 1 }, STANDOC_54: { category: "Bibliography", error: "Cannot process file %s for local Relaton data source %s", severity: 0 }, STANDOC_55: { category: "Images", error: "Corrupt SVG image detected, error found: %s %s%s%s", severity: 2 }, STANDOC_56: { category: "Images", error: "Corrupt SVG image detected, could not be fixed: %s %s%s%s", severity: 1 }, STANDOC_57: { category: "Images", error: "SVG image warning: %s %s%s%s", severity: 3 }, STANDOC_58: { category: "Images", error: "Corrupt SVG image detected, fix attempted: %s %s: %s %s, Node: %s", severity: 2 }, STANDOC_59: { category: "Images", error: "SVG unresolved internal reference: %s line %s", severity: 3 }, STANDOC_60: { category: "Bibliography", error: "Unrecognised bibliographic style: %s", severity: 1 }, STANDOC_61: { category: "AsciiDoc Input", error: "Improperly nested sourcecode markup: %s", severity: 0 }, STANDOC_62: { category: "Crossreferences", error: "Sourcecode with callout markup but no annotations", severity: 1 }, STANDOC_63: { category: "Images", error: "Warning on PNG image: %s", severity: 3 }, RELATON_1: { category: "Relaton", error: "(Error from Relaton) %s", severity: 0 }, RELATON_2: { category: "Relaton", error: "(Error from Relaton) %s", severity: 1 }, RELATON_3: { category: "Relaton", error: "(Error from Relaton) %s", severity: 2 }, RELATON_4: { category: "Relaton", error: "(Error from Relaton) %s", severity: 3 }, RELATON_5: { category: "Relaton", error: "(Error from Relaton IEV) %s", severity: 0 }, }.freeze
Constants included from Utils
Utils::SECTION_CONTAINERS, Utils::SUBCLAUSE_XPATH
Constants included from Section
Section::MAIN_CLAUSE_NAMES, Section::PREFACE_CLAUSE_NAMES, Section::SECTIONTYPE_STREAMLINE
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 Blocks
Constants included from Inline
Inline::STEM_ATTRS, Inline::XREF_ATTRS
Constants included from Refs
Constants included from Base
Class Attribute Summary collapse
-
._file ⇒ Object
Returns the value of attribute _file.
-
.embed_hdr ⇒ Object
Returns the value of attribute embed_hdr.
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
-
#bibdb ⇒ Object
readonly
Returns the value of attribute bibdb.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#files_to_delete ⇒ Object
readonly
Returns the value of attribute files_to_delete.
-
#lang ⇒ Object
readonly
Returns the value of attribute lang.
-
#libdir ⇒ Object
readonly
Returns the value of attribute libdir.
-
#local_log(doc) ⇒ Object
readonly
Returns the value of attribute local_log.
-
#locale ⇒ Object
readonly
Returns the value of attribute locale.
-
#novalid ⇒ Object
readonly
Returns the value of attribute novalid.
-
#output_dir ⇒ Object
readonly
Returns the value of attribute output_dir.
-
#relaton_log ⇒ Object
readonly
Returns the value of attribute relaton_log.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
Attributes included from Base
Class Method Summary collapse
-
.inherited(konv) ⇒ Object
rubocop:disable Lint/MissingSuper.
Instance Method Summary collapse
- #content(node) ⇒ Object (also: #embedded)
-
#html_doc_path(file) ⇒ Object
path to isodoc assets in child gems.
-
#initialize(backend, opts) ⇒ Converter
constructor
A new instance of Converter.
-
#log_messages ⇒ Object
rubocop:enable Naming/VariableNumber.
- #skip(node, name = nil) ⇒ Object (also: #audio, #video, #inline_button, #inline_kbd, #inline_menu)
-
#validate_document_fragment(xml_fragment) ⇒ Object
Wrapper method to access validation functionality.
Methods included from Utils
#add_id, #add_id_text, #add_noko_elem, adoc2xml, #asciimath_key, #attr_code, #complete_and_compare_dates, #complete_iso_date, #complete_year_month, #complete_year_only, #convert, #csv_split, #dl_to_attrs, #dl_to_elems, #document_ns_attributes, #grkletters, #insert_before, #isodoc, #isolated_asciidoctor_convert, #kv_parse, #link_unwrap, #noko, #parse_complete_date, #parse_partial_date, #processor, #quoted_csv_split, #refid?, #section_containers, #separate_numbering_footnotes, #term_expr, #textcleanup, #to_xml, #wrap_in_para, #xml_encode
Methods included from Table
#dl1_table_cleanup, #dl2_table_cleanup, #header_rows_cleanup, #insert_thead, #notes_table_cleanup, #sources_table_cleanup, #table, #table_attrs, #table_cleanup, #td_style_cleanup, #tr_style_cleanup
Methods included from Section
#abstract_parse, #acknowledgements_parse, #add_term_source, #add_term_source_mod, #annex_attrs_preprocess, #annex_parse, #appendix_parse, #bibabstract_location, #bibitem_parse, #biblio_prep, #bibliography_parse, #clause_attrs_preprocess, #clause_parse, #clausebefore_cleanup, #clean_abstract, #emend_biblio, #emend_biblio_fn, #emend_biblio_id, #emend_biblio_title, #emend_biblio_usrlbl, #endofpreface_clausebefore, #executivesummary_parse, #extract_termsource_refs, #floating_title, #floating_title_attrs, #foreword_parse, #in_biblio?, #in_norm_ref?, #in_terms?, #indexsect_parse, #introduction_parse, #make_abstract, #make_annexes, #make_bibliography, #make_colophon, #make_indexsect, #make_preface, #maxlevel, #metanorma_extension_parse, #misccontainer_cleanup, #move_clauses_into_preface, #nonterm_symbols_parse, #nonterm_term_def_subclause_parse, #norm_ref_parse, #obligations_cleanup, #obligations_cleanup_info, #obligations_cleanup_inherit, #obligations_cleanup_norm, #pop_symbols, #pop_term_def, #preamble, #preface_clausebefore_cleanup, #preface_main_filter, #role_style, #scope_parse, #section, #section_attributes, #section_attributes_change, #section_title, #sections_clausebefore_cleanup, #sections_cleanup, #sections_level_cleanup, #sections_order_cleanup, #sectiontype, #sectiontype1, #sectiontype_streamline, #set_obligation, #single_clause_annex, #source_include_cleanup, #source_sanitise, #start_main_section, #stash_symbols, #stash_term_def, #support_appendix?, #symbols_attrs, #symbols_parse, #term_contains_subclauses, #term_def_parse, #term_def_subclause_parse, #term_def_subclause_parse1, #term_designation, #termdefinition, #terms_boilerplate_parse, #termsource, #termsource_attrs, #termsource_origin_attrs, #to_preface
Methods included from Regex
Methods included from Blocks
#admonition, #admonition_alternatives, #admonition_attrs, #admonition_core_attrs, #admonition_name, #altmedia_block, #block_title, #boilerplate_note, #default_requirement_model, #editor_prefixed_para, #example, #example_attrs, #example_by_role, #example_proper, #example_to_requirement, #figure_attrs, #figure_example, #form, #form_attrs, #formula_attrs, #id_attr, #id_unnum_attrs, #image, #keep_attrs, #key_block, #listing, #listing_attrs, #literal, #literal_attrs, #note, #note_attrs, #open, #open1, #open_role, #para_attrs, #paragraph, #pass, #passthrough_validate, #pseudocode_example, #quote, #quote_attribution, #quote_attrs, #reqt_subpart?, #requirement, #requirement_attrs, #requirement_subpart, #requirement_validate, #select_requirement_model, #sidebar, #sidebar_attrs, #stem, #svgmap_attrs, #svgmap_example, #term_example, #termnote, #termnote_attrs, #todo, #todo_attrs, #todo_prefixed_para
Methods included from Inline
#altmedia_id_attr, #anchor_cleanup, #bookmark_cleanup, #bookmark_to_id, #concatenate_attributes_to_xref_text, #concept_cleanup, #concept_cleanup1, #concept_eref_cleanup, #concept_termbase_cleanup, #concept_xref_cleanup, #contenthash_id_cleanup, #contenthash_id_make, #dt_bookmark_cleanup, #duplicate_langvariants, #empty_text_before_first_element, #hash2styles, #highlight_parse, #image_attributes, #image_attributes1, #image_mimetype, #image_src_uri, #inline_anchor, #inline_anchor_bibref, #inline_anchor_bibref_contents, #inline_anchor_link, #inline_anchor_link_attrs, #inline_anchor_ref, #inline_anchor_xref, #inline_anchor_xref_attrs, #inline_anchor_xref_attrs1, #inline_anchor_xref_match, #inline_anchor_xref_text, #inline_break, #inline_callout, #inline_footnote, #inline_image, #inline_indexterm, #inline_indexterm1, #inline_indexterm_extract, #inline_indexterm_see, #inline_quoted, #key_extract_locality, #lang_variant_to_node, #latex_parse, #latex_parse1, #li_bookmark_cleanup, #link_cleanup, #only_langvariant_children?, #page_break, #pass, #passthrough_cleanup, #passthrough_metanorma_cleanup, #redundant_bookmark_cleanup, #related_cleanup, #source_id_cleanup, #stem_attrs, #stem_parse, #strip_initial_space, #thematic_break, #to_xreftarget, #uri_cleanup, #uri_component_encode, #variant_cleanup, #variant_space_cleanup
Methods included from Refs
#analyse_ref_code, #analyse_ref_code_csv, #analyse_ref_code_csv_breakup, #analyse_ref_code_csv_map, #analyse_ref_code_nested, #analyse_ref_numeric, #analyse_ref_repo_path, #conditional_date, #docid, #docid_untyped?, #docnumber, #docrelation_insert, #dual_entries, #fetch_ref, #fetch_ref1, #fetch_ref_async, #fetch_ref_async1, #fetch_ref_async_dual, #global_ievcache_name, #id_and_year, #init_bib_caches, #init_iev_caches, #iso_publisher, #isorefmatches2_1, #isorefmatches2code, #isorefmatches2out, #isorefmatches3_1, #isorefmatches3code, #isorefmatches3out, #isorefmatchescode, #isorefmatchesout, #isorefrender1, #joint_entries, #joint_entries_prep, #local_ievcache_name, #merge_docids, #merge_entries, #merge_publishers, #merge_urls, #mn_code, #no_year_generic_ref, #norm_year, #parse_ref_code_nested, #plaintxt, #ref_attributes, #ref_fn, #ref_normalise, #ref_normalise_no_format, #reference, #reference1_matches, #reference1code, #reference1out, #reference_normalise, #reference_populate, #reference_queue, #references2xml, #references_fetch, #refitem1code, #refitem1yr, #refitem_render, #refitem_render1, #refitem_render_attrs, #refitem_render_formattedref, #refitem_uri, #refitemcode, #refitemout, #set_date_range, #skip_docid, #smart_render_xml, #supply_ref_prefix, #unfetchable_ref_code?, #use_my_anchor, #use_retrieved_relaton
Methods included from Lists
#colist, #dd, #dl_attrs, #dlist, #dt, #li, #list_caption, #ol_attrs, #olist, #olist_style, #ul_attrs, #ul_li, #ul_li_attrs, #ulist
Methods included from Front
#add_title_xml, #committee_abbrevs, #committee_contrib_org_prep, #committee_contributors, #committee_ident, #committee_number_or_name?, #committee_org_prep_agency, #contrib_committee_build, #contrib_committee_build_agency, #contrib_committee_subdiv, #contributors_committees_filter_empty?, #contributors_committees_nest1, #contributors_committees_pad_multiples, #copyright_parse, #datetypes, #default_publisher, #extract_org_attrs_address, #extract_org_attrs_complex, #full_committee_agency_id, #full_committee_id, #metadata, #metadata_author, #metadata_classifications, #metadata_committee_types, #metadata_copyright, #metadata_coverpage_images, #metadata_date, #metadata_date1, #metadata_doctype, #metadata_ext, #metadata_flavor, #metadata_getrelation, #metadata_getrelation1, #metadata_ics, #metadata_id, #metadata_id_build, #metadata_id_docidentifier, #metadata_id_nonprimary, #metadata_id_primary, #metadata_id_primary_type, #metadata_keywords, #metadata_language, #metadata_note, #metadata_other_id, #metadata_publisher, #metadata_relations, #metadata_script, #metadata_series, #metadata_source, #metadata_sponsor, #metadata_status, #metadata_subdoctype, #metadata_version, #metadata_version_value, #org_abbrev, #org_address, #org_attrs_add_committees, #org_attrs_complex_parse, #org_attrs_parse, #org_attrs_parse_core, #org_attrs_simple_parse, #org_attrs_simple_parse_no_source, #org_author, #org_contact, #org_contributor, #org_contributor_role, #org_logo, #org_name_and_abbrev, #org_organization, #organization, #person_address, #person_address_components, #person_affiliation, #person_credentials, #person_name, #person_org_logo, #person_organization, #personal_author, #personal_author1, #personal_contact, #personal_role, #relation_normalise, #relaton_relation_descriptions, #relaton_relations, #structured_id, #subdiv_build, #subdivision, #subdivision1, #title, #title_fallback, #title_main, #title_num_prefix, #title_nums, #title_nums_prep, #title_other
Methods included from Base
#absolute_path_pdf_attributes, #biblio_cutoff, #clean_abort, #clean_exit, #cleanup, #cleanup_class, #cleanup_log_filter_error_log, #default_fonts, #default_svg_conform_profile, #doc_converter, #doc_extract_attributes, #doctype, #document, #document1, #document_scheme, #document_scheme_metadata, #draft?, #extract_log_filter_error_loc, #flex_attr_name, #fonts_manifest_option, #front, #html_converter, #html_extract_attributes, #i18nyaml_path, #in_isolated_conversion?, #init, #init_bib_db, #init_bib_log, #init_biblio, #init_i18n, #init_image, #init_log, #init_math, #init_metadata, #init_misc, #init_output, #init_processing, #init_reqt, #init_toc, #init_vars, #init_xref, #insert_xml_cr, #makexml, #makexml1, #metadata_attrs, #middle, #numberfmt_formula, #outputs, #pdf_converter, #pdf_extract_attributes, #presentation_xml_converter, #relaton_render_path, #requirements_processor, #schema_version, #toc_default, #validate_class, #version, #xml_namespace, #xml_root_tag
Constructor Details
#initialize(backend, opts) ⇒ Converter
Returns a new instance of Converter.
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/metanorma/converter/converter.rb', line 111 def initialize(backend, opts) doc = opts&.dig(:document) doc&.delete_attribute("sectids") # no autoassign sect ids from title super basebackend "html" outfilesuffix ".xml" @libdir = File.dirname(self.class::_file || __FILE__) @c = HTMLEntities.new local_log(doc) end |
Class Attribute Details
._file ⇒ Object
Returns the value of attribute _file.
131 132 133 |
# File 'lib/metanorma/converter/converter.rb', line 131 def _file @_file end |
.embed_hdr ⇒ Object
Returns the value of attribute embed_hdr.
131 132 133 |
# File 'lib/metanorma/converter/converter.rb', line 131 def @embed_hdr end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def backend @backend end |
#bibdb ⇒ Object (readonly)
Returns the value of attribute bibdb.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def bibdb @bibdb end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def filename @filename end |
#files_to_delete ⇒ Object (readonly)
Returns the value of attribute files_to_delete.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def files_to_delete @files_to_delete end |
#lang ⇒ Object (readonly)
Returns the value of attribute lang.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def lang @lang end |
#libdir ⇒ Object (readonly)
Returns the value of attribute libdir.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def libdir @libdir end |
#local_log(doc) ⇒ Object (readonly)
Returns the value of attribute local_log.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def local_log @local_log end |
#locale ⇒ Object (readonly)
Returns the value of attribute locale.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def locale @locale end |
#novalid ⇒ Object (readonly)
Returns the value of attribute novalid.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def novalid @novalid end |
#output_dir ⇒ Object (readonly)
Returns the value of attribute output_dir.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def output_dir @output_dir end |
#relaton_log ⇒ Object (readonly)
Returns the value of attribute relaton_log.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def relaton_log @relaton_log end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
108 109 110 |
# File 'lib/metanorma/converter/converter.rb', line 108 def script @script end |
Class Method Details
.inherited(konv) ⇒ Object
rubocop:disable Lint/MissingSuper
134 135 136 |
# File 'lib/metanorma/converter/converter.rb', line 134 def self.inherited(konv) # rubocop:disable Lint/MissingSuper konv._file = caller_locations(1..1).first.absolute_path end |
Instance Method Details
#content(node) ⇒ Object Also known as: embedded
143 144 145 |
# File 'lib/metanorma/converter/converter.rb', line 143 def content(node) node.content end |
#html_doc_path(file) ⇒ Object
path to isodoc assets in child gems
139 140 141 |
# File 'lib/metanorma/converter/converter.rb', line 139 def html_doc_path(file) File.join(@libdir, "../../isodoc/html", file) end |
#log_messages ⇒ Object
rubocop:enable Naming/VariableNumber
217 218 219 |
# File 'lib/metanorma/converter/log.rb', line 217 def STANDOC_LOG_MESSAGES end |
#skip(node, name = nil) ⇒ Object Also known as: audio, video, , inline_kbd,
147 148 149 150 151 |
# File 'lib/metanorma/converter/converter.rb', line 147 def skip(node, name = nil) name = name || node.node_name @log.add("STANDOC_29", node, params: [name]) nil end |
#validate_document_fragment(xml_fragment) ⇒ Object
Wrapper method to access validation functionality
162 163 164 165 |
# File 'lib/metanorma/converter/converter.rb', line 162 def validate_document_fragment(xml_fragment) validate_processor = validate_class.new(self) validate_processor.validate_document_fragment(xml_fragment) end |