metanorma-nist 1.2.10 → 1.2.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36ac09c63540d7f54f30b736c97745c39540395609ccc8ec87633b598c22fb1d
4
- data.tar.gz: 5ea3cbb59d1771302c79eddc3bde4c59143c48e3bc4ed21849f5a76eb770004a
3
+ metadata.gz: 1c3bf5464e9a11cd435a402b9c0e6e574440135069641c783096caf05da339af
4
+ data.tar.gz: 6dabdea47dc0a2a9640c64be07de34b11d48519d0101a2481004de2b609d7685
5
5
  SHA512:
6
- metadata.gz: d3922390af3fe4aba54d16c0fa110adfbeb1e037f553244c645f6c403daaec8c3eb7e3db3da5fa18f2b8f558c20eb8a11af67ed7ad9fba46f017a45a524cf9c9
7
- data.tar.gz: 1cc37283a2d664adabfce277a46c5024a97d201a132a46f6fe2a5aa3134a18529a2efc5d56f506252676f07496931310b7e15673bebb20d9a25f919318ee6403
6
+ metadata.gz: bb8bcdd5670fd5916e4a63907c41bd55e5c238be4ae82943f9466742a8669ba5ccf6e7e2a18667179b14c2d06ef5a99776e0e131f6055e2811ac9db63489a9af
7
+ data.tar.gz: fe3132a7a04a41672bd73196e1538f97f5307c675aa4a86a4c54f5e640f8deee555a34521212722002d1bd46b740a2797a29f482c16c3b708b6fffae7677614b
@@ -4,7 +4,7 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master, main ]
7
+ branches: [ master, main ]
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
@@ -16,47 +16,27 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.6', '2.5', '2.4' ]
19
+ ruby: [ '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  include:
23
- - ruby: '2.7'
23
+ - ruby: '3.0'
24
24
  os: 'ubuntu-latest'
25
25
  experimental: true
26
- - ruby: '2.7'
26
+ - ruby: '3.0'
27
27
  os: 'windows-latest'
28
28
  experimental: true
29
- - ruby: '2.7'
29
+ - ruby: '3.0'
30
30
  os: 'macos-latest'
31
31
  experimental: true
32
32
  steps:
33
- - uses: actions/checkout@master
33
+ - uses: actions/checkout@v2
34
+ with:
35
+ submodules: true
34
36
 
35
37
  - uses: ruby/setup-ruby@v1
36
38
  with:
37
39
  ruby-version: ${{ matrix.ruby }}
38
-
39
- - uses: actions/cache@v2
40
- with:
41
- path: vendor/bundle
42
- key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
- restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
-
45
- - run: bundle config set path 'vendor/bundle'
46
-
47
- - run: bundle install --jobs 4 --retry 3
40
+ bundler-cache: true
48
41
 
49
42
  - run: bundle exec rake
50
-
51
- tests-passed:
52
- needs: rake
53
- runs-on: ubuntu-latest
54
- steps:
55
- - name: Trigger tests passed event
56
- uses: Sibz/github-status-action@v1
57
- with:
58
- authToken: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
59
- context: 'tests-passed-successfully'
60
- description: 'Tests passed successfully'
61
- state: 'success'
62
- sha: ${{ github.event.pull_request.head.sha || github.sha }}
data/.gitignore ADDED
@@ -0,0 +1 @@
1
+ .rubocop-https--*
data/.rubocop.yml CHANGED
@@ -1,10 +1,14 @@
1
1
  # This project follows the Ribose OSS style guide.
2
2
  # https://github.com/riboseinc/oss-guides
3
3
  # All project-specific additions and overrides should be specified in this file.
4
-
5
4
  inherit_from:
6
5
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
+
7
+ # local repo-specific modifications
8
+
7
9
  AllCops:
8
- TargetRubyVersion: 2.3
10
+ DisplayCopNames: false
11
+ StyleGuideCopsOnly: false
12
+ TargetRubyVersion: 2.4
9
13
  Rails:
10
14
  Enabled: true
data/README.adoc CHANGED
@@ -660,6 +660,9 @@ which will be converted to the tag `nistvariable` in Metanorma XML:
660
660
  ----
661
661
  ---
662
662
 
663
+ In the rest of Metanorma, `{{{ ... }}}` is used to introduce AsciiDoc markup into sourcecode.
664
+ In the NIST flavour, this is done through `{{{{ ... }}}}`
665
+
663
666
  === Errata
664
667
 
665
668
  Errata are marked up as an Asciidoctor table with role attribute `[.errata]`.
@@ -729,9 +729,11 @@
729
729
  </define>
730
730
  <define name="index">
731
731
  <element name="index">
732
- <attribute name="to">
733
- <data type="IDREF"/>
734
- </attribute>
732
+ <optional>
733
+ <attribute name="to">
734
+ <data type="IDREF"/>
735
+ </attribute>
736
+ </optional>
735
737
  <element name="primary">
736
738
  <oneOrMore>
737
739
  <ref name="PureTextElement"/>
@@ -124,7 +124,7 @@
124
124
  <value>application/tei+xml</value>
125
125
  <value>text/x-asciidoc</value>
126
126
  <value>text/markdown</value>
127
- <value>application/x-isodoc+xml</value>
127
+ <value>application/x-metanorma+xml</value>
128
128
  <text/>
129
129
  </choice>
130
130
  </attribute>
@@ -452,6 +452,7 @@
452
452
  <attribute name="type">
453
453
  <choice>
454
454
  <value>isni</value>
455
+ <value>orcid</value>
455
456
  <value>uri</value>
456
457
  </choice>
457
458
  </attribute>
@@ -461,10 +462,7 @@
461
462
  <define name="org-identifier">
462
463
  <element name="identifier">
463
464
  <attribute name="type">
464
- <choice>
465
- <value>orcid</value>
466
- <value>uri</value>
467
- </choice>
465
+ <data type="string" datatypeLibrary=""/>
468
466
  </attribute>
469
467
  <text/>
470
468
  </element>
@@ -1106,7 +1104,7 @@
1106
1104
  <value>complementOf</value>
1107
1105
  <value>obsoletes</value>
1108
1106
  <value>obsoletedBy</value>
1109
- <value>cited</value>
1107
+ <value>cites</value>
1110
1108
  <value>isCitedIn</value>
1111
1109
  </choice>
1112
1110
  </define>
@@ -96,8 +96,8 @@ module Asciidoctor
96
96
 
97
97
  def boilerplate_isodoc(xmldoc)
98
98
  conv = super
99
- conv.i18n.set(:nist_division, @nistdivision)
100
- conv.i18n.set(:nist_division_address, @nistdivisionaddress)
99
+ conv.i18n.set("nist_division", @nistdivision)
100
+ conv.i18n.set("nist_division_address", @nistdivisionaddress)
101
101
  conv
102
102
  end
103
103
 
@@ -16,10 +16,11 @@ module Asciidoctor
16
16
  xmldoc.xpath("//sourcecode").each do |x|
17
17
  x.traverse do |n|
18
18
  next unless n.text?
19
- n.replace(Nokogiri::XML::NodeSet.new(n.document,
20
- nistvariable_insert(n)))
19
+ next unless /\{\{\{/.match(n.text)
20
+ n.replace(Nokogiri::XML::NodeSet.new(n.document, nistvariable_insert(n)))
21
21
  end
22
22
  end
23
+ super
23
24
  end
24
25
 
25
26
  # skip annex/terms/terms, which is empty node
@@ -62,7 +62,7 @@ module Asciidoctor
62
62
  end
63
63
 
64
64
  def olist(node)
65
- id = Asciidoctor::Standoc::Utils::anchor_or_uuid(node)
65
+ id = Metanorma::Utils::anchor_or_uuid(node)
66
66
  noko do |xml|
67
67
  xml.ol **attr_code(id: id, class: node.attr("class")) do |xml_ol|
68
68
  node.items.each { |item| li(xml_ol, item) }
@@ -72,7 +72,7 @@ module Asciidoctor
72
72
 
73
73
  def glossary(node)
74
74
  noko do |xml|
75
- xml.dl **{id: Asciidoctor::Standoc::Utils::anchor_or_uuid(node),
75
+ xml.dl **{id: Metanorma::Utils::anchor_or_uuid(node),
76
76
  type: "glossary"} do |xml_dl|
77
77
  node.items.each do |terms, dd|
78
78
  dt(terms, xml_dl)
@@ -105,6 +105,8 @@ module Asciidoctor
105
105
  @series = node.attr("series")
106
106
  @cswp = %w(nist-cswp nist-csts).include?(@series)
107
107
  super
108
+ @sourcecode_markup_start = node.attr("sourcecode-markup-start") || "{{{{"
109
+ @sourcecode_markup_end = node.attr("sourcecode-markup-end") || "}}}}"
108
110
  end
109
111
 
110
112
  def outputs(node, ret)
@@ -21,7 +21,7 @@ module Asciidoctor
21
21
  end
22
22
 
23
23
  def asciidoc_sub(text)
24
- Asciidoctor::Standoc::Utils::asciidoc_sub(text)
24
+ Metanorma::Utils::asciidoc_sub(text)
25
25
  end
26
26
 
27
27
  def title_subtitle(node, t, at)
@@ -102,7 +102,7 @@
102
102
  </attribute>
103
103
  </optional>
104
104
  <oneOrMore>
105
- <ref name="li"/>
105
+ <ref name="ul_li"/>
106
106
  </oneOrMore>
107
107
  <zeroOrMore>
108
108
  <ref name="note"/>
@@ -253,6 +253,9 @@
253
253
  <data type="boolean"/>
254
254
  </attribute>
255
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
256
259
  <optional>
257
260
  <ref name="colgroup"/>
258
261
  </optional>
@@ -786,6 +789,9 @@
786
789
  <attribute name="width"/>
787
790
  </element>
788
791
  </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
789
795
  <define name="TextElement" combine="choice">
790
796
  <ref name="concept"/>
791
797
  </define>
@@ -806,6 +812,8 @@
806
812
  <ref name="requirement"/>
807
813
  <ref name="recommendation"/>
808
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
809
817
  </choice>
810
818
  </define>
811
819
  <define name="bibliography">
@@ -836,6 +844,9 @@
836
844
  <data type="boolean"/>
837
845
  </attribute>
838
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
839
850
  <optional>
840
851
  <attribute name="obligation">
841
852
  <choice>
@@ -891,9 +902,11 @@
891
902
  <element name="code">
892
903
  <text/>
893
904
  </element>
894
- <element name="text">
895
- <text/>
896
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
897
910
  </element>
898
911
  </define>
899
912
  <define name="standard-document">
@@ -906,6 +919,9 @@
906
919
  </choice>
907
920
  </attribute>
908
921
  <ref name="bibdata"/>
922
+ <optional>
923
+ <ref name="misccontainer"/>
924
+ </optional>
909
925
  <optional>
910
926
  <ref name="boilerplate"/>
911
927
  </optional>
@@ -916,11 +932,21 @@
916
932
  <zeroOrMore>
917
933
  <ref name="annex"/>
918
934
  </zeroOrMore>
935
+ <optional>
936
+ <ref name="bibliography"/>
937
+ </optional>
919
938
  <zeroOrMore>
920
- <ref name="references"/>
939
+ <ref name="indexsect"/>
921
940
  </zeroOrMore>
922
941
  </element>
923
942
  </define>
943
+ <define name="misccontainer">
944
+ <element name="misc-container">
945
+ <oneOrMore>
946
+ <ref name="AnyElement"/>
947
+ </oneOrMore>
948
+ </element>
949
+ </define>
924
950
  <define name="preface">
925
951
  <element name="preface">
926
952
  <oneOrMore>
@@ -944,6 +970,11 @@
944
970
  <ref name="Content-Section"/>
945
971
  </element>
946
972
  </define>
973
+ <define name="indexsect">
974
+ <element name="indexsect">
975
+ <ref name="Content-Section"/>
976
+ </element>
977
+ </define>
947
978
  <define name="boilerplate">
948
979
  <element name="boilerplate">
949
980
  <optional>
@@ -1063,6 +1094,9 @@
1063
1094
  </choice>
1064
1095
  </attribute>
1065
1096
  </optional>
1097
+ <optional>
1098
+ <attribute name="number"/>
1099
+ </optional>
1066
1100
  <optional>
1067
1101
  <attribute name="type"/>
1068
1102
  </optional>
@@ -1116,6 +1150,9 @@
1116
1150
  <optional>
1117
1151
  <attribute name="type"/>
1118
1152
  </optional>
1153
+ <optional>
1154
+ <attribute name="number"/>
1155
+ </optional>
1119
1156
  <optional>
1120
1157
  <ref name="section-title"/>
1121
1158
  </optional>
@@ -1218,6 +1255,9 @@
1218
1255
  <optional>
1219
1256
  <attribute name="type"/>
1220
1257
  </optional>
1258
+ <optional>
1259
+ <attribute name="number"/>
1260
+ </optional>
1221
1261
  <optional>
1222
1262
  <attribute name="obligation">
1223
1263
  <choice>
@@ -1546,6 +1586,7 @@
1546
1586
  <value>add</value>
1547
1587
  <value>modify</value>
1548
1588
  <value>delete</value>
1589
+ <value>replace</value>
1549
1590
  </choice>
1550
1591
  </attribute>
1551
1592
  <optional>
@@ -1576,6 +1617,11 @@
1576
1617
  </optional>
1577
1618
  <optional>
1578
1619
  <element name="newcontent">
1620
+ <optional>
1621
+ <attribute name="id">
1622
+ <data type="ID"/>
1623
+ </attribute>
1624
+ </optional>
1579
1625
  <zeroOrMore>
1580
1626
  <ref name="BasicBlock"/>
1581
1627
  </zeroOrMore>
@@ -1609,4 +1655,87 @@
1609
1655
  <text/>
1610
1656
  </element>
1611
1657
  </define>
1658
+ <define name="imagemap">
1659
+ <element name="imagemap">
1660
+ <ref name="figure"/>
1661
+ <zeroOrMore>
1662
+ <element name="area">
1663
+ <attribute name="type">
1664
+ <choice>
1665
+ <value>rect</value>
1666
+ <value>circle</value>
1667
+ <value>ellipse</value>
1668
+ <value>poly</value>
1669
+ </choice>
1670
+ </attribute>
1671
+ <choice>
1672
+ <ref name="xref"/>
1673
+ <ref name="hyperlink"/>
1674
+ <ref name="eref"/>
1675
+ </choice>
1676
+ <oneOrMore>
1677
+ <element name="coords">
1678
+ <attribute name="x">
1679
+ <data type="float"/>
1680
+ </attribute>
1681
+ <attribute name="y">
1682
+ <data type="float"/>
1683
+ </attribute>
1684
+ </element>
1685
+ </oneOrMore>
1686
+ <optional>
1687
+ <element name="radius">
1688
+ <attribute name="x">
1689
+ <data type="float"/>
1690
+ </attribute>
1691
+ <optional>
1692
+ <attribute name="y">
1693
+ <data type="float"/>
1694
+ </attribute>
1695
+ </optional>
1696
+ </element>
1697
+ </optional>
1698
+ </element>
1699
+ </zeroOrMore>
1700
+ </element>
1701
+ </define>
1702
+ <define name="svgmap">
1703
+ <element name="svgmap">
1704
+ <ref name="figure"/>
1705
+ <zeroOrMore>
1706
+ <element name="target">
1707
+ <attribute name="href">
1708
+ <data type="anyURI"/>
1709
+ </attribute>
1710
+ <choice>
1711
+ <ref name="xref"/>
1712
+ <ref name="hyperlink"/>
1713
+ <ref name="eref"/>
1714
+ </choice>
1715
+ </element>
1716
+ </zeroOrMore>
1717
+ </element>
1718
+ </define>
1719
+ <define name="ul_li">
1720
+ <element name="li">
1721
+ <optional>
1722
+ <attribute name="id">
1723
+ <data type="ID"/>
1724
+ </attribute>
1725
+ </optional>
1726
+ <optional>
1727
+ <attribute name="uncheckedcheckbox">
1728
+ <data type="boolean"/>
1729
+ </attribute>
1730
+ </optional>
1731
+ <optional>
1732
+ <attribute name="checkedcheckbox">
1733
+ <data type="boolean"/>
1734
+ </attribute>
1735
+ </optional>
1736
+ <oneOrMore>
1737
+ <ref name="BasicBlock"/>
1738
+ </oneOrMore>
1739
+ </element>
1740
+ </define>
1612
1741
  </grammar>