Class: Asciidoctor::Standoc::Converter

Inherits:
Object
  • Object
show all
Includes:
Converter, Base, Blocks, Cleanup, Front, Inline, Lists, Refs, Section, Table, Utils, Validate, Writer
Defined in:
lib/asciidoctor/standoc/converter.rb

Overview

A Converter implementation that generates Standoc output, and a document schema encapsulation of the document for validation

Constant Summary

Constants included from Validate

Validate::SOURCELOCALITY

Constants included from Cleanup

Asciidoctor::Standoc::Cleanup::ABBRnoSYM, Asciidoctor::Standoc::Cleanup::ELEMS_ALLOW_NOTES, Asciidoctor::Standoc::Cleanup::IDREF, Asciidoctor::Standoc::Cleanup::IGNORE_DUMBQUOTES, Asciidoctor::Standoc::Cleanup::ISO_PUBLISHER_XPATH, Asciidoctor::Standoc::Cleanup::LOCALITY_RE, Asciidoctor::Standoc::Cleanup::LOCALITY_REGEX_STR, Asciidoctor::Standoc::Cleanup::MATHML_NS, Asciidoctor::Standoc::Cleanup::NORM_REF, Asciidoctor::Standoc::Cleanup::NO_SYMABBR, Asciidoctor::Standoc::Cleanup::REQRECPER, Asciidoctor::Standoc::Cleanup::SECTION_CONTAINERS, Asciidoctor::Standoc::Cleanup::SYMABBR, Asciidoctor::Standoc::Cleanup::SYMnoABBR, Asciidoctor::Standoc::Cleanup::TERM_CLAUSE, Asciidoctor::Standoc::Cleanup::TEXT_ELEMS, Asciidoctor::Standoc::Cleanup::UNITSML_NS

Constants included from Utils

Utils::NOKOHEAD, Utils::SUBCLAUSE_XPATH

Constants included from Section

Section::TERM_REFERENCE_RE, Section::TERM_REFERENCE_RE_STR

Constants included from Refs

Refs::ISO_REF, Refs::ISO_REF_ALL_PARTS, Refs::ISO_REF_NO_YEAR, Refs::MALFORMED_REF, Refs::NON_ISO_REF

Constants included from Base

Base::XML_NAMESPACE, Base::XML_ROOT_TAG

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Validate

#asset_style, #asset_title_style, #concept_validate, #content_validate, #formattedstr_strip, #hanging_para_style, #iev_validate, #init_iev, #norm_ref_validate, #repeat_id_validate, #repeat_id_validate1, #schema_validate, #schema_validate1, #section_validate, #sourcecode_style, #style_warning, #validate

Methods included from Cleanup

