Skip to content

Commit

Permalink
https://github.com/metanorma/metanorma/issues/367
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Oct 13, 2024
1 parent c637213 commit b941561
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 12 deletions.
1 change: 1 addition & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem "metanorma-standoc", git: "https://github.com/metanorma/metanorma-standoc", branch: "feature/ext-flavor"
13 changes: 13 additions & 0 deletions lib/metanorma/ribose/biblio-standoc.rng
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
from other documents in the same doctype</a:documentation>
</ref>
</optional>
<ref name="flavor">
<a:documentation>Flavour of Metanorma used to process this document</a:documentation>
</ref>
<optional>
<ref name="editorialgroup">
<a:documentation>Groups associated with the production of the standards document, typically within
Expand Down Expand Up @@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
<define name="DocumentSubtype">
<text/>
</define>
<define name="flavor">
<element name="flavor">
<ref name="MetanormaFlavor"/>
</element>
</define>
<define name="MetanormaFlavor">
<a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
However we prefer not to hardcode it, given ongoing extension.</a:documentation>
<text/>
</define>
<define name="editorialgroup">
<a:documentation>A group associated with the production of the standards document, typically within
a standards definition organization</a:documentation>
Expand Down
31 changes: 19 additions & 12 deletions lib/metanorma/ribose/biblio.rng
Original file line number Diff line number Diff line change
Expand Up @@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
<define name="bdate">
<a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
<element name="date">
<attribute name="type">
<a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
<choice>
<ref name="BibliographicDateType"/>
<text/>
</choice>
</attribute>
<optional>
<attribute name="text">
<a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
</attribute>
</optional>
<ref name="bDateAttributes"/>
<optional>
<choice>
<group>
Expand All @@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
</optional>
</element>
</define>
<define name="bDateAttributes">
<attribute name="type">
<a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
<choice>
<ref name="BibliographicDateType"/>
<text/>
</choice>
</attribute>
<optional>
<attribute name="text">
<a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
</attribute>
</optional>
</define>
<define name="docidentifier">
<a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
<element name="docidentifier">
Expand Down Expand Up @@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
<value>hasAnnotation</value>
<value>draftOf</value>
<value>hasDraft</value>
<value>preliminaryDraftOf</value>
<value>hasPreliminaryDraft</value>
<value>revisionDraftOf</value>
<value>hasRevisionDraft</value>
<value>editionOf</value>
<value>hasEdition</value>
<value>updates</value>
Expand Down
1 change: 1 addition & 0 deletions lib/metanorma/ribose/relaton-ribose.rng
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<optional>
<ref name="docsubtype"/>
</optional>
<ref name="flavor"/>
<ref name="editorialgroup"/>
<zeroOrMore>
<ref name="ics"/>
Expand Down
5 changes: 5 additions & 0 deletions spec/metanorma/base_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
</copyright>
<ext>
<doctype>standard</doctype>
<flavor>ribose</flavor>
<editorialgroup>
<committee type="A">TC</committee>
<committee type="A1">TC1</committee>
Expand Down Expand Up @@ -226,6 +227,7 @@
</copyright>
<ext>
<doctype abbreviation="Code">code</doctype>
<flavor>ribose</flavor>
</ext>
</bibdata>
<metanorma-extension>
Expand Down Expand Up @@ -337,6 +339,7 @@
</copyright>
<ext>
<doctype>standard</doctype>
<flavor>ribose</flavor>
</ext>
</bibdata>
OUTPUT
Expand Down Expand Up @@ -402,6 +405,7 @@
</copyright>
<ext>
<doctype>standard</doctype>
<flavor>ribose</flavor>
</ext>
</bibdata>
OUTPUT
Expand Down Expand Up @@ -467,6 +471,7 @@
</copyright>
<ext>
<doctype>standard</doctype>
<flavor>ribose</flavor>
</ext>
</bibdata>
OUTPUT
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ def boilerplate(xmldoc)
</copyright>
<ext>
<doctype>standard</doctype>
<flavor>ribose</flavor>
</ext>
</bibdata>
<metanorma-extension>
Expand Down

0 comments on commit b941561

Please sign in to comment.