metanorma-ietf 2.2.8 → 2.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/ietf/converter.rb +16 -0
- data/lib/asciidoctor/ietf/ietf.rng +39 -0
- data/lib/asciidoctor/ietf/isodoc.rng +82 -1
- data/lib/isodoc/ietf/inline.rb +1 -1
- data/lib/isodoc/ietf/rfc_convert.rb +10 -5
- data/lib/metanorma/ietf/version.rb +1 -1
- data/metanorma-ietf.gemspec +1 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef8df6cb58dabbcabed03ba7d877da277111d4899c18d37ab8cc4dc4946cfffa
|
4
|
+
data.tar.gz: 6b7ad838b66278077b12c5665989f29d928dcbe5a3db01744b6382cbfc33cb0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2753190188ffb6db38d5c9b82f005288306b2ec8e9b2fc3c913b59f6e233387997b8d2669ea3e30caf6f2c1c17705a47ce77b5fac74bcff404c040a169040e1c
|
7
|
+
data.tar.gz: 2e8bb3135c7b65585822c02c3c0fd57ba26630ded8d73b0af1c9b43f620214a457061eb5769e269a0cf791fea1e5788c0e6ed63669addfaf5e5fbe65d43ed806
|
@@ -204,6 +204,22 @@ module Asciidoctor
|
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
|
+
def inline_indexterm(node)
|
208
|
+
noko do |xml|
|
209
|
+
node.type == :visible and xml << node.text.sub(/^primary:(?=\S)/, "")
|
210
|
+
terms = (node.attr("terms") || [node.text]).map { |x| xml_encode(x) }
|
211
|
+
if /^primary:\S/.match(terms[0])
|
212
|
+
terms[0].sub!(/^primary:/, "")
|
213
|
+
has_primary = true
|
214
|
+
end
|
215
|
+
xml.index **attr_code(primary: has_primary) do |i|
|
216
|
+
i.primary { |x| x << terms[0] }
|
217
|
+
a = terms.dig(1) and i.secondary { |x| x << a }
|
218
|
+
a = terms.dig(2) and i.tertiary { |x| x << a }
|
219
|
+
end
|
220
|
+
end.join
|
221
|
+
end
|
222
|
+
|
207
223
|
def html_extract_attributes(node)
|
208
224
|
super.merge(use_xinclude: node.attr("use-xinclude"))
|
209
225
|
end
|
@@ -564,6 +564,39 @@
|
|
564
564
|
</zeroOrMore>
|
565
565
|
</element>
|
566
566
|
</define>
|
567
|
+
<define name="index">
|
568
|
+
<element name="index">
|
569
|
+
<optional>
|
570
|
+
<attribute name="to">
|
571
|
+
<data type="IDREF"/>
|
572
|
+
</attribute>
|
573
|
+
</optional>
|
574
|
+
<optional>
|
575
|
+
<attribute name="primary">
|
576
|
+
<data type="boolean"/>
|
577
|
+
</attribute>
|
578
|
+
</optional>
|
579
|
+
<element name="primary">
|
580
|
+
<oneOrMore>
|
581
|
+
<ref name="PureTextElement"/>
|
582
|
+
</oneOrMore>
|
583
|
+
</element>
|
584
|
+
<optional>
|
585
|
+
<element name="secondary">
|
586
|
+
<oneOrMore>
|
587
|
+
<ref name="PureTextElement"/>
|
588
|
+
</oneOrMore>
|
589
|
+
</element>
|
590
|
+
</optional>
|
591
|
+
<optional>
|
592
|
+
<element name="tertiary">
|
593
|
+
<oneOrMore>
|
594
|
+
<ref name="PureTextElement"/>
|
595
|
+
</oneOrMore>
|
596
|
+
</element>
|
597
|
+
</optional>
|
598
|
+
</element>
|
599
|
+
</define>
|
567
600
|
</include>
|
568
601
|
<define name="TextElement" combine="choice">
|
569
602
|
<ref name="bcp14"/>
|
@@ -879,6 +912,9 @@
|
|
879
912
|
<zeroOrMore>
|
880
913
|
<ref name="termdocsource"/>
|
881
914
|
</zeroOrMore>
|
915
|
+
<optional>
|
916
|
+
<ref name="misccontainer"/>
|
917
|
+
</optional>
|
882
918
|
<optional>
|
883
919
|
<ref name="boilerplate"/>
|
884
920
|
</optional>
|
@@ -890,6 +926,9 @@
|
|
890
926
|
<ref name="annex"/>
|
891
927
|
</zeroOrMore>
|
892
928
|
<ref name="bibliography"/>
|
929
|
+
<zeroOrMore>
|
930
|
+
<ref name="indexsect"/>
|
931
|
+
</zeroOrMore>
|
893
932
|
</element>
|
894
933
|
</define>
|
895
934
|
</grammar>
|
@@ -812,6 +812,8 @@
|
|
812
812
|
<ref name="requirement"/>
|
813
813
|
<ref name="recommendation"/>
|
814
814
|
<ref name="permission"/>
|
815
|
+
<ref name="imagemap"/>
|
816
|
+
<ref name="svgmap"/>
|
815
817
|
</choice>
|
816
818
|
</define>
|
817
819
|
<define name="bibliography">
|
@@ -917,6 +919,9 @@
|
|
917
919
|
</choice>
|
918
920
|
</attribute>
|
919
921
|
<ref name="bibdata"/>
|
922
|
+
<optional>
|
923
|
+
<ref name="misccontainer"/>
|
924
|
+
</optional>
|
920
925
|
<optional>
|
921
926
|
<ref name="boilerplate"/>
|
922
927
|
</optional>
|
@@ -927,11 +932,21 @@
|
|
927
932
|
<zeroOrMore>
|
928
933
|
<ref name="annex"/>
|
929
934
|
</zeroOrMore>
|
935
|
+
<optional>
|
936
|
+
<ref name="bibliography"/>
|
937
|
+
</optional>
|
930
938
|
<zeroOrMore>
|
931
|
-
<ref name="
|
939
|
+
<ref name="indexsect"/>
|
932
940
|
</zeroOrMore>
|
933
941
|
</element>
|
934
942
|
</define>
|
943
|
+
<define name="misccontainer">
|
944
|
+
<element name="misc-container">
|
945
|
+
<oneOrMore>
|
946
|
+
<ref name="AnyElement"/>
|
947
|
+
</oneOrMore>
|
948
|
+
</element>
|
949
|
+
</define>
|
935
950
|
<define name="preface">
|
936
951
|
<element name="preface">
|
937
952
|
<oneOrMore>
|
@@ -955,6 +970,11 @@
|
|
955
970
|
<ref name="Content-Section"/>
|
956
971
|
</element>
|
957
972
|
</define>
|
973
|
+
<define name="indexsect">
|
974
|
+
<element name="indexsect">
|
975
|
+
<ref name="Content-Section"/>
|
976
|
+
</element>
|
977
|
+
</define>
|
958
978
|
<define name="boilerplate">
|
959
979
|
<element name="boilerplate">
|
960
980
|
<optional>
|
@@ -1635,4 +1655,65 @@
|
|
1635
1655
|
<text/>
|
1636
1656
|
</element>
|
1637
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>
|
1638
1719
|
</grammar>
|
data/lib/isodoc/ietf/inline.rb
CHANGED
@@ -156,7 +156,7 @@ module IsoDoc::Ietf
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def index_parse(node, out)
|
159
|
-
out.iref nil, **attr_code(item: node.at(ns("./primary")).text,
|
159
|
+
out.iref nil, **attr_code(item: node.at(ns("./primary")).text, primary: node["primary"],
|
160
160
|
subitem: node&.at(ns("./secondary"))&.text)
|
161
161
|
end
|
162
162
|
|
@@ -26,7 +26,7 @@ module IsoDoc::Ietf
|
|
26
26
|
make_back(html, docxml)
|
27
27
|
end
|
28
28
|
end.join("\n").sub(/<!DOCTYPE[^>]+>\n/, "")
|
29
|
-
|
29
|
+
set_pis(docxml, Nokogiri::XML(xml))
|
30
30
|
end
|
31
31
|
|
32
32
|
def metadata_init(lang, script, i18n)
|
@@ -34,8 +34,8 @@ module IsoDoc::Ietf
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def xref_init(lang, script, klass, i18n, options)
|
37
|
-
|
38
|
-
|
37
|
+
@xrefs = Xref.new(lang, script, klass, i18n, options)
|
38
|
+
end
|
39
39
|
|
40
40
|
def extract_delims(text)
|
41
41
|
@openmathdelim = "$$"
|
@@ -57,9 +57,14 @@ module IsoDoc::Ietf
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
|
60
|
+
def omit_docid_prefix(prefix)
|
61
|
+
return true if prefix == "IETF"
|
62
|
+
super
|
63
|
+
end
|
64
|
+
|
65
|
+
def textcleanup(docxml)
|
61
66
|
passthrough_cleanup(docxml)
|
62
|
-
|
67
|
+
end
|
63
68
|
|
64
69
|
def postprocess(result, filename, _dir)
|
65
70
|
result = from_xhtml(cleanup(to_xhtml(textcleanup(result)))).
|
data/metanorma-ietf.gemspec
CHANGED
@@ -38,6 +38,7 @@ Gem::Specification.new do |spec|
|
|
38
38
|
spec.add_dependency "metanorma-standoc", "~> 1.8.0"
|
39
39
|
spec.add_dependency "isodoc", "~> 1.5.0"
|
40
40
|
spec.add_dependency "mathml2asciimath"
|
41
|
+
spec.add_dependency "nokogiri", "~> 1.10.4"
|
41
42
|
|
42
43
|
spec.add_development_dependency "byebug"
|
43
44
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-ietf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-standoc
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.10.4
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.10.4
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: byebug
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -301,7 +315,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
301
315
|
- !ruby/object:Gem::Version
|
302
316
|
version: '0'
|
303
317
|
requirements: []
|
304
|
-
rubygems_version: 3.
|
318
|
+
rubygems_version: 3.1.4
|
305
319
|
signing_key:
|
306
320
|
specification_version: 4
|
307
321
|
summary: metanorma-ietf lets you write IETF documents, such as Internet-Drafts and
|