#add_misc_container, #add_to_hash, #align_callouts_to_annotations, #anchor_cleanup, #anchor_cleanup1, #asciimath2mathml, #asciimath2unitsml_options, #bibabstract_location, #bibdata_anchor_cleanup, #bibdata_cleanup, #bibdata_docidentifier_cleanup, #bibitem_cleanup, #bibitem_nested_id, #biblio_cleanup, #biblio_indirect_erefs, #biblio_nested, #biblio_renumber, #biblio_reorder, #biblio_reorder1, #boilerplate, #boilerplate_cleanup, #boilerplate_file, #boilerplate_isodoc, #bookmark_cleanup, #bookmark_to_id, #bpart_cleanup, #callout_cleanup, #change_clauses, #clausebefore_cleanup, #cleanup, #concept_cleanup, #concept_eref_cleanup, #concept_termbase_cleanup, #concept_xref_cleanup, #create_amend, #create_amend1, #create_amend2, #dd_bib_extract, #dl1_table_cleanup, #dl2_table_cleanup, #dl_bib_extract, #docidentifier_cleanup, #dt_bookmark_cleanup, #dumb2smart_quotes, #dumbquote_cleanup, #element_name_cleanup, #empty_element_cleanup, #empty_text_before_first_element, #external_terms_boilerplate, #extract_from_p, #extract_localities, #extract_localities1, #extract_notes_from_biblio, #extract_symbols_list, #fetch_local_bibitem, #fetch_termbase, #figure_cleanup, #figure_dl_cleanup1, #figure_dl_cleanup2, #figure_footnote_cleanup, #fold_notes_into_biblio, #footnote_block_cleanup, #footnote_cleanup, #footnote_content, #form_cleanup, #format_ref, #formula_cleanup, #formula_cleanup_where1, #formula_cleanup_where2, #gather_indirect_erefs, #gather_unitsml, #get_or_make_title, #grkletters, #guid?, #header_rows_cleanup, #img_cleanup, #indirect_eref_to_xref, #initial_boilerplate, #inject_id, #insert_indirect_biblio, #insert_thead, #internal_external_terms_boilerplate, #key_extract_locality, #li_bookmark_cleanup, #link_callouts_to_annotations, #link_unwrap, #locality_label, #make_abstract, #make_annexes, #make_bibliography, #make_indexsect, #make_preface, #mathml_cleanup, #mathml_italicise, #mathml_mathvariant, #mathml_mi_italics, #mathml_namespace, #mathml_preserve_space, #mathml_unitsML, #mathvariant_override, #maxlevel, #merge_annotations_into_sourcecode, #mi_italicise?, #move_attrs_to_amend, #move_clauses_into_preface, #norm_ref_preface, #normref_cleanup, #note_cleanup, #notes_table_cleanup, #obligations_cleanup, #obligations_cleanup_info, #obligations_cleanup_inherit, #obligations_cleanup_norm, #origin_cleanup, #other_footnote_renumber, #other_footnote_renumber1, #p_unwrap, #para_cleanup, #preface_clausebefore_cleanup, #quotesource_cleanup, #read_local_bibitem, #ref_cleanup, #ref_dl_cleanup, #reference_names, #replace_title, #reqt_dl_to_attrs, #reqt_dl_to_classif, #reqt_dl_to_elems, #requirement_cleanup, #requirement_description_cleanup1, #requirement_description_wrap, #requirement_descriptions, #requirement_inherit, #requirement_inherit_insert, #requirement_inherit_insert1, #requirement_metadata, #requirement_metadata1, #requirement_metadata1_tags, #resolve_local_indirect_erefs, #safe_noko, #script_cleanup, #section_names_refs_cleanup, #section_names_terms_cleanup, #sections_clausebefore_cleanup, #sections_cleanup, #sections_level_cleanup, #sections_names_cleanup, #sections_order_cleanup, #sections_variant_title_cleanup, #smartquotes_cleanup, #smartquotes_cleanup1, #sort_biblio, #sourcecode_cleanup, #sourcecode_markup, #strip_initial_space, #subfigure_cleanup, #svgmap_cleanup, #svgmap_moveattrs, #svgmap_moveattrs1, #svgmap_populate, #svgmap_target, #symbol_key, #symbols_cleanup, #table_cleanup, #table_footnote_renumber, #table_footnote_renumber1, #term_children_cleanup, #term_defs_boilerplate, #term_defs_boilerplate_cont, #termdef_boilerplate_cleanup, #termdef_boilerplate_insert, #termdef_cleanup, #termdef_from_termbase, #termdef_remove_initial_paras, #termdef_stem_cleanup, #termdef_subclause_cleanup, #termdef_unnest_cleanup, #termdefinition_cleanup, #termdocsource_cleanup, #termdomain1_cleanup, #termdomain_cleanup, #termnote_example_cleanup, #textcleanup, #title_footnote_move, #to_xreftarget, #toc_cleanup, #toc_cleanup1, #toc_cleanup_clause, #toc_cleanup_clause_entry, #toc_cleanup_para, #toc_index, #toc_index_depths, #tq, #uninterrupt_quotes_around_xml, #uninterrupt_quotes_around_xml1, #unwrap_boilerplate_clauses, #validate_ref_dl, #variant_cleanup, #variant_space_cleanup, #xml_unescape_mathml, #xref_cleanup, #xref_to_eref, #xref_to_internal_eref, #xreftarget_cleanup

Methods included from Utils

#attr_code, #convert, #default_script, #document_ns_attributes, #isodoc, #noko, #wrap_in_para

Methods included from Table

#table, #table_attrs

Methods included from Section

#abstract_parse, #acknowledgements_parse, #add_term_source, #annex_parse, #bibitem_parse, #bibliography_parse, #clause_parse, #emend_biblio, #extract_termsource_refs, #fetch_ref, #foreword_parse, #global_ievcache_name, #in_biblio?, #in_norm_ref?, #in_terms?, #indexsect_parse, #init_bib_caches, #init_iev_caches, #introduction_parse, #local_ievcache_name, #nonterm_symbols_parse, #nonterm_term_def_subclause_parse, #norm_ref_parse, #preamble, #reference, #scope_parse, #section, #section_attributes, #sectiontype, #sectiontype1, #sectiontype_streamline, #set_obligation, #smart_render_xml, #symbols_attrs, #symbols_parse, #term_def_parse, #term_def_subclause_parse, #term_def_subclause_parse1, #term_source_attrs, #termdefinition, #terms_boilerplate_parse, #termsource

Methods included from Blocks

