metanorma-generic 3.0.0 → 3.0.2
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/lib/isodoc/generic/html/htmlstyle.scss +1 -1
- data/lib/metanorma/generic/basicdoc.rng +85 -67
- data/lib/metanorma/generic/biblio-standoc.rng +37 -7
- data/lib/metanorma/generic/biblio.rng +30 -18
- data/lib/metanorma/generic/converter.rb +12 -20
- data/lib/metanorma/generic/generic.rng +0 -6
- data/lib/metanorma/generic/isodoc.rng +149 -88
- data/lib/metanorma/generic/reqt.rng +7 -6
- data/lib/metanorma/generic/version.rb +1 -1
- data/metanorma-generic.gemspec +3 -2
- metadata +24 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c10147fe8de1d7fdb1b0ffcd4de3a10c1b960be041369472b856b11450191223
|
4
|
+
data.tar.gz: bf0445889f6cd89d423ed952c3662f7c91d85789b79680d94321072dd710a21e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d376ef3e2f1af9837fe800a2d62663878177c6dcaa427fb54b71da2e4967b5e727f426e35c9134b3b753b023f628931419de33360a669e97aaade5f083e055e8
|
7
|
+
data.tar.gz: 9f6f2182063b04321a35d466ca1bc5d230b3a0420e4168419e4ded44d13e222bbce2550beda6214025bb8f019a2c545be15338317f65e13fcd2f55881b8969ff
|
@@ -382,33 +382,7 @@ in a document (e.g. sourcecode annotations)</a:documentation>
|
|
382
382
|
<a:documentation>Block intended to capture reviewer comments about some text in the document</a:documentation>
|
383
383
|
<element name="review">
|
384
384
|
<ref name="RequiredId"/>
|
385
|
-
<
|
386
|
-
<a:documentation>The party who has offered the comment</a:documentation>
|
387
|
-
</attribute>
|
388
|
-
<optional>
|
389
|
-
<attribute name="type">
|
390
|
-
<a:documentation>The type of reviewer comment</a:documentation>
|
391
|
-
</attribute>
|
392
|
-
</optional>
|
393
|
-
<optional>
|
394
|
-
<attribute name="date">
|
395
|
-
<a:documentation>The date when the comment was made</a:documentation>
|
396
|
-
<data type="dateTime"/>
|
397
|
-
</attribute>
|
398
|
-
</optional>
|
399
|
-
<optional>
|
400
|
-
<attribute name="from">
|
401
|
-
<a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
|
402
|
-
If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
|
403
|
-
<data type="IDREF"/>
|
404
|
-
</attribute>
|
405
|
-
</optional>
|
406
|
-
<optional>
|
407
|
-
<attribute name="to">
|
408
|
-
<a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
|
409
|
-
<data type="IDREF"/>
|
410
|
-
</attribute>
|
411
|
-
</optional>
|
385
|
+
<ref name="ReviewAttributes"/>
|
412
386
|
<oneOrMore>
|
413
387
|
<ref name="paragraph">
|
414
388
|
<a:documentation>Reviewer comments content</a:documentation>
|
@@ -416,6 +390,35 @@ If not provided, the comment applies in the vicinity of the place it has been in
|
|
416
390
|
</oneOrMore>
|
417
391
|
</element>
|
418
392
|
</define>
|
393
|
+
<define name="ReviewAttributes">
|
394
|
+
<attribute name="reviewer">
|
395
|
+
<a:documentation>The party who has offered the comment</a:documentation>
|
396
|
+
</attribute>
|
397
|
+
<optional>
|
398
|
+
<attribute name="type">
|
399
|
+
<a:documentation>The type of reviewer comment</a:documentation>
|
400
|
+
</attribute>
|
401
|
+
</optional>
|
402
|
+
<optional>
|
403
|
+
<attribute name="date">
|
404
|
+
<a:documentation>The date when the comment was made</a:documentation>
|
405
|
+
<data type="dateTime"/>
|
406
|
+
</attribute>
|
407
|
+
</optional>
|
408
|
+
<optional>
|
409
|
+
<attribute name="from">
|
410
|
+
<a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
|
411
|
+
If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
|
412
|
+
<data type="IDREF"/>
|
413
|
+
</attribute>
|
414
|
+
</optional>
|
415
|
+
<optional>
|
416
|
+
<attribute name="to">
|
417
|
+
<a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
|
418
|
+
<data type="IDREF"/>
|
419
|
+
</attribute>
|
420
|
+
</optional>
|
421
|
+
</define>
|
419
422
|
<define name="NumberingAttributes">
|
420
423
|
<optional>
|
421
424
|
<attribute name="unnumbered">
|
@@ -599,17 +602,9 @@ It is included for convenience, in case processing the citation to extract the a
|
|
599
602
|
<a:documentation>The caption of the block</a:documentation>
|
600
603
|
</ref>
|
601
604
|
</optional>
|
602
|
-
<
|
603
|
-
<
|
604
|
-
|
605
|
-
<a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
|
606
|
-
(The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
|
607
|
-
</text>
|
608
|
-
<ref name="callout">
|
609
|
-
<a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
|
610
|
-
</ref>
|
611
|
-
</choice>
|
612
|
-
</oneOrMore>
|
605
|
+
<ref name="sourcecodebody">
|
606
|
+
<a:documentation>The sourcecode content</a:documentation>
|
607
|
+
</ref>
|
613
608
|
<zeroOrMore>
|
614
609
|
<ref name="annotation">
|
615
610
|
<a:documentation>Annotations to the source code; each annotation consists of zero or more paragraphs,
|
@@ -628,17 +623,9 @@ and is intended to be referenced by a callout within the source code</a:document
|
|
628
623
|
<a:documentation>The caption of the block</a:documentation>
|
629
624
|
</ref>
|
630
625
|
</optional>
|
631
|
-
<
|
632
|
-
<
|
633
|
-
|
634
|
-
<a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
|
635
|
-
(The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
|
636
|
-
</text>
|
637
|
-
<ref name="callout">
|
638
|
-
<a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
|
639
|
-
</ref>
|
640
|
-
</choice>
|
641
|
-
</oneOrMore>
|
626
|
+
<ref name="sourcecodebody">
|
627
|
+
<a:documentation>The sourcecode content</a:documentation>
|
628
|
+
</ref>
|
642
629
|
<zeroOrMore>
|
643
630
|
<ref name="annotation">
|
644
631
|
<a:documentation>Annotations to the source code; each annotation consists of zero or more paragraphs,
|
@@ -651,6 +638,20 @@ and is intended to be referenced by a callout within the source code</a:document
|
|
651
638
|
</ref>
|
652
639
|
</zeroOrMore>
|
653
640
|
</define>
|
641
|
+
<define name="sourcecodebody">
|
642
|
+
<a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
|
643
|
+
(The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
|
644
|
+
<element name="body">
|
645
|
+
<oneOrMore>
|
646
|
+
<choice>
|
647
|
+
<text/>
|
648
|
+
<ref name="callout">
|
649
|
+
<a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
|
650
|
+
</ref>
|
651
|
+
</choice>
|
652
|
+
</oneOrMore>
|
653
|
+
</element>
|
654
|
+
</define>
|
654
655
|
<define name="pre">
|
655
656
|
<a:documentation>Pre-formatted block. Wrapper for text to be rendered with fixed-width typeface, and preserving spaces including line breaks.
|
656
657
|
They are intended for a restricted number of functions, most typically ASCII Art (which is still in prominent use in some
|
@@ -859,6 +860,7 @@ in case the table cannot be rendered accessibly (HTML 5)</a:documentation>
|
|
859
860
|
<define name="tr">
|
860
861
|
<a:documentation>Sequence of cells to be displayed as a row in a table</a:documentation>
|
861
862
|
<element name="tr">
|
863
|
+
<ref name="TrAttributes"/>
|
862
864
|
<oneOrMore>
|
863
865
|
<choice>
|
864
866
|
<ref name="td">
|
@@ -871,6 +873,9 @@ in case the table cannot be rendered accessibly (HTML 5)</a:documentation>
|
|
871
873
|
</oneOrMore>
|
872
874
|
</element>
|
873
875
|
</define>
|
876
|
+
<define name="TrAttributes">
|
877
|
+
<empty/>
|
878
|
+
</define>
|
874
879
|
<define name="tr-no-id">
|
875
880
|
<a:documentation>Sequence of cells to be displayed as a row in a table: optional ID attributes recursively (for use in Relaton, metadata)</a:documentation>
|
876
881
|
<element name="tr">
|
@@ -1672,33 +1677,46 @@ which can be bookmarks as well as block or section references</a:documentation>
|
|
1672
1677
|
</optional>
|
1673
1678
|
</define>
|
1674
1679
|
<define name="XrefBody">
|
1675
|
-
<
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
+
<a:documentation>The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`)</a:documentation>
|
1681
|
+
<optional>
|
1682
|
+
<element name="display-text">
|
1683
|
+
<oneOrMore>
|
1684
|
+
<ref name="PureTextElement"/>
|
1685
|
+
</oneOrMore>
|
1686
|
+
</element>
|
1687
|
+
</optional>
|
1680
1688
|
</define>
|
1681
1689
|
<define name="ErefBody">
|
1682
|
-
<
|
1683
|
-
<
|
1684
|
-
<
|
1685
|
-
|
1686
|
-
|
1690
|
+
<optional>
|
1691
|
+
<element name="display-text">
|
1692
|
+
<oneOrMore>
|
1693
|
+
<ref name="PureTextElement">
|
1694
|
+
<a:documentation>The textual content of the element. The `text` is what we wish to show the link as (e.g., the "content" of `<xx>my link text</xx>`)</a:documentation>
|
1695
|
+
</ref>
|
1696
|
+
</oneOrMore>
|
1697
|
+
</element>
|
1698
|
+
</optional>
|
1687
1699
|
</define>
|
1688
1700
|
<define name="fn">
|
1689
1701
|
<a:documentation>Inline reference to a paragraph or paragraphs, appearing as a footnote.
|
1690
1702
|
The target of a footnote is the location it is embedded in within the text</a:documentation>
|
1691
1703
|
<element name="fn">
|
1692
|
-
<
|
1693
|
-
|
1694
|
-
</attribute>
|
1695
|
-
<oneOrMore>
|
1696
|
-
<ref name="paragraph">
|
1697
|
-
<a:documentation>The content of the footnote</a:documentation>
|
1698
|
-
</ref>
|
1699
|
-
</oneOrMore>
|
1704
|
+
<ref name="FnAttributes"/>
|
1705
|
+
<ref name="FnBody"/>
|
1700
1706
|
</element>
|
1701
1707
|
</define>
|
1708
|
+
<define name="FnBody">
|
1709
|
+
<oneOrMore>
|
1710
|
+
<ref name="paragraph">
|
1711
|
+
<a:documentation>The content of the footnote</a:documentation>
|
1712
|
+
</ref>
|
1713
|
+
</oneOrMore>
|
1714
|
+
</define>
|
1715
|
+
<define name="FnAttributes">
|
1716
|
+
<attribute name="reference">
|
1717
|
+
<a:documentation>The number of the footnote, used to identify it visually</a:documentation>
|
1718
|
+
</attribute>
|
1719
|
+
</define>
|
1702
1720
|
<define name="callout">
|
1703
1721
|
<a:documentation>Inline reference to a paragraph or paragraphs, appearing as annotation of source code</a:documentation>
|
1704
1722
|
<element name="callout">
|
@@ -1,13 +1,14 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0">
|
3
|
-
<!--
|
4
|
-
Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
|
5
|
-
of relaton
|
6
|
-
|
7
|
-
Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
|
8
|
-
(SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
|
9
|
-
-->
|
10
3
|
<include href="biblio.rng">
|
4
|
+
<!-- ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix -->
|
5
|
+
<!--
|
6
|
+
Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
|
7
|
+
of relaton
|
8
|
+
|
9
|
+
Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
|
10
|
+
(SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
|
11
|
+
-->
|
11
12
|
<define name="BibData">
|
12
13
|
<a:documentation>The bibliographic description of a standardisation document</a:documentation>
|
13
14
|
<ref name="StandardBibliographicItem"/>
|
@@ -91,6 +92,9 @@ a standards definition organization</a:documentation>
|
|
91
92
|
<a:documentation>Representation of the identifier for the standardisation document, giving its individual semantic components</a:documentation>
|
92
93
|
</ref>
|
93
94
|
</zeroOrMore>
|
95
|
+
<ref name="DocumentImages">
|
96
|
+
<a:documentation>Coverpage and other images to be rendered with document</a:documentation>
|
97
|
+
</ref>
|
94
98
|
</define>
|
95
99
|
<define name="doctype">
|
96
100
|
<a:documentation>Classification of the standardisation document</a:documentation>
|
@@ -268,6 +272,32 @@ and not those document components</a:documentation>
|
|
268
272
|
</optional>
|
269
273
|
</element>
|
270
274
|
</define>
|
275
|
+
<define name="DocumentImages">
|
276
|
+
<zeroOrMore>
|
277
|
+
<element name="coverpage-image">
|
278
|
+
<a:documentation>Images to be displayed on the coverpage of the document</a:documentation>
|
279
|
+
<ref name="image-no-id"/>
|
280
|
+
</element>
|
281
|
+
</zeroOrMore>
|
282
|
+
<zeroOrMore>
|
283
|
+
<element name="innercoverpage-image">
|
284
|
+
<a:documentation>Images to be displayed on the inner coverpage of the document</a:documentation>
|
285
|
+
<ref name="image-no-id"/>
|
286
|
+
</element>
|
287
|
+
</zeroOrMore>
|
288
|
+
<zeroOrMore>
|
289
|
+
<element name="tocside-image">
|
290
|
+
<a:documentation>Images to be displayed on the Table of Contents page of the document</a:documentation>
|
291
|
+
<ref name="image-no-id"/>
|
292
|
+
</element>
|
293
|
+
</zeroOrMore>
|
294
|
+
<zeroOrMore>
|
295
|
+
<element name="backpage-image">
|
296
|
+
<a:documentation>Images to be displayed on the backpage of the document</a:documentation>
|
297
|
+
<ref name="image-no-id"/>
|
298
|
+
</element>
|
299
|
+
</zeroOrMore>
|
300
|
+
</define>
|
271
301
|
<define name="StandardBibliographicItem">
|
272
302
|
<ref name="BibliographicItem"/>
|
273
303
|
<zeroOrMore>
|
@@ -1,23 +1,25 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!--
|
3
|
-
instantiations of this grammar may replace leaf strings
|
4
|
-
with more elaborated types; e.g. title (text) replaced with
|
5
|
-
title-main, title-intro, title-part; type replaced with
|
6
|
-
enum.
|
7
|
-
|
8
|
-
some renaming at leaf nodes is permissible
|
9
|
-
|
10
|
-
obligations can change both from optional to mandatory,
|
11
|
-
and from mandatory to optional; optional elements may
|
12
|
-
be omitted; freely positioned alternatives may be replaced
|
13
|
-
with strict ordering
|
14
|
-
|
15
|
-
DO NOT introduce a namespace here. We do not want a distinct namespace
|
16
|
-
for these elements, and a distinct namespace for any grammar inheriting
|
17
|
-
these elements; we just want one namespace for any child grammars
|
18
|
-
of this.
|
19
|
-
-->
|
20
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
+
<!--
|
4
|
+
ALERT: we cannot have comments on root element, as they intervene with https://github.com/metanorma/metanorma/issues/437 fix
|
5
|
+
|
6
|
+
Instantiations of this grammar may replace leaf strings
|
7
|
+
with more elaborated types; e.g. title (text) replaced with
|
8
|
+
title-main, title-intro, title-part; type replaced with
|
9
|
+
enum.
|
10
|
+
|
11
|
+
Some renaming at leaf nodes is permissible
|
12
|
+
|
13
|
+
Obligations can change both from optional to mandatory,
|
14
|
+
and from mandatory to optional; optional elements may
|
15
|
+
be omitted; freely positioned alternatives may be replaced
|
16
|
+
with strict ordering
|
17
|
+
|
18
|
+
DO NOT introduce a namespace here. We do not want a distinct namespace
|
19
|
+
for these elements, and a distinct namespace for any grammar inheriting
|
20
|
+
these elements; we just want one namespace for any child grammars
|
21
|
+
of this.
|
22
|
+
-->
|
21
23
|
<!--
|
22
24
|
https://www.myintervals.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
|
23
25
|
iso8601date = xsd:string { pattern = "([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?" }
|
@@ -1241,6 +1243,11 @@ Refer to `BibliographicItem` for definitions</a:documentation>
|
|
1241
1243
|
</define>
|
1242
1244
|
<define name="formattedref">
|
1243
1245
|
<element name="formattedref">
|
1246
|
+
<optional>
|
1247
|
+
<attribute name="format">
|
1248
|
+
<a:documentation>format of formatted reference; Metanorma assumes references are formatted as Metanorma XML</a:documentation>
|
1249
|
+
</attribute>
|
1250
|
+
</optional>
|
1244
1251
|
<oneOrMore>
|
1245
1252
|
<ref name="TextElement"/>
|
1246
1253
|
</oneOrMore>
|
@@ -1812,6 +1819,11 @@ May be used to differentiate rendering of notes in bibliographies</a:documentati
|
|
1812
1819
|
<a:documentation>Abstract of bibliographic item</a:documentation>
|
1813
1820
|
<element name="abstract">
|
1814
1821
|
<ref name="LocalizedStringAttributes"/>
|
1822
|
+
<optional>
|
1823
|
+
<attribute name="format">
|
1824
|
+
<a:documentation>What format the formatted abstract is in. In Metanorma, assumed to be Metanorma XML</a:documentation>
|
1825
|
+
</attribute>
|
1826
|
+
</optional>
|
1815
1827
|
<choice>
|
1816
1828
|
<oneOrMore>
|
1817
1829
|
<ref name="BasicBlockNoId">
|
@@ -8,22 +8,11 @@ require "pathname"
|
|
8
8
|
module Metanorma
|
9
9
|
module Generic
|
10
10
|
class Converter < Standoc::Converter
|
11
|
-
XML_ROOT_TAG = "generic-standard".freeze
|
12
|
-
XML_NAMESPACE = "https://www.metanorma.org/ns/generic".freeze
|
13
|
-
|
14
11
|
register_for "generic"
|
15
12
|
|
16
|
-
#def xml_root_tag
|
17
|
-
#configuration.xml_root_tag || XML_ROOT_TAG
|
18
|
-
#end
|
19
|
-
#
|
20
|
-
#def xml_namespace
|
21
|
-
#configuration.document_namespace || XML_NAMESPACE
|
22
|
-
#end
|
23
|
-
|
24
13
|
def baselocation(loc)
|
25
14
|
loc.nil? and return nil
|
26
|
-
|
15
|
+
loc
|
27
16
|
end
|
28
17
|
|
29
18
|
def docidentifier_cleanup(xmldoc)
|
@@ -46,7 +35,7 @@ module Metanorma
|
|
46
35
|
end
|
47
36
|
type = @default_doctype || configuration.doctypes.keys[0]
|
48
37
|
if !configuration.doctypes.key?(d)
|
49
|
-
|
38
|
+
node.attr("doctype") && node.attr("doctype") != "article" and # factory default
|
50
39
|
@log.add("Document Attributes", nil,
|
51
40
|
"#{d} is not a legal document type: reverting to '#{type}'")
|
52
41
|
d = type
|
@@ -98,11 +87,13 @@ module Metanorma
|
|
98
87
|
nil, false, "#{@filename}.pdf")
|
99
88
|
end
|
100
89
|
|
101
|
-
def
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
90
|
+
def schema_location
|
91
|
+
baselocation(configuration.validate_rng_file) ||
|
92
|
+
File.join(File.dirname(__FILE__), "generic.rng")
|
93
|
+
end
|
94
|
+
|
95
|
+
def schema_file
|
96
|
+
configuration.validate_rng_file || "generic.rng"
|
106
97
|
end
|
107
98
|
|
108
99
|
def content_validate(doc)
|
@@ -118,7 +109,7 @@ module Metanorma
|
|
118
109
|
def stage_validate(xmldoc)
|
119
110
|
stages = configuration.stage_abbreviations&.keys || return
|
120
111
|
stages.empty? and return
|
121
|
-
stage = xmldoc
|
112
|
+
stage = xmldoc.at("//bibdata/status/stage")&.text
|
122
113
|
stages.include? stage or
|
123
114
|
@log.add("Document Attributes", nil,
|
124
115
|
"#{stage} is not a recognised status")
|
@@ -150,7 +141,8 @@ module Metanorma
|
|
150
141
|
def presentation_xml_converter(node)
|
151
142
|
IsoDoc::Generic::PresentationXMLConvert
|
152
143
|
.new(html_extract_attributes(node)
|
153
|
-
.merge(output_formats: ::Metanorma::Generic::Processor.new
|
144
|
+
.merge(output_formats: ::Metanorma::Generic::Processor.new
|
145
|
+
.output_formats))
|
154
146
|
end
|
155
147
|
|
156
148
|
alias_method :pdf_converter, :html_converter
|
@@ -1,11 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar ns='https://www.metanorma.org/ns/standoc' xmlns="http://relaxng.org/ns/structure/1.0">
|
3
|
-
<!--
|
4
|
-
VERSION v1.2.1
|
5
|
-
Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
|
6
|
-
we cannot have a new default namespace: we will end up with a grammar with two different
|
7
|
-
namespaces, one for isostandard and one for csand additions. And we do not want that.
|
8
|
-
-->
|
9
3
|
<include href="biblio-standoc.rng"/>
|
10
4
|
<include href="isodoc.rng">
|
11
5
|
<define name="standard-document">
|
@@ -1,24 +1,27 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!--
|
3
|
-
instantiations of this grammar may replace leaf strings
|
4
|
-
with more elaborated types; e.g. title (text) replaced with
|
5
|
-
title-main, title-intro, title-part; type replaced with
|
6
|
-
enum.
|
7
|
-
|
8
|
-
some renaming at leaf nodes is permissible
|
9
|
-
|
10
|
-
obligations can change both from optional to mandatory,
|
11
|
-
and from mandatory to optional; optional elements may
|
12
|
-
be omitted; freely positioned alternatives may be replaced
|
13
|
-
with strict ordering
|
14
|
-
|
15
|
-
DO NOT introduce a namespace here. We do not want a distinct namespace
|
16
|
-
for these elements, and a distinct namespace for any grammar inheriting
|
17
|
-
these elements; we just want one namespace for any child grammars
|
18
|
-
of this.
|
19
|
-
-->
|
20
|
-
<!-- VERSION v2.0.0 -->
|
21
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
+
<!-- VERSION v2.0.3 -->
|
4
|
+
|
5
|
+
<!--
|
6
|
+
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
7
|
+
|
8
|
+
instantiations of this grammar may replace leaf strings
|
9
|
+
with more elaborated types; e.g. title (text) replaced with
|
10
|
+
title-main, title-intro, title-part; type replaced with
|
11
|
+
enum.
|
12
|
+
|
13
|
+
some renaming at leaf nodes is permissible
|
14
|
+
|
15
|
+
obligations can change both from optional to mandatory,
|
16
|
+
and from mandatory to optional; optional elements may
|
17
|
+
be omitted; freely positioned alternatives may be replaced
|
18
|
+
with strict ordering
|
19
|
+
|
20
|
+
DO NOT introduce a namespace here. We do not want a distinct namespace
|
21
|
+
for these elements, and a distinct namespace for any grammar inheriting
|
22
|
+
these elements; we just want one namespace for any child grammars
|
23
|
+
of this.
|
24
|
+
-->
|
22
25
|
<include href="reqt.rng"/>
|
23
26
|
<include href="basicdoc.rng">
|
24
27
|
<define name="amend">
|
@@ -245,23 +248,9 @@
|
|
245
248
|
<a:documentation>The caption of the block</a:documentation>
|
246
249
|
</ref>
|
247
250
|
</optional>
|
248
|
-
<
|
249
|
-
<
|
250
|
-
|
251
|
-
<a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
|
252
|
-
(The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
|
253
|
-
</text>
|
254
|
-
<ref name="callout">
|
255
|
-
<a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
|
256
|
-
</ref>
|
257
|
-
<ref name="xref">
|
258
|
-
<a:documentation>Hyperlink of code segment to another part of the document</a:documentation>
|
259
|
-
</ref>
|
260
|
-
<ref name="eref">
|
261
|
-
<a:documentation>Hyperlink of code segment to external bibliographic resource</a:documentation>
|
262
|
-
</ref>
|
263
|
-
</choice>
|
264
|
-
</oneOrMore>
|
251
|
+
<ref name="sourcecodebody">
|
252
|
+
<a:documentation>The sourcecode content</a:documentation>
|
253
|
+
</ref>
|
265
254
|
<zeroOrMore>
|
266
255
|
<ref name="annotation">
|
267
256
|
<a:documentation>Annotations to the source code; each annotation consists of zero or more paragraphs,
|
@@ -277,6 +266,26 @@ and is intended to be referenced by a callout within the source code</a:document
|
|
277
266
|
<a:documentation>A source for the block</a:documentation>
|
278
267
|
</ref>
|
279
268
|
</define>
|
269
|
+
<define name="sourcecodebody">
|
270
|
+
<a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
|
271
|
+
(The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
|
272
|
+
<element name="body">
|
273
|
+
<oneOrMore>
|
274
|
+
<choice>
|
275
|
+
<text/>
|
276
|
+
<ref name="callout">
|
277
|
+
<a:documentation>Zero or more cross-references; these are intended to be embedded within the content string, and link to annotations</a:documentation>
|
278
|
+
</ref>
|
279
|
+
<ref name="xref">
|
280
|
+
<a:documentation>Hyperlink of code segment to another part of the document</a:documentation>
|
281
|
+
</ref>
|
282
|
+
<ref name="eref">
|
283
|
+
<a:documentation>Hyperlink of code segment to external bibliographic resource</a:documentation>
|
284
|
+
</ref>
|
285
|
+
</choice>
|
286
|
+
</oneOrMore>
|
287
|
+
</element>
|
288
|
+
</define>
|
280
289
|
<define name="sections">
|
281
290
|
<element name="sections">
|
282
291
|
<oneOrMore>
|
@@ -408,6 +417,13 @@ normative or informative references, some split references into sections organiz
|
|
408
417
|
</oneOrMore>
|
409
418
|
</choice>
|
410
419
|
</define>
|
420
|
+
<define name="TrAttributes">
|
421
|
+
<optional>
|
422
|
+
<attribute name="style">
|
423
|
+
<a:documentation>CSS style: only background-color supported</a:documentation>
|
424
|
+
</attribute>
|
425
|
+
</optional>
|
426
|
+
</define>
|
411
427
|
<define name="table-note">
|
412
428
|
<element name="note">
|
413
429
|
<ref name="OptionalId"/>
|
@@ -470,6 +486,22 @@ gives an explicit page orientation</a:documentation>
|
|
470
486
|
</define>
|
471
487
|
</include>
|
472
488
|
<!-- end overrides -->
|
489
|
+
<define name="FnAttributes" combine="interleave">
|
490
|
+
<optional>
|
491
|
+
<attribute name="hiddenref">
|
492
|
+
<a:documentation>If true, number the footnote as normal, but suppress display of the footnote reference in the document body.
|
493
|
+
This is done if the footnote reference is already presented in some other form, e.g. within a figure image.</a:documentation>
|
494
|
+
<data type="boolean"/>
|
495
|
+
</attribute>
|
496
|
+
</optional>
|
497
|
+
</define>
|
498
|
+
<define name="TdAttributes" combine="interleave">
|
499
|
+
<optional>
|
500
|
+
<attribute name="style">
|
501
|
+
<a:documentation>CSS style: only background-color supported</a:documentation>
|
502
|
+
</attribute>
|
503
|
+
</optional>
|
504
|
+
</define>
|
473
505
|
<define name="NumberingAttributes" combine="interleave">
|
474
506
|
<optional>
|
475
507
|
<attribute name="number">
|
@@ -648,6 +680,13 @@ titlecase, or lowercase</a:documentation>
|
|
648
680
|
</attribute>
|
649
681
|
</optional>
|
650
682
|
</define>
|
683
|
+
<define name="Basic-Section-Attributes" combine="interleave">
|
684
|
+
<optional>
|
685
|
+
<attribute name="obligation">
|
686
|
+
<ref name="ObligationType"/>
|
687
|
+
</attribute>
|
688
|
+
</optional>
|
689
|
+
</define>
|
651
690
|
<define name="ObligationType">
|
652
691
|
<a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
|
653
692
|
<choice>
|
@@ -1162,13 +1201,6 @@ numbers</a:documentation>
|
|
1162
1201
|
</attribute>
|
1163
1202
|
</optional>
|
1164
1203
|
</define>
|
1165
|
-
<define name="Basic-Section-Attributes" combine="interleave">
|
1166
|
-
<optional>
|
1167
|
-
<attribute name="obligation">
|
1168
|
-
<ref name="ObligationType"/>
|
1169
|
-
</attribute>
|
1170
|
-
</optional>
|
1171
|
-
</define>
|
1172
1204
|
<define name="reference-clause">
|
1173
1205
|
<a:documentation>References clause with recursive nesting</a:documentation>
|
1174
1206
|
<element name="clause">
|
@@ -1209,7 +1241,7 @@ numbers</a:documentation>
|
|
1209
1241
|
</choice>
|
1210
1242
|
</attribute>
|
1211
1243
|
<attribute name="flavor">
|
1212
|
-
<a:documentation>Metanorma flavor, indicating SDO whose
|
1244
|
+
<a:documentation>Metanorma flavor, indicating SDO whose requirements the realisation aligns to</a:documentation>
|
1213
1245
|
</attribute>
|
1214
1246
|
</define>
|
1215
1247
|
<define name="standard-document">
|
@@ -1219,6 +1251,11 @@ numbers</a:documentation>
|
|
1219
1251
|
<ref name="bibdata">
|
1220
1252
|
<a:documentation>Bibliographic description of the document itself, expressed in the Relaton model</a:documentation>
|
1221
1253
|
</ref>
|
1254
|
+
<zeroOrMore>
|
1255
|
+
<ref name="termdocsource">
|
1256
|
+
<a:documentation>Source for term definitions in the document</a:documentation>
|
1257
|
+
</ref>
|
1258
|
+
</zeroOrMore>
|
1222
1259
|
<optional>
|
1223
1260
|
<ref name="misccontainer">
|
1224
1261
|
<a:documentation>Extension point for extraneous elements that need to be added to standards document as data</a:documentation>
|
@@ -1229,36 +1266,44 @@ numbers</a:documentation>
|
|
1229
1266
|
<a:documentation>Front matter that is repeated at the start of documents issued from an SDO, with content not specific to the document</a:documentation>
|
1230
1267
|
</ref>
|
1231
1268
|
</optional>
|
1269
|
+
<ref name="DocumentBody"/>
|
1232
1270
|
<optional>
|
1233
|
-
<ref name="
|
1234
|
-
<a:documentation>
|
1235
|
-
</ref>
|
1236
|
-
</optional>
|
1237
|
-
<ref name="sections">
|
1238
|
-
<a:documentation>Main body of document</a:documentation>
|
1239
|
-
</ref>
|
1240
|
-
<zeroOrMore>
|
1241
|
-
<ref name="annex">
|
1242
|
-
<a:documentation>Annex sections</a:documentation>
|
1243
|
-
</ref>
|
1244
|
-
</zeroOrMore>
|
1245
|
-
<optional>
|
1246
|
-
<ref name="bibliography">
|
1247
|
-
<a:documentation>Bibliographic sections</a:documentation>
|
1248
|
-
</ref>
|
1249
|
-
</optional>
|
1250
|
-
<zeroOrMore>
|
1251
|
-
<ref name="indexsect">
|
1252
|
-
<a:documentation>Index of the document</a:documentation>
|
1253
|
-
</ref>
|
1254
|
-
</zeroOrMore>
|
1255
|
-
<optional>
|
1256
|
-
<ref name="colophon">
|
1257
|
-
<a:documentation>Colophon or postface material</a:documentation>
|
1271
|
+
<ref name="review-container">
|
1272
|
+
<a:documentation>Annotations to the document</a:documentation>
|
1258
1273
|
</ref>
|
1259
1274
|
</optional>
|
1260
1275
|
</element>
|
1261
1276
|
</define>
|
1277
|
+
<define name="DocumentBody">
|
1278
|
+
<optional>
|
1279
|
+
<ref name="preface">
|
1280
|
+
<a:documentation>Prefatory sections</a:documentation>
|
1281
|
+
</ref>
|
1282
|
+
</optional>
|
1283
|
+
<ref name="sections">
|
1284
|
+
<a:documentation>Main body of document</a:documentation>
|
1285
|
+
</ref>
|
1286
|
+
<zeroOrMore>
|
1287
|
+
<ref name="annex">
|
1288
|
+
<a:documentation>Annex sections</a:documentation>
|
1289
|
+
</ref>
|
1290
|
+
</zeroOrMore>
|
1291
|
+
<optional>
|
1292
|
+
<ref name="bibliography">
|
1293
|
+
<a:documentation>Bibliographic sections</a:documentation>
|
1294
|
+
</ref>
|
1295
|
+
</optional>
|
1296
|
+
<zeroOrMore>
|
1297
|
+
<ref name="indexsect">
|
1298
|
+
<a:documentation>Index of the document</a:documentation>
|
1299
|
+
</ref>
|
1300
|
+
</zeroOrMore>
|
1301
|
+
<optional>
|
1302
|
+
<ref name="colophon">
|
1303
|
+
<a:documentation>Colophon or postface material</a:documentation>
|
1304
|
+
</ref>
|
1305
|
+
</optional>
|
1306
|
+
</define>
|
1262
1307
|
<define name="misccontainer">
|
1263
1308
|
<a:documentation>Elements added to metanorma-extension are open-ended, and constitute source data</a:documentation>
|
1264
1309
|
<element name="metanorma-extension">
|
@@ -1267,6 +1312,13 @@ numbers</a:documentation>
|
|
1267
1312
|
</oneOrMore>
|
1268
1313
|
</element>
|
1269
1314
|
</define>
|
1315
|
+
<define name="review-container">
|
1316
|
+
<element name="review-container">
|
1317
|
+
<oneOrMore>
|
1318
|
+
<ref name="review"/>
|
1319
|
+
</oneOrMore>
|
1320
|
+
</element>
|
1321
|
+
</define>
|
1270
1322
|
<define name="preface">
|
1271
1323
|
<element name="preface">
|
1272
1324
|
<oneOrMore>
|
@@ -1566,9 +1618,7 @@ used in document amendments</a:documentation>
|
|
1566
1618
|
<define name="term">
|
1567
1619
|
<a:documentation>Terminology entry with its definition</a:documentation>
|
1568
1620
|
<element name="term">
|
1569
|
-
<ref name="
|
1570
|
-
<ref name="LocalizedStringAttributes"/>
|
1571
|
-
<ref name="BlockAttributes"/>
|
1621
|
+
<ref name="TermAttributes"/>
|
1572
1622
|
<oneOrMore>
|
1573
1623
|
<ref name="preferred">
|
1574
1624
|
<a:documentation>One or more names under which the term being defined is canonically known</a:documentation>
|
@@ -1620,6 +1670,11 @@ used in document amendments</a:documentation>
|
|
1620
1670
|
</ref>
|
1621
1671
|
</element>
|
1622
1672
|
</define>
|
1673
|
+
<define name="TermAttributes">
|
1674
|
+
<ref name="OptionalId"/>
|
1675
|
+
<ref name="LocalizedStringAttributes"/>
|
1676
|
+
<ref name="BlockAttributes"/>
|
1677
|
+
</define>
|
1623
1678
|
<define name="preferred">
|
1624
1679
|
<element name="preferred">
|
1625
1680
|
<ref name="Designation"/>
|
@@ -2281,26 +2336,32 @@ links within an SVG file, so that the SVG file can hyperlink to anchors within t
|
|
2281
2336
|
</element>
|
2282
2337
|
</define>
|
2283
2338
|
<define name="ul_li">
|
2284
|
-
<a:documentation>
|
2339
|
+
<a:documentation>Unordered list item for standards documents</a:documentation>
|
2285
2340
|
<element name="li">
|
2286
2341
|
<ref name="OptionalId"/>
|
2287
|
-
<
|
2288
|
-
|
2289
|
-
<a:documentation>Include a checkbox for the list item</a:documentation>
|
2290
|
-
<data type="boolean"/>
|
2291
|
-
</attribute>
|
2292
|
-
</optional>
|
2293
|
-
<optional>
|
2294
|
-
<attribute name="checkedcheckbox">
|
2295
|
-
<a:documentation>Check the checkbox for the list item</a:documentation>
|
2296
|
-
<data type="boolean"/>
|
2297
|
-
</attribute>
|
2298
|
-
</optional>
|
2299
|
-
<oneOrMore>
|
2300
|
-
<ref name="BasicBlock"/>
|
2301
|
-
</oneOrMore>
|
2342
|
+
<ref name="UlLiAttributes"/>
|
2343
|
+
<ref name="UlLiBody"/>
|
2302
2344
|
</element>
|
2303
2345
|
</define>
|
2346
|
+
<define name="UlLiBody">
|
2347
|
+
<oneOrMore>
|
2348
|
+
<ref name="BasicBlock"/>
|
2349
|
+
</oneOrMore>
|
2350
|
+
</define>
|
2351
|
+
<define name="UlLiAttributes">
|
2352
|
+
<optional>
|
2353
|
+
<attribute name="uncheckedcheckbox">
|
2354
|
+
<a:documentation>Include a checkbox for the list item</a:documentation>
|
2355
|
+
<data type="boolean"/>
|
2356
|
+
</attribute>
|
2357
|
+
</optional>
|
2358
|
+
<optional>
|
2359
|
+
<attribute name="checkedcheckbox">
|
2360
|
+
<a:documentation>Check the checkbox for the list item</a:documentation>
|
2361
|
+
<data type="boolean"/>
|
2362
|
+
</attribute>
|
2363
|
+
</optional>
|
2364
|
+
</define>
|
2304
2365
|
<define name="floating-title">
|
2305
2366
|
<a:documentation>A floating title, outside of the clause hierarchy of the document</a:documentation>
|
2306
2367
|
<element name="floating-title">
|
@@ -1,5 +1,11 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
+
<define name="requirement">
|
4
|
+
<element name="requirement">
|
5
|
+
<ref name="RequirementType"/>
|
6
|
+
</element>
|
7
|
+
</define>
|
8
|
+
<!-- ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437 -->
|
3
9
|
<!--
|
4
10
|
Presupposes isodoc.rnc, is included in it
|
5
11
|
include "isodoc.rnc" { }
|
@@ -7,14 +13,9 @@
|
|
7
13
|
This is the Metanorma default provisions model; it is overridden by other provisions models,
|
8
14
|
such as Modspec
|
9
15
|
-->
|
10
|
-
<define name="
|
16
|
+
<define name="recommendation">
|
11
17
|
<a:documentation>Specification of an attribute of a subject that is required.
|
12
18
|
NOTE: A requirement can contain other requirements</a:documentation>
|
13
|
-
<element name="requirement">
|
14
|
-
<ref name="RequirementType"/>
|
15
|
-
</element>
|
16
|
-
</define>
|
17
|
-
<define name="recommendation">
|
18
19
|
<a:documentation>Specification of an attribute of a subject that is recommended</a:documentation>
|
19
20
|
<element name="recommendation">
|
20
21
|
<ref name="RequirementType"/>
|
data/metanorma-generic.gemspec
CHANGED
@@ -35,8 +35,9 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
36
36
|
spec.add_development_dependency "rake", "~> 13.0"
|
37
37
|
spec.add_development_dependency "rspec", "~> 3.6"
|
38
|
-
spec.add_development_dependency "rubocop", "~> 1
|
39
|
-
|
38
|
+
spec.add_development_dependency "rubocop", "~> 1"
|
39
|
+
spec.add_development_dependency "rubocop-performance"
|
40
|
+
spec.add_development_dependency "sassc-embedded", "~> 1"
|
40
41
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
41
42
|
spec.add_development_dependency "timecop", "~> 0.9"
|
42
43
|
spec.add_development_dependency "xml-c14n"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-generic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -114,28 +114,42 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1
|
117
|
+
version: '1'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1
|
124
|
+
version: '1'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: rubocop-performance
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: sassc-embedded
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '1'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
152
|
+
version: '1'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: simplecov
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -255,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
269
|
- !ruby/object:Gem::Version
|
256
270
|
version: '0'
|
257
271
|
requirements: []
|
258
|
-
rubygems_version: 3.
|
272
|
+
rubygems_version: 3.5.22
|
259
273
|
signing_key:
|
260
274
|
specification_version: 4
|
261
275
|
summary: Metanorma template gem for customisation.
|