sts 0.5.3 → 0.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/GAPS.guidelines.iso-sts-ed2.1/01-maintenance.md +19 -0
- data/GAPS.guidelines.iso-sts-ed2.1/03-general.md +75 -0
- data/GAPS.guidelines.iso-sts-ed2.1/04-structure.md +75 -0
- data/GAPS.guidelines.iso-sts-ed2.1/05-content.md +63 -0
- data/GAPS.guidelines.iso-sts-ed2.1/06-tables.md +53 -0
- data/GAPS.guidelines.iso-sts-ed2.1/07-formulae.md +41 -0
- data/GAPS.guidelines.iso-sts-ed2.1/08-figures.md +45 -0
- data/GAPS.guidelines.iso-sts-ed2.1/09-terms.md +56 -0
- data/GAPS.guidelines.iso-sts-ed2.1/10-references.md +56 -0
- data/GAPS.guidelines.iso-sts-ed2.1/annex-a-multilingual.md +79 -0
- data/GAPS.guidelines.niso-sts-v1.0/01-introduction-scope.md +27 -0
- data/GAPS.guidelines.niso-sts-v1.0/02-document-structure.md +100 -0
- data/GAPS.guidelines.niso-sts-v1.0/03-front-matter.md +149 -0
- data/GAPS.guidelines.niso-sts-v1.0/04-body-content.md +209 -0
- data/GAPS.guidelines.niso-sts-v1.0/05-tables-figures.md +152 -0
- data/GAPS.guidelines.niso-sts-v1.0/06-math-formulae.md +128 -0
- data/GAPS.guidelines.niso-sts-v1.0/07-references.md +113 -0
- data/GAPS.guidelines.niso-sts-v1.0/08-terminology.md +127 -0
- data/GAPS.guidelines.niso-sts-v1.0/09-metadata.md +113 -0
- data/GAPS.guidelines.niso-sts-v1.0/10-iso-iec-variant.md +141 -0
- data/GAPS.guidelines.niso-sts-v1.0/SUMMARY.md +96 -0
- data/GAPS.guidelines.schema-xref.md +101 -0
- data/Gemfile +1 -0
- data/TODO.sts-refactor/00-overview.md +172 -0
- data/TODO.sts-refactor/01-mathml-delegation.md +153 -0
- data/TODO.sts-refactor/02-type-resolution.md +122 -0
- data/TODO.sts-refactor/03-namespace-coupling.md +158 -0
- data/TODO.sts-refactor/04-register-versioning.md +180 -0
- data/TODO.sts-refactor/05-missing-elements.md +195 -0
- data/TODO.sts-refactor/06-missing-attributes.md +152 -0
- data/TODO.sts-refactor/07-incomplete-models.md +180 -0
- data/TODO.sts-refactor/08-isoiec-profile.md +169 -0
- data/TODO.sts-refactor/09-autoload-cleanup.md +88 -0
- data/TODO.sts-refactor/10-test-coverage.md +164 -0
- data/TODO.sts-refactor/11-duplicate-models.md +168 -0
- data/lib/sts/iso_sts/annex_type.rb +2 -0
- data/lib/sts/iso_sts/bold.rb +9 -9
- data/lib/sts/iso_sts/break.rb +3 -0
- data/lib/sts/iso_sts/comm_ref.rb +2 -0
- data/lib/sts/iso_sts/content_language.rb +22 -0
- data/lib/sts/iso_sts/copyright_holder.rb +4 -2
- data/lib/sts/iso_sts/copyright_statement.rb +4 -2
- data/lib/sts/iso_sts/copyright_year.rb +3 -0
- data/lib/sts/iso_sts/doc_ref.rb +2 -0
- data/lib/sts/iso_sts/document_identification.rb +2 -0
- data/lib/sts/iso_sts/edition.rb +2 -0
- data/lib/sts/iso_sts/ext_link.rb +1 -1
- data/lib/sts/iso_sts/front.rb +2 -0
- data/lib/sts/iso_sts/iso_meta.rb +2 -2
- data/lib/sts/iso_sts/italic.rb +9 -9
- data/lib/sts/iso_sts/label.rb +7 -5
- data/lib/sts/iso_sts/language.rb +2 -0
- data/lib/sts/iso_sts/meta_date.rb +20 -0
- data/lib/sts/iso_sts/mixed_citation.rb +5 -5
- data/lib/sts/iso_sts/monospace.rb +26 -0
- data/lib/sts/iso_sts/named_content.rb +44 -0
- data/lib/sts/iso_sts/nat_meta.rb +4 -4
- data/lib/sts/iso_sts/page_count.rb +2 -0
- data/lib/sts/iso_sts/paragraph.rb +8 -8
- data/lib/sts/iso_sts/permissions.rb +2 -0
- data/lib/sts/iso_sts/preformat.rb +3 -3
- data/lib/sts/iso_sts/reg_meta.rb +4 -4
- data/lib/sts/iso_sts/release_date.rb +2 -0
- data/lib/sts/iso_sts/sc.rb +26 -0
- data/lib/sts/iso_sts/sec.rb +2 -2
- data/lib/sts/iso_sts/secretariat.rb +2 -0
- data/lib/sts/iso_sts/standard_cross_reference.rb +4 -2
- data/lib/sts/iso_sts/standard_identification.rb +2 -0
- data/lib/sts/iso_sts/standard_ref.rb +16 -0
- data/lib/sts/iso_sts/std.rb +3 -1
- data/lib/sts/iso_sts/std_ref.rb +2 -0
- data/lib/sts/iso_sts/strike.rb +26 -0
- data/lib/sts/iso_sts/styled_content.rb +11 -9
- data/lib/sts/iso_sts/sub.rb +2 -0
- data/lib/sts/iso_sts/sup.rb +2 -0
- data/lib/sts/iso_sts/table_wrap_foot.rb +2 -0
- data/lib/sts/iso_sts/td.rb +7 -7
- data/lib/sts/iso_sts/term.rb +5 -5
- data/lib/sts/iso_sts/th.rb +7 -7
- data/lib/sts/iso_sts/title.rb +6 -4
- data/lib/sts/iso_sts/title_compl.rb +2 -0
- data/lib/sts/iso_sts/title_full.rb +2 -0
- data/lib/sts/iso_sts/title_intro.rb +2 -0
- data/lib/sts/iso_sts/title_main.rb +2 -0
- data/lib/sts/iso_sts/underline.rb +26 -0
- data/lib/sts/iso_sts/uri.rb +32 -0
- data/lib/sts/iso_sts/xref.rb +3 -3
- data/lib/sts/iso_sts.rb +9 -0
- data/lib/sts/mathml.rb +12 -58
- data/lib/sts/namespaces.rb +2 -0
- data/lib/sts/niso_sts/abstract.rb +2 -0
- data/lib/sts/niso_sts/access_date.rb +2 -0
- data/lib/sts/niso_sts/accrediting_organization.rb +2 -0
- data/lib/sts/niso_sts/addr_line.rb +2 -0
- data/lib/sts/niso_sts/address.rb +2 -0
- data/lib/sts/niso_sts/aff_alternatives.rb +3 -0
- data/lib/sts/niso_sts/alt_text.rb +2 -0
- data/lib/sts/niso_sts/alt_title.rb +2 -0
- data/lib/sts/niso_sts/alternatives.rb +2 -0
- data/lib/sts/niso_sts/anonymous.rb +3 -0
- data/lib/sts/niso_sts/app.rb +2 -0
- data/lib/sts/niso_sts/article_title.rb +2 -0
- data/lib/sts/niso_sts/attrib.rb +2 -0
- data/lib/sts/niso_sts/authorization.rb +2 -0
- data/lib/sts/niso_sts/award_group.rb +22 -4
- data/lib/sts/niso_sts/award_id.rb +6 -0
- data/lib/sts/niso_sts/back.rb +22 -4
- data/lib/sts/niso_sts/body.rb +2 -0
- data/lib/sts/niso_sts/boxed_text.rb +38 -4
- data/lib/sts/niso_sts/break.rb +3 -0
- data/lib/sts/niso_sts/caption.rb +8 -0
- data/lib/sts/niso_sts/chapter_title.rb +2 -0
- data/lib/sts/niso_sts/chem_struct.rb +2 -0
- data/lib/sts/niso_sts/citation_alternatives.rb +2 -0
- data/lib/sts/niso_sts/city.rb +2 -0
- data/lib/sts/niso_sts/code.rb +111 -0
- data/lib/sts/niso_sts/collab_alternatives.rb +3 -0
- data/lib/sts/niso_sts/comm_ref_group.rb +3 -0
- data/lib/sts/niso_sts/comment.rb +2 -0
- data/lib/sts/niso_sts/compound_subject.rb +29 -0
- data/lib/sts/niso_sts/compound_subject_part.rb +39 -0
- data/lib/sts/niso_sts/conf_acronym.rb +2 -0
- data/lib/sts/niso_sts/conf_date.rb +2 -0
- data/lib/sts/niso_sts/conf_loc.rb +2 -0
- data/lib/sts/niso_sts/conf_name.rb +2 -0
- data/lib/sts/niso_sts/conf_num.rb +2 -0
- data/lib/sts/niso_sts/conf_sponsor.rb +2 -0
- data/lib/sts/niso_sts/conf_theme.rb +2 -0
- data/lib/sts/niso_sts/conference.rb +2 -0
- data/lib/sts/niso_sts/content_language.rb +2 -0
- data/lib/sts/niso_sts/contrib_id.rb +2 -0
- data/lib/sts/niso_sts/copyright_holder.rb +2 -0
- data/lib/sts/niso_sts/copyright_statement.rb +2 -0
- data/lib/sts/niso_sts/copyright_year.rb +2 -0
- data/lib/sts/niso_sts/country.rb +2 -0
- data/lib/sts/niso_sts/counts.rb +2 -0
- data/lib/sts/niso_sts/custom_meta.rb +2 -0
- data/lib/sts/niso_sts/custom_meta_group.rb +3 -0
- data/lib/sts/niso_sts/data_title.rb +29 -0
- data/lib/sts/niso_sts/date.rb +2 -0
- data/lib/sts/niso_sts/date_in_citation.rb +2 -0
- data/lib/sts/niso_sts/day.rb +2 -0
- data/lib/sts/niso_sts/def.rb +3 -0
- data/lib/sts/niso_sts/def_head.rb +18 -0
- data/lib/sts/niso_sts/def_item.rb +4 -0
- data/lib/sts/niso_sts/def_list.rb +21 -4
- data/lib/sts/niso_sts/degrees.rb +2 -0
- data/lib/sts/niso_sts/disp_formula_group.rb +0 -2
- data/lib/sts/niso_sts/disp_quote.rb +2 -0
- data/lib/sts/niso_sts/display_formula.rb +37 -4
- data/lib/sts/niso_sts/doc_number.rb +2 -0
- data/lib/sts/niso_sts/doc_type.rb +2 -0
- data/lib/sts/niso_sts/editing_instruction.rb +8 -2
- data/lib/sts/niso_sts/edition.rb +2 -0
- data/lib/sts/niso_sts/elocation_id.rb +2 -0
- data/lib/sts/niso_sts/email.rb +2 -0
- data/lib/sts/niso_sts/equation_count.rb +2 -0
- data/lib/sts/niso_sts/era.rb +2 -0
- data/lib/sts/niso_sts/ext_link.rb +16 -0
- data/lib/sts/niso_sts/fax.rb +2 -0
- data/lib/sts/niso_sts/fig_count.rb +2 -0
- data/lib/sts/niso_sts/floats_group.rb +2 -0
- data/lib/sts/niso_sts/fn_group.rb +3 -0
- data/lib/sts/niso_sts/fpage.rb +2 -0
- data/lib/sts/niso_sts/front.rb +15 -0
- data/lib/sts/niso_sts/funding_source.rb +2 -0
- data/lib/sts/niso_sts/given_names.rb +2 -0
- data/lib/sts/niso_sts/gov.rb +2 -0
- data/lib/sts/niso_sts/graphic.rb +4 -0
- data/lib/sts/niso_sts/hr.rb +3 -0
- data/lib/sts/niso_sts/ics.rb +3 -0
- data/lib/sts/niso_sts/ics_desc.rb +2 -0
- data/lib/sts/niso_sts/ics_wrap.rb +9 -0
- data/lib/sts/niso_sts/index.rb +32 -0
- data/lib/sts/niso_sts/index_div.rb +30 -0
- data/lib/sts/niso_sts/index_entry.rb +32 -0
- data/lib/sts/niso_sts/index_title_group.rb +22 -0
- data/lib/sts/niso_sts/inline_formula.rb +29 -4
- data/lib/sts/niso_sts/inline_media.rb +50 -0
- data/lib/sts/niso_sts/institution.rb +2 -0
- data/lib/sts/niso_sts/institution_id.rb +2 -0
- data/lib/sts/niso_sts/institution_wrap.rb +2 -0
- data/lib/sts/niso_sts/intro.rb +2 -0
- data/lib/sts/niso_sts/is_proof.rb +2 -0
- data/lib/sts/niso_sts/isbn.rb +2 -0
- data/lib/sts/niso_sts/issn.rb +2 -0
- data/lib/sts/niso_sts/issn_l.rb +2 -0
- data/lib/sts/niso_sts/issue.rb +2 -0
- data/lib/sts/niso_sts/kwd_group.rb +8 -0
- data/lib/sts/niso_sts/label.rb +4 -0
- data/lib/sts/niso_sts/legend.rb +39 -0
- data/lib/sts/niso_sts/license.rb +2 -0
- data/lib/sts/niso_sts/license_p.rb +2 -0
- data/lib/sts/niso_sts/list.rb +2 -0
- data/lib/sts/niso_sts/list_item.rb +2 -2
- data/lib/sts/niso_sts/long_desc.rb +2 -0
- data/lib/sts/niso_sts/lpage.rb +2 -0
- data/lib/sts/niso_sts/main.rb +2 -0
- data/lib/sts/niso_sts/meta_date.rb +2 -0
- data/lib/sts/niso_sts/metadata_std.rb +0 -2
- data/lib/sts/niso_sts/mml_content.rb +0 -2
- data/lib/sts/niso_sts/month.rb +2 -0
- data/lib/sts/niso_sts/name.rb +2 -0
- data/lib/sts/niso_sts/name_alternatives.rb +5 -0
- data/lib/sts/niso_sts/named_content.rb +51 -1
- data/lib/sts/niso_sts/nat_meta.rb +2 -0
- data/lib/sts/niso_sts/nested_kwd.rb +2 -0
- data/lib/sts/niso_sts/non_normative_note.rb +2 -0
- data/lib/sts/niso_sts/normative_note.rb +2 -0
- data/lib/sts/niso_sts/object_id.rb +4 -0
- data/lib/sts/niso_sts/on_behalf_of.rb +2 -0
- data/lib/sts/niso_sts/open_access.rb +2 -0
- data/lib/sts/niso_sts/originator.rb +2 -0
- data/lib/sts/niso_sts/page_count.rb +2 -0
- data/lib/sts/niso_sts/page_range.rb +2 -0
- data/lib/sts/niso_sts/paragraph.rb +2 -0
- data/lib/sts/niso_sts/part_number.rb +2 -0
- data/lib/sts/niso_sts/part_of_speech.rb +2 -0
- data/lib/sts/niso_sts/patent.rb +2 -0
- data/lib/sts/niso_sts/permissions.rb +6 -1
- data/lib/sts/niso_sts/phone.rb +2 -0
- data/lib/sts/niso_sts/postal_code.rb +2 -0
- data/lib/sts/niso_sts/prefix.rb +2 -0
- data/lib/sts/niso_sts/price.rb +2 -0
- data/lib/sts/niso_sts/principal_award_recipient.rb +2 -0
- data/lib/sts/niso_sts/principal_investigator.rb +2 -0
- data/lib/sts/niso_sts/private_char.rb +2 -0
- data/lib/sts/niso_sts/processing_meta.rb +54 -0
- data/lib/sts/niso_sts/product.rb +2 -0
- data/lib/sts/niso_sts/proj_id.rb +2 -0
- data/lib/sts/niso_sts/pub_date.rb +2 -0
- data/lib/sts/niso_sts/pub_id.rb +2 -0
- data/lib/sts/niso_sts/publisher.rb +2 -0
- data/lib/sts/niso_sts/publisher_loc.rb +2 -0
- data/lib/sts/niso_sts/publisher_name.rb +2 -0
- data/lib/sts/niso_sts/ref_count.rb +2 -0
- data/lib/sts/niso_sts/reference_standard.rb +2 -2
- data/lib/sts/niso_sts/reg_meta.rb +2 -0
- data/lib/sts/niso_sts/related_term.rb +2 -0
- data/lib/sts/niso_sts/release_date.rb +2 -0
- data/lib/sts/niso_sts/release_version.rb +2 -0
- data/lib/sts/niso_sts/release_version_id.rb +2 -0
- data/lib/sts/niso_sts/role.rb +35 -0
- data/lib/sts/niso_sts/sdo.rb +2 -0
- data/lib/sts/niso_sts/season.rb +2 -0
- data/lib/sts/niso_sts/sec_meta.rb +26 -0
- data/lib/sts/niso_sts/secretariat.rb +2 -0
- data/lib/sts/niso_sts/section.rb +8 -0
- data/lib/sts/niso_sts/see_also_entry.rb +26 -0
- data/lib/sts/niso_sts/see_entry.rb +26 -0
- data/lib/sts/niso_sts/self_uri.rb +2 -0
- data/lib/sts/niso_sts/series.rb +2 -0
- data/lib/sts/niso_sts/series_text.rb +2 -0
- data/lib/sts/niso_sts/series_title.rb +2 -0
- data/lib/sts/niso_sts/sig.rb +2 -0
- data/lib/sts/niso_sts/size.rb +2 -0
- data/lib/sts/niso_sts/source.rb +29 -0
- data/lib/sts/niso_sts/speaker.rb +2 -0
- data/lib/sts/niso_sts/standard_identification.rb +2 -0
- data/lib/sts/niso_sts/state.rb +2 -0
- data/lib/sts/niso_sts/std_doc_meta.rb +49 -11
- data/lib/sts/niso_sts/std_id.rb +2 -0
- data/lib/sts/niso_sts/std_id_group.rb +3 -0
- data/lib/sts/niso_sts/std_org_abbrev.rb +2 -0
- data/lib/sts/niso_sts/std_org_group.rb +3 -0
- data/lib/sts/niso_sts/std_org_name.rb +2 -0
- data/lib/sts/niso_sts/std_organization.rb +2 -0
- data/lib/sts/niso_sts/string_conf.rb +2 -0
- data/lib/sts/niso_sts/string_date.rb +2 -0
- data/lib/sts/niso_sts/string_name.rb +2 -0
- data/lib/sts/niso_sts/styled_content.rb +2 -0
- data/lib/sts/niso_sts/subj_group.rb +11 -1
- data/lib/sts/niso_sts/subtitle.rb +2 -0
- data/lib/sts/niso_sts/suffix.rb +2 -0
- data/lib/sts/niso_sts/suppl_number.rb +2 -0
- data/lib/sts/niso_sts/suppl_type.rb +2 -0
- data/lib/sts/niso_sts/suppl_version.rb +2 -0
- data/lib/sts/niso_sts/surname.rb +2 -0
- data/lib/sts/niso_sts/table_count.rb +2 -0
- data/lib/sts/niso_sts/table_wrap_group.rb +32 -0
- data/lib/sts/niso_sts/term_display.rb +22 -1
- data/lib/sts/niso_sts/term_display_string.rb +22 -0
- data/lib/sts/niso_sts/term_head.rb +2 -0
- data/lib/sts/niso_sts/term_source.rb +2 -0
- data/lib/sts/niso_sts/tex_math.rb +2 -0
- data/lib/sts/niso_sts/textual_form.rb +2 -0
- data/lib/sts/niso_sts/time_stamp.rb +2 -0
- data/lib/sts/niso_sts/title.rb +6 -0
- data/lib/sts/niso_sts/title_wrap.rb +2 -0
- data/lib/sts/niso_sts/toc.rb +32 -0
- data/lib/sts/niso_sts/toc_div.rb +30 -0
- data/lib/sts/niso_sts/toc_entry.rb +30 -0
- data/lib/sts/niso_sts/toc_title_group.rb +22 -0
- data/lib/sts/niso_sts/trans_source.rb +2 -0
- data/lib/sts/niso_sts/trans_title.rb +2 -0
- data/lib/sts/niso_sts/trans_title_group.rb +3 -0
- data/lib/sts/niso_sts/uri.rb +2 -0
- data/lib/sts/niso_sts/urn.rb +2 -0
- data/lib/sts/niso_sts/verse_line.rb +2 -0
- data/lib/sts/niso_sts/version.rb +2 -0
- data/lib/sts/niso_sts/volume.rb +2 -0
- data/lib/sts/niso_sts/volume_id.rb +2 -0
- data/lib/sts/niso_sts/volume_issue_group.rb +2 -0
- data/lib/sts/niso_sts/volume_series.rb +2 -0
- data/lib/sts/niso_sts/word_count.rb +2 -0
- data/lib/sts/niso_sts/year.rb +2 -0
- data/lib/sts/niso_sts.rb +35 -10
- data/lib/sts/profiles/iso_iec/constraints.rb +43 -0
- data/lib/sts/profiles/iso_iec/validator.rb +73 -0
- data/lib/sts/profiles/iso_iec.rb +10 -0
- data/lib/sts/profiles.rb +7 -0
- data/lib/sts/tbx_iso_tml/bold.rb +2 -0
- data/lib/sts/tbx_iso_tml/caption.rb +3 -0
- data/lib/sts/tbx_iso_tml/cross_reference.rb +2 -0
- data/lib/sts/tbx_iso_tml/definition.rb +2 -0
- data/lib/sts/tbx_iso_tml/entailed_term.rb +2 -0
- data/lib/sts/tbx_iso_tml/example.rb +0 -2
- data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -0
- data/lib/sts/tbx_iso_tml/external_source.rb +2 -0
- data/lib/sts/tbx_iso_tml/fn_group.rb +3 -0
- data/lib/sts/tbx_iso_tml/geographical_usage.rb +3 -0
- data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -0
- data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -0
- data/lib/sts/tbx_iso_tml/italic.rb +2 -0
- data/lib/sts/tbx_iso_tml/lang_set.rb +2 -0
- data/lib/sts/tbx_iso_tml/mfenced.rb +2 -0
- data/lib/sts/tbx_iso_tml/mfrac.rb +2 -2
- data/lib/sts/tbx_iso_tml/mi.rb +3 -2
- data/lib/sts/tbx_iso_tml/mrow.rb +2 -2
- data/lib/sts/tbx_iso_tml/mspace.rb +2 -0
- data/lib/sts/tbx_iso_tml/mstyle.rb +2 -2
- data/lib/sts/tbx_iso_tml/msub.rb +2 -0
- data/lib/sts/tbx_iso_tml/msup.rb +2 -0
- data/lib/sts/tbx_iso_tml/munder.rb +3 -0
- data/lib/sts/tbx_iso_tml/munderover.rb +2 -0
- data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -0
- data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -0
- data/lib/sts/tbx_iso_tml/pronunciation.rb +3 -0
- data/lib/sts/tbx_iso_tml/see.rb +2 -0
- data/lib/sts/tbx_iso_tml/semantics.rb +2 -0
- data/lib/sts/tbx_iso_tml/source.rb +2 -0
- data/lib/sts/tbx_iso_tml/subject_field.rb +2 -0
- data/lib/sts/tbx_iso_tml/sup.rb +3 -2
- data/lib/sts/tbx_iso_tml/table_wrap.rb +0 -1
- data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +2 -0
- data/lib/sts/tbx_iso_tml/td.rb +115 -24
- data/lib/sts/tbx_iso_tml/term_type.rb +2 -0
- data/lib/sts/tbx_iso_tml/th.rb +124 -30
- data/lib/sts/tbx_iso_tml/xref.rb +2 -2
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -12
- data/reference-docs/Guidelines for coding ed.2.1.pdf +0 -0
- data/reference-docs/NISO-STS-1-2-compare-1-0.pdf +0 -0
- data/reference-docs/NISOSTS-guidelines-v1.0.pdf +0 -0
- metadata +71 -14
- data/lib/sts/content_groups/helpers.rb +0 -27
- data/lib/sts/enum_values.rb +0 -17
- data/lib/sts/iso_sts/content_groups/highlight_elements.rb +0 -285
- data/lib/sts/niso_sts/content_groups/body_elements.rb +0 -50
- data/lib/sts/niso_sts/content_groups/citation_elements.rb +0 -74
- data/lib/sts/niso_sts/content_groups/emphasized_text.rb +0 -67
- data/lib/sts/niso_sts/content_groups/highlight_elements.rb +0 -51
- data/lib/sts/niso_sts/content_groups/inside_cell.rb +0 -116
- data/lib/sts/niso_sts/content_groups/p_elements.rb +0 -41
- data/lib/sts/niso_sts/content_groups/para_level.rb +0 -67
- data/lib/sts/niso_sts/content_groups/styled_content_elements.rb +0 -93
- data/lib/sts/niso_sts/content_groups/table_group_attributes.rb +0 -62
- data/lib/sts/niso_sts/content_groups.rb +0 -8
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# 07: Incomplete Models Fix
|
|
2
|
+
|
|
3
|
+
**Priority**: MEDIUM
|
|
4
|
+
**Category**: Feature Gap
|
|
5
|
+
**Estimated Effort**: Medium
|
|
6
|
+
**Files Affected**: Existing model files
|
|
7
|
+
|
|
8
|
+
## Models Needing Completion
|
|
9
|
+
|
|
10
|
+
### 1. Permissions (Critical — IEC License Data Lost)
|
|
11
|
+
|
|
12
|
+
**Current**: `copyright_statement` is `:string`, `copyright_holder` is single string
|
|
13
|
+
**Needed**:
|
|
14
|
+
- `copyright_statement` → mixed content (supports `<inline-graphic>`, `<br/>`)
|
|
15
|
+
- `copyright_holder` → collection (multiple holders)
|
|
16
|
+
- Add `<license>` child element
|
|
17
|
+
- Add `<license-p>` child element (paragraphs within license)
|
|
18
|
+
- Add `<license_ref>` (ALI namespace, `ali:license_ref`)
|
|
19
|
+
- Add `<ext-link>` child
|
|
20
|
+
|
|
21
|
+
```ruby
|
|
22
|
+
# Current (WRONG)
|
|
23
|
+
attribute :copyright_statement, :string
|
|
24
|
+
attribute :copyright_holder, :string
|
|
25
|
+
|
|
26
|
+
# Fixed
|
|
27
|
+
attribute :copyright_statement, :string # keep as mixed_content
|
|
28
|
+
attribute :copyright_holder, :string, collection: true
|
|
29
|
+
attribute :license, License, collection: true
|
|
30
|
+
attribute :copyright_year, :string
|
|
31
|
+
attribute :copyright_month, :string
|
|
32
|
+
attribute :copyright_day, :string
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### 2. EditingInstruction (IEC Amendment Data)
|
|
36
|
+
|
|
37
|
+
**Current**: Missing `@content-type` and `<p>` child
|
|
38
|
+
**Needed**:
|
|
39
|
+
- `@content-type` attribute
|
|
40
|
+
- `<p>` as repeatable child
|
|
41
|
+
- Support for IEC amendment instructions
|
|
42
|
+
|
|
43
|
+
### 3. TermDisplay (IEC Term Content)
|
|
44
|
+
|
|
45
|
+
**Current**: Exists but missing critical children
|
|
46
|
+
**Needed**:
|
|
47
|
+
- `<term>` element support
|
|
48
|
+
- `<def>` element support
|
|
49
|
+
- `<list>` element support
|
|
50
|
+
- `<xref>` element support
|
|
51
|
+
- `<label>` element support
|
|
52
|
+
- `<term-display-string>` (NISO STS 1.2)
|
|
53
|
+
|
|
54
|
+
### 4. DefList
|
|
55
|
+
|
|
56
|
+
**Current**: Missing `@list-content` attribute
|
|
57
|
+
**Needed**:
|
|
58
|
+
- `@list-content` attribute (formula-key, figure-key, abbreviation-key)
|
|
59
|
+
- Proper relationship to DefItem children
|
|
60
|
+
|
|
61
|
+
### 5. Graphic
|
|
62
|
+
|
|
63
|
+
**Current**: Missing `@id`, `<label>`, `<caption>` children
|
|
64
|
+
**Needed**:
|
|
65
|
+
- `@id` attribute
|
|
66
|
+
- `<label>` child (for sub-figure captions)
|
|
67
|
+
- `<caption>` child
|
|
68
|
+
- `<alt-text>` child
|
|
69
|
+
|
|
70
|
+
### 6. Front (NisoSts)
|
|
71
|
+
|
|
72
|
+
**Current**: Missing `<std-doc-meta>` wiring
|
|
73
|
+
**Needed**:
|
|
74
|
+
- `<std-doc-meta>` child element
|
|
75
|
+
- Support for multiple `<std-meta>` (adoption documents)
|
|
76
|
+
- Proper metadata hierarchy
|
|
77
|
+
|
|
78
|
+
### 7. BoxedText
|
|
79
|
+
|
|
80
|
+
**Current**: Most valid children missing
|
|
81
|
+
**Needed**:
|
|
82
|
+
- `<table-wrap>`, `<fig>`, `<disp-formula>`, `<list>`
|
|
83
|
+
- `<p>`, `<caption>`, `<label>`
|
|
84
|
+
- `<sec>` (nested sections in boxed text)
|
|
85
|
+
- All emphasis and inline elements
|
|
86
|
+
|
|
87
|
+
### 8. DispFormula
|
|
88
|
+
|
|
89
|
+
**Current**: Missing `<caption>` (added in NISO STS 1.2)
|
|
90
|
+
**Needed**:
|
|
91
|
+
- `<caption>` child element
|
|
92
|
+
|
|
93
|
+
### 9. Source (Citation Source)
|
|
94
|
+
|
|
95
|
+
**Current**: Missing inline elements added in NISO STS 1.2
|
|
96
|
+
**Needed**:
|
|
97
|
+
- `<abbrev>`, `<alternatives>`, `<inline-graphic>`, `<private-char>`
|
|
98
|
+
- `<chem-struct>`, `<inline-formula>`, `<mml:math>`, `<tex-math>`
|
|
99
|
+
- `<named-content>`, `<styled-content>`, `<fn>`, `<target>`, `<xref>`
|
|
100
|
+
|
|
101
|
+
### 10. InlineFormula
|
|
102
|
+
|
|
103
|
+
**Current**: Missing accessibility elements (NISO STS 1.2)
|
|
104
|
+
**Needed**:
|
|
105
|
+
- `<alt-text>` child
|
|
106
|
+
- `<long-desc>` child
|
|
107
|
+
|
|
108
|
+
### 11. AwardGroup
|
|
109
|
+
|
|
110
|
+
**Current**: Missing new NISO STS 1.2 elements
|
|
111
|
+
**Needed**:
|
|
112
|
+
- `<award-name>` child
|
|
113
|
+
- `<award-desc>` child
|
|
114
|
+
|
|
115
|
+
### 12. DataTitle
|
|
116
|
+
|
|
117
|
+
**Current**: Missing `<inline-graphic>`, `<private-char>` (NISO STS 1.2)
|
|
118
|
+
**Needed**:
|
|
119
|
+
- `<inline-graphic>` child
|
|
120
|
+
- `<private-char>` child
|
|
121
|
+
|
|
122
|
+
### 13. Table Cells (td, th)
|
|
123
|
+
|
|
124
|
+
**Current**: Expanded to full XSD inside-cell content model
|
|
125
|
+
**Done**: disp-quote, speech, and statement are NOT in XSD inside-cell group.
|
|
126
|
+
Td/Th now include: disp-formula, disp-formula-group, element-citation, mixed-citation,
|
|
127
|
+
all emphasis elements, fig, fig-group, inline-graphic, private-char, normative-note,
|
|
128
|
+
normative-example, non-normative-example, email, ext-link, named-content,
|
|
129
|
+
alternatives, code, media, preformat, target, array
|
|
130
|
+
|
|
131
|
+
### 14. StringName Usage Expansion (NISO STS 1.2)
|
|
132
|
+
|
|
133
|
+
`<string-name>` added to:
|
|
134
|
+
- `<contrib>`, `<person-group>`, `<name-alternatives>`
|
|
135
|
+
- `<related-article>`, `<related-object>`
|
|
136
|
+
- `<mixed-citation>`, `<element-citation>`
|
|
137
|
+
|
|
138
|
+
### 15. SubjGroup and KwdGroup Expansion (NISO STS 1.2)
|
|
139
|
+
|
|
140
|
+
`<subj-group>` and `<kwd-group>` added to:
|
|
141
|
+
- `<app>`, `<boxed-text>`, `<sec>`, `<app-group>`
|
|
142
|
+
- `<chem-struct-wrap>`, `<disp-formula>`, `<disp-formula-group>`
|
|
143
|
+
- `<fig>`, `<fig-group>`, `<graphic>`, `<media>`, `<statement>`
|
|
144
|
+
- `<supplementary-material>`, `<table-wrap>`, `<table-wrap-group>`
|
|
145
|
+
|
|
146
|
+
## Implementation Order
|
|
147
|
+
|
|
148
|
+
1. Permissions — highest impact, IEC documents
|
|
149
|
+
2. Graphic — sub-figure support
|
|
150
|
+
3. TermDisplay — terminology sections
|
|
151
|
+
4. DefList — definition lists
|
|
152
|
+
5. EditingInstruction — amendments
|
|
153
|
+
6. Front/std-doc-meta — document structure
|
|
154
|
+
7. BoxedText — content completeness
|
|
155
|
+
8. NISO STS 1.2 additions (DispFormula, Source, InlineFormula, etc.)
|
|
156
|
+
|
|
157
|
+
## Dependencies
|
|
158
|
+
|
|
159
|
+
- `04-register-versioning.md` — version-specific additions
|
|
160
|
+
- `05-missing-elements.md` — some children are new elements
|
|
161
|
+
|
|
162
|
+
## TODO Checklist
|
|
163
|
+
|
|
164
|
+
- [x] Fix Permissions model (mixed content, collection, license)
|
|
165
|
+
- [x] Fix Graphic model (add @id, label, caption)
|
|
166
|
+
- [x] Fix TermDisplay model (add term, def, list, xref, label)
|
|
167
|
+
- [x] Fix DefList model (add @list-content, @originator, @continued-from, @prefix-word, @xml:lang, term_head, def_head, editing_instruction)
|
|
168
|
+
- [x] Fix EditingInstruction model (add @content-type, @rid, title, p)
|
|
169
|
+
- [x] Fix Front model (add std-doc-meta, reg-meta, nat-meta, ack, notes, toc)
|
|
170
|
+
- [x] Fix BoxedText model (add valid children)
|
|
171
|
+
- [x] Fix Back model (add index, toc, ack, notes, glossary, bio, label, title)
|
|
172
|
+
- [x] Add DispFormula caption (NISO STS 1.2) — expanded DisplayFormula with caption, originator, mixed content
|
|
173
|
+
- [x] Expand Source inline elements (NISO STS 1.2) — full inline element support with attributes
|
|
174
|
+
- [x] Add InlineFormula accessibility (NISO STS 1.2) — alt-text, long-desc, emphasis elements
|
|
175
|
+
- [x] Add AwardGroup elements (NISO STS 1.2) — rid, specific-use, xlink attrs, collection recipients
|
|
176
|
+
- [x] Add DataTitle elements (NISO STS 1.2) — full inline elements with attributes
|
|
177
|
+
- [x] Expand SubjGroup/KwdGroup locations (NISO STS 1.2) — SubjGroup recursive nesting, compound-subject
|
|
178
|
+
- [x] Expand table cell content (NISO STS 1.2) — full XSD inside-cell content model
|
|
179
|
+
- [x] Expand StringName usage (NISO STS 1.2) — added to name-alternatives
|
|
180
|
+
- [x] Run round-trip tests after each model fix
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
# 08: ISO/IEC Usage Profile Layer
|
|
2
|
+
|
|
3
|
+
**Priority**: MEDIUM
|
|
4
|
+
**Category**: Architecture
|
|
5
|
+
**Estimated Effort**: High
|
|
6
|
+
**Files Affected**: New module
|
|
7
|
+
|
|
8
|
+
## Context
|
|
9
|
+
|
|
10
|
+
ISO/IEC NISO STS is NOT a separate schema. It is a **usage profile** — a constraint layer on top of NISO STS that specifies:
|
|
11
|
+
- Which elements are required vs. optional
|
|
12
|
+
- Which attribute values are allowed
|
|
13
|
+
- How to use elements in ISO/IEC context
|
|
14
|
+
- Additional conventions (ID schemes, committee references, etc.)
|
|
15
|
+
|
|
16
|
+
This means we should NOT create separate model classes for ISO/IEC. Instead, we need a **validation/constraint layer**.
|
|
17
|
+
|
|
18
|
+
## Reference Sources
|
|
19
|
+
|
|
20
|
+
- `reference-docs/Guidelines for coding ed.2.1.pdf` — IEC/ISO Coding Guidelines ed.2.1
|
|
21
|
+
- ISO/IEC Directives Part 2 — document structure rules
|
|
22
|
+
- NISO STS Tag Library — element definitions
|
|
23
|
+
|
|
24
|
+
## Architecture: Validation Layer
|
|
25
|
+
|
|
26
|
+
### Option A: Dry-Validation Schema
|
|
27
|
+
|
|
28
|
+
```ruby
|
|
29
|
+
# lib/sts/profiles/iso_iec/validator.rb
|
|
30
|
+
module Sts
|
|
31
|
+
module Profiles
|
|
32
|
+
module IsoIec
|
|
33
|
+
class Validator
|
|
34
|
+
def initialize(register = :niso_sts_v1_0)
|
|
35
|
+
@register = register
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def validate(document)
|
|
39
|
+
errors = []
|
|
40
|
+
errors.concat(validate_structure(document))
|
|
41
|
+
errors.concat(validate_ids(document))
|
|
42
|
+
errors.concat(validate_metadata(document))
|
|
43
|
+
errors.concat(validate_references(document))
|
|
44
|
+
errors
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def validate_structure(doc)
|
|
50
|
+
errors = []
|
|
51
|
+
# ISO/IEC requires <front>, <body> in <standard>
|
|
52
|
+
unless doc.front
|
|
53
|
+
errors << "ISO/IEC profile requires <front> in <standard>"
|
|
54
|
+
end
|
|
55
|
+
unless doc.body
|
|
56
|
+
errors << "ISO/IEC profile requires <body> in <standard>"
|
|
57
|
+
end
|
|
58
|
+
errors
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def validate_ids(doc)
|
|
62
|
+
# ISO/IEC: all <sec> must have @id matching pattern sec_N
|
|
63
|
+
# ISO/IEC: all <fig> must have @id matching pattern fig_N
|
|
64
|
+
# etc.
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def validate_metadata(doc)
|
|
68
|
+
# ISO/IEC: <std-meta> must have <std-ident> with specific children
|
|
69
|
+
# ISO/IEC: committee reference format
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def validate_references(doc)
|
|
73
|
+
# ISO/IEC: <std> references must have dated/undated format
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Option B: Profile Module with Class Methods
|
|
82
|
+
|
|
83
|
+
```ruby
|
|
84
|
+
# lib/sts/profiles/iso_iec/constraints.rb
|
|
85
|
+
module Sts
|
|
86
|
+
module Profiles
|
|
87
|
+
module IsoIec
|
|
88
|
+
module Constraints
|
|
89
|
+
# Elements that MUST have @id
|
|
90
|
+
REQUIRED_ID_ELEMENTS = %i[
|
|
91
|
+
sec app fig table-wrap disp-formula
|
|
92
|
+
ref-list ref p term-sec
|
|
93
|
+
].freeze
|
|
94
|
+
|
|
95
|
+
# Required children of <std-meta>
|
|
96
|
+
REQUIRED_STD_META_CHILDREN = %i[
|
|
97
|
+
std-ident doc-ref release-version
|
|
98
|
+
].freeze
|
|
99
|
+
|
|
100
|
+
# Allowed values for @std-id-type
|
|
101
|
+
STD_ID_TYPES = %w[
|
|
102
|
+
dated undated isbn doi
|
|
103
|
+
].freeze
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Option C: Custom lutaml-model Validation
|
|
111
|
+
|
|
112
|
+
Extend lutaml-model's validation to support profile-specific rules:
|
|
113
|
+
|
|
114
|
+
```ruby
|
|
115
|
+
# This would require lutaml-model changes — consider for future
|
|
116
|
+
class Sts::NisoSts::Standard
|
|
117
|
+
validates :front, presence: { message: "required by ISO/IEC profile" },
|
|
118
|
+
if: -> { iso_iec_profile? }
|
|
119
|
+
end
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Recommended Approach
|
|
123
|
+
|
|
124
|
+
Start with **Option B** (constraint constants) as a documentation layer, then build **Option A** (validator) on top. This avoids coupling validation to the model classes themselves.
|
|
125
|
+
|
|
126
|
+
## Profile Differences to Capture
|
|
127
|
+
|
|
128
|
+
### ISO Documents
|
|
129
|
+
- `<std-ident>` with `<originator>ISO</originator>`
|
|
130
|
+
- Committee reference format: `TC/SC/WG`
|
|
131
|
+
- Stage codes per ISO harmonized system
|
|
132
|
+
|
|
133
|
+
### IEC Documents
|
|
134
|
+
- `<std-ident>` with `<originator>IEC</originator>`
|
|
135
|
+
- Different committee reference format
|
|
136
|
+
- Copyright statement with inline-graphic
|
|
137
|
+
|
|
138
|
+
### National Adoptions
|
|
139
|
+
- `<std-doc-meta>` wrapper for national metadata
|
|
140
|
+
- `<adopted-from>` reference to international standard
|
|
141
|
+
|
|
142
|
+
## Files to Create
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
lib/sts/profiles/
|
|
146
|
+
├── iso_iec/
|
|
147
|
+
│ ├── constraints.rb # Constraint constants
|
|
148
|
+
│ ├── validator.rb # Validation logic
|
|
149
|
+
│ ├── id_scheme.rb # ID naming conventions
|
|
150
|
+
│ └── metadata_rules.rb # Metadata requirements
|
|
151
|
+
└── profiles.rb # Entry point
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Dependencies
|
|
155
|
+
|
|
156
|
+
- `04-register-versioning.md` — needs to know which schema version to validate against
|
|
157
|
+
|
|
158
|
+
## TODO Checklist
|
|
159
|
+
|
|
160
|
+
- [x] Extract ISO/IEC constraints from Guidelines ed.2.1
|
|
161
|
+
- [ ] Extract IEC-specific constraints
|
|
162
|
+
- [x] Design validator architecture
|
|
163
|
+
- [x] Implement constraint constants module
|
|
164
|
+
- [x] Implement basic structural validator
|
|
165
|
+
- [ ] Implement ID scheme validator
|
|
166
|
+
- [x] Implement metadata validator (originator, doc-type validation)
|
|
167
|
+
- [ ] Add profile selection to parsing API
|
|
168
|
+
- [x] Write specs for validation
|
|
169
|
+
- [ ] Document usage
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# 09: Autoload and Require Cleanup
|
|
2
|
+
|
|
3
|
+
**Priority**: LOW
|
|
4
|
+
**Category**: Cleanup
|
|
5
|
+
**Estimated Effort**: Medium
|
|
6
|
+
**Files Affected**: `lib/sts.rb`, `lib/sts/niso_sts.rb`, `lib/sts/iso_sts.rb`
|
|
7
|
+
|
|
8
|
+
## Current Issues
|
|
9
|
+
|
|
10
|
+
### 1. Autoload Alphabetization
|
|
11
|
+
|
|
12
|
+
The autoload entries in `lib/sts/niso_sts.rb` should be alphabetically ordered. Check for any out-of-order entries when adding new elements.
|
|
13
|
+
|
|
14
|
+
### 2. Moxml Monkey-Patch
|
|
15
|
+
|
|
16
|
+
`lib/sts.rb` contains a monkey-patch on Moxml:
|
|
17
|
+
|
|
18
|
+
```ruby
|
|
19
|
+
Moxml::Adapter::Nokogiri.singleton_class.alias_method(:_orig_children, :children)
|
|
20
|
+
Moxml::Adapter::Nokogiri.define_singleton_method(:children, &:children)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This patches an external library's behavior. If Moxml fixes the underlying issue, this will mask it or cause conflicts.
|
|
24
|
+
|
|
25
|
+
**Action**: Add a comment explaining WHY this patch exists (the Nokogiri adapter bug it works around) and a link to the upstream issue if tracked.
|
|
26
|
+
|
|
27
|
+
### 3. Orphaned/Unused Files
|
|
28
|
+
|
|
29
|
+
After refactoring (TODOs 01-04), check for:
|
|
30
|
+
- Files in `lib/sts/niso_sts/` that are no longer referenced
|
|
31
|
+
- Files in `lib/sts/iso_sts/` that are no longer referenced
|
|
32
|
+
- Unused requires
|
|
33
|
+
|
|
34
|
+
### 4. Require Order Dependencies
|
|
35
|
+
|
|
36
|
+
Some files may have implicit load-order dependencies (class A references class B, but B hasn't been loaded yet). The autoload system should handle this, but verify.
|
|
37
|
+
|
|
38
|
+
### 5. Missing Requires for Cross-Namespace Types
|
|
39
|
+
|
|
40
|
+
After fixing namespace coupling (TODO 03), ensure all cross-namespace references are replaced with proper requires or base type references.
|
|
41
|
+
|
|
42
|
+
## File Structure After Cleanup
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
lib/
|
|
46
|
+
├── sts.rb # Top-level: requires, Moxml patch (documented)
|
|
47
|
+
├── sts/
|
|
48
|
+
│ ├── namespaces.rb # Namespace constants
|
|
49
|
+
│ ├── mathml.rb # MathML wrapper (after TODO 01 fix)
|
|
50
|
+
│ ├── mathml/ # MathML-specific types (if needed)
|
|
51
|
+
│ ├── base/ # Shared base types (after TODO 03)
|
|
52
|
+
│ │ ├── text/ # Bold, Italic, Sub, Sup
|
|
53
|
+
│ │ ├── struct/ # Section, Paragraph, List
|
|
54
|
+
│ │ ├── meta/ # Title, Label, Caption
|
|
55
|
+
│ │ └── refs/ # Xref, BiblioRef
|
|
56
|
+
│ ├── iso_sts/ # ISOSTS namespace
|
|
57
|
+
│ │ ├── iso_sts.rb # Autoload declarations
|
|
58
|
+
│ │ ├── v1_1/ # ISOSTS v1.1 classes
|
|
59
|
+
│ │ └── content_groups/ # Content group helpers
|
|
60
|
+
│ ├── niso_sts/ # NISO STS namespace
|
|
61
|
+
│ │ ├── niso_sts.rb # Autoload declarations
|
|
62
|
+
│ │ ├── v1_0/ # NISO STS 1.0 classes
|
|
63
|
+
│ │ ├── v1_2/ # NISO STS 1.2 classes
|
|
64
|
+
│ │ ├── content_groups/ # Content group helpers
|
|
65
|
+
│ │ ├── mml_content/ # MathML content elements
|
|
66
|
+
│ │ └── xi.rb, ali.rb # Namespace modules
|
|
67
|
+
│ ├── tbx_iso_tml/ # TBX namespace
|
|
68
|
+
│ │ ├── tbx_iso_tml.rb # Autoload declarations
|
|
69
|
+
│ │ └── ...
|
|
70
|
+
│ ├── content_groups/ # Shared content group helpers
|
|
71
|
+
│ │ └── helpers.rb # After TODO 02 fix
|
|
72
|
+
│ └── profiles/ # ISO/IEC validation layer (after TODO 08)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Dependencies
|
|
76
|
+
|
|
77
|
+
- `01-mathml-delegation.md` — MathML wrapper location
|
|
78
|
+
- `03-namespace-coupling.md` — base types directory structure
|
|
79
|
+
- `04-register-versioning.md` — versioned subdirectories
|
|
80
|
+
|
|
81
|
+
## TODO Checklist
|
|
82
|
+
|
|
83
|
+
- [x] Document Moxml monkey-patch with rationale (removed entirely — upstream fix in moxml aa58888)
|
|
84
|
+
- [x] Audit autoload entries for alphabetical order
|
|
85
|
+
- [x] After refactoring: remove orphaned files (deleted content_groups dead code)
|
|
86
|
+
- [ ] After refactoring: verify no implicit load-order deps
|
|
87
|
+
- [x] After refactoring: clean up unused requires
|
|
88
|
+
- [x] Verify `bundle exec rake` passes cleanly
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
# 10: Test Coverage Improvements
|
|
2
|
+
|
|
3
|
+
**Priority**: ONGOING
|
|
4
|
+
**Category**: Quality
|
|
5
|
+
**Estimated Effort**: Ongoing
|
|
6
|
+
**Files Affected**: `spec/`
|
|
7
|
+
|
|
8
|
+
## Current Test Structure
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
spec/
|
|
12
|
+
├── spec_helper.rb
|
|
13
|
+
├── sts_spec.rb # Core parsing/serialization tests
|
|
14
|
+
├── round_trip/
|
|
15
|
+
│ └── reference_docs_spec.rb # Round-trip tests with ISO doc fixtures
|
|
16
|
+
└── fixtures/
|
|
17
|
+
└── *.xml # Test XML documents
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Test Categories Needed
|
|
21
|
+
|
|
22
|
+
### 1. Unit Tests Per Element
|
|
23
|
+
|
|
24
|
+
Each model class should have unit tests covering:
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
# spec/sts/niso_sts/paragraph_spec.rb
|
|
28
|
+
RSpec.describe Sts::NisoSts::Paragraph do
|
|
29
|
+
describe "XML parsing" do
|
|
30
|
+
it "parses <p> with text content"
|
|
31
|
+
it "parses <p> with mixed content"
|
|
32
|
+
it "parses <p> with @id attribute"
|
|
33
|
+
it "parses <p> with @content-type attribute"
|
|
34
|
+
it "parses <p> with @xml:lang attribute"
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe "XML serialization" do
|
|
38
|
+
it "round-trips text content"
|
|
39
|
+
it "round-trips mixed content"
|
|
40
|
+
it "round-trips all attributes"
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Priority elements for unit tests:
|
|
46
|
+
- `Standard`, `Front`, `Body`, `Back` — structural
|
|
47
|
+
- `Section`, `Paragraph` — high frequency
|
|
48
|
+
- `Fig`, `TableWrap`, `Graphic` — media
|
|
49
|
+
- `Ref`, `RefList`, `Xref` — references
|
|
50
|
+
- `TermSec`, `TermDisplay` — terminology
|
|
51
|
+
- `Permissions` — after model fix
|
|
52
|
+
|
|
53
|
+
### 2. Schema Validation Tests
|
|
54
|
+
|
|
55
|
+
```ruby
|
|
56
|
+
# spec/schema_validation_spec.rb
|
|
57
|
+
RSpec.describe "Schema compliance" do
|
|
58
|
+
context "NISO STS 1.0" do
|
|
59
|
+
it "validates against NISO STS Extended XSD"
|
|
60
|
+
it "validates against NISO STS Interchange XSD"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
context "ISOSTS v1.1" do
|
|
64
|
+
it "validates against ISOSTS DTD"
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
context "NISO STS 1.2" do
|
|
68
|
+
it "validates against NISO STS 1.2 XSD"
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 3. Version-Specific Tests (After TODO 04)
|
|
74
|
+
|
|
75
|
+
```ruby
|
|
76
|
+
# spec/versioning/register_spec.rb
|
|
77
|
+
RSpec.describe "Schema versioning" do
|
|
78
|
+
it "loads ISOSTS v1.1 register independently"
|
|
79
|
+
it "loads NISO STS 1.0 register independently"
|
|
80
|
+
it "loads NISO STS 1.2 register independently"
|
|
81
|
+
it "prevents cross-register contamination"
|
|
82
|
+
end
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 4. Profile Validation Tests (After TODO 08)
|
|
86
|
+
|
|
87
|
+
```ruby
|
|
88
|
+
# spec/profiles/iso_iec_validator_spec.rb
|
|
89
|
+
RSpec.describe Sts::Profiles::IsoIec::Validator do
|
|
90
|
+
it "rejects document without <front>"
|
|
91
|
+
it "accepts valid ISO document"
|
|
92
|
+
it "validates ID scheme conventions"
|
|
93
|
+
it "validates metadata requirements"
|
|
94
|
+
end
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 5. Anti-Pattern Regression Tests
|
|
98
|
+
|
|
99
|
+
```ruby
|
|
100
|
+
# spec/anti_patterns_spec.rb
|
|
101
|
+
RSpec.describe "No anti-patterns in codebase" do
|
|
102
|
+
it "contains no method_missing definitions"
|
|
103
|
+
it "contains no respond_to_missing definitions"
|
|
104
|
+
it "contains no send calls"
|
|
105
|
+
it "contains no Object.const_get calls"
|
|
106
|
+
end
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 6. Performance Tests
|
|
110
|
+
|
|
111
|
+
```ruby
|
|
112
|
+
# spec/performance_spec.rb
|
|
113
|
+
RSpec.describe "Performance" do
|
|
114
|
+
it "parses large document within time budget"
|
|
115
|
+
it "serialization doesn't regress from baseline"
|
|
116
|
+
end
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Test Fixtures Needed
|
|
120
|
+
|
|
121
|
+
| Fixture | Purpose | Priority |
|
|
122
|
+
|---------|---------|----------|
|
|
123
|
+
| Simple standard (minimal) | Basic round-trip | HIGH |
|
|
124
|
+
| IEC standard with license | Permissions testing | HIGH |
|
|
125
|
+
| Document with index | Index hierarchy | HIGH |
|
|
126
|
+
| Document with TOC | TOC hierarchy | HIGH |
|
|
127
|
+
| Document with code blocks | Code element testing | HIGH |
|
|
128
|
+
| Document with MathML | Formula testing | MEDIUM |
|
|
129
|
+
| Document with TBX | Terminology testing | MEDIUM |
|
|
130
|
+
| Document with OASIS tables | CALS table testing | LOW |
|
|
131
|
+
| Multi-language document | xml:lang testing | MEDIUM |
|
|
132
|
+
| Amendment/corrigendum | Amendment structure | MEDIUM |
|
|
133
|
+
| National adoption | std-doc-meta testing | LOW |
|
|
134
|
+
|
|
135
|
+
## Coverage Metrics
|
|
136
|
+
|
|
137
|
+
Track coverage with:
|
|
138
|
+
```bash
|
|
139
|
+
COVERAGE=true bundle exec rspec
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Target: >80% line coverage for `lib/sts/`
|
|
143
|
+
|
|
144
|
+
## Dependencies
|
|
145
|
+
|
|
146
|
+
All other TODOs feed into this — add tests as features are implemented.
|
|
147
|
+
|
|
148
|
+
## TODO Checklist
|
|
149
|
+
|
|
150
|
+
- [x] Add anti-pattern regression test
|
|
151
|
+
- [x] Add unit tests for structural elements (Standard, Front, Body, Back)
|
|
152
|
+
- [x] Add unit tests for Section and Paragraph
|
|
153
|
+
- [x] Add unit tests for Fig, TableWrap, Graphic
|
|
154
|
+
- [x] Add unit tests for Ref, RefList, Xref
|
|
155
|
+
- [x] Add unit tests for TermSec, TermDisplay
|
|
156
|
+
- [x] Add unit tests for Permissions (after model fix)
|
|
157
|
+
- [x] Add unit tests for new elements (ProcessingMeta, Code, Legend, InlineMedia, TableWrapGroup, DefHead)
|
|
158
|
+
- [x] Add unit tests for attribute additions (Title, Caption, Label, ExtLink, AwardId, DefItem)
|
|
159
|
+
- [x] Add unit tests for Index and TOC hierarchy elements
|
|
160
|
+
- [ ] Add schema validation tests
|
|
161
|
+
- [ ] Add versioning tests (after TODO 04)
|
|
162
|
+
- [x] Add profile validation tests (after TODO 08)
|
|
163
|
+
- [x] Set up coverage tracking
|
|
164
|
+
- [x] Achieve >80% line coverage target (achieved 99.8%)
|