#admonition, #admonition_attrs, #example, #example_attrs, #example_proper, #figure_attrs, #figure_title, #form, #formula_attrs, #id_attr, #id_unnum_attrs, #image, #keep_attrs, #listing, #listing_attrs, #literal, #literal_attrs, #note, #note_attrs, #open, #para_attrs, #paragraph, #pass, #pseudocode_example, #quote, #quote_attribution, #quote_attrs, #req_classif_parse, #reqt_attrs, #reqt_subpart, #reqt_subpart_attrs, #requirement, #requirement_classification, #requirement_elems, #requirement_subpart, #sidebar, #sidebar_attrs, #stem, #svgmap_attrs, #svgmap_example, #term_example, #termnote, #termnote_attrs, #todo, #todo_attrs

Methods included from Inline

#highlight_parse, #image_attributes, #image_attributes1, #inline_anchor, #inline_anchor_bibref, #inline_anchor_link, #inline_anchor_ref, #inline_anchor_xref, #inline_anchor_xref_attrs, #inline_break, #inline_callout, #inline_footnote, #inline_image, #inline_indexterm, #inline_quoted, #latex_parse, #latex_parse1, #page_break, #refid?, #stem_parse, #thematic_break, #xml_encode

Methods included from Refs

#analyse_ref_code, #analyse_ref_nofetch, #analyse_ref_numeric, #analyse_ref_repo_path, #conditional_date, #docid, #docnumber, #id_and_year, #iso_publisher, #isorefmatches, #isorefmatches2, #isorefmatches2_1, #isorefmatches3, #isorefmatches3_1, #isorefrender1, #mn_code, #norm_year, #plaintxt, #ref_attributes, #ref_normalise, #ref_normalise_no_format, #reference1, #reference1_matches, #refitem, #refitem1, #refitem_render, #refitem_render1, #set_date_range, #use_my_anchor

Methods included from Lists

#colist, #dd, #dl_attrs, #dlist, #dt, #li, #ol_attrs, #olist, #olist_style, #ul_attrs, #ul_li, #ul_li_attrs, #ulist

Methods included from Front

#committee_component, #csv_split, #datetypes, #default_publisher, #metadata, #metadata_author, #metadata_classifications, #metadata_committee, #metadata_copyright, #metadata_date, #metadata_date1, #metadata_doctype, #metadata_ext, #metadata_getrelation, #metadata_ics, #metadata_id, #metadata_keywords, #metadata_language, #metadata_note, #metadata_other_id, #metadata_publisher, #metadata_relations, #metadata_script, #metadata_series, #metadata_source, #metadata_status, #metadata_subdoctype, #metadata_version, #org_abbrev, #org_address, #organization, #person_address, #person_address_components, #person_affiliation, #person_name, #person_organization, #personal_author, #personal_author1, #personal_contact, #personal_role, #relation_normalise, #relaton_relation_descriptions, #relaton_relations, #title, #title_english, #title_otherlangs

Methods included from Base

#clean_abort, #clean_exit, #default_fonts, #doc_converter, #doc_extract_attributes, #doctype, #document, #draft?, #front, #html_converter, #html_extract_attributes, #init, #makexml, #makexml1, #middle, #outputs, #pdf_converter, #presentation_xml_converter, #version, #xml_namespace, #xml_root_tag

Constructor Details

#initialize(backend, opts) ⇒ Converter

Returns a new instance of Converter.



82
83
84
85
86
87
# File 'lib/asciidoctor/standoc/converter.rb', line 82

def initialize(backend, opts)
  super
  basebackend "html"
  outfilesuffix ".xml"
  @libdir = File.dirname(self.class::_file || __FILE__)
end

Class Attribute Details

._fileObject

Returns the value of attribute _file.



90
91
92
# File 'lib/asciidoctor/standoc/converter.rb', line 90

def _file
  @_file
end

Class Method Details

.inherited(konv) ⇒ Object

rubocop:disable Lint/MissingSuper



93
94
95
# File 'lib/asciidoctor/standoc/converter.rb', line 93

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



102
103
104
# File 'lib/asciidoctor/standoc/converter.rb', line 102

def content(node)
  node.content
end

#html_doc_path(file) ⇒ Object

path to isodoc assets in child gems



98
99
100
# File 'lib/asciidoctor/standoc/converter.rb', line 98

def html_doc_path(file)
  File.join(@libdir, "../../isodoc/html", file)
end

#skip(node, name = nil) ⇒ Object Also known as: audio, video, inline_button, inline_kbd, inline_menu



106
107
108
109
110
111
# File 'lib/asciidoctor/standoc/converter.rb', line 106

def skip(node, name = nil)
  name = name || node.node_name
  w = "converter missing for #{name} node in Metanorma backend"
  @log.add("AsciiDoc Input", node, w)
  nil
end