metanorma-itu 1.0.8 → 1.0.9
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/asciidoctor/itu/converter.rb +3 -49
- data/lib/isodoc/itu/base_convert.rb +1 -1
- data/lib/isodoc/itu/xref.rb +2 -2
- data/lib/metanorma/itu/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6fdcd13b8422d4f34b193763e505ce838c6a9db793fa61be7e9259d063f2d42e
|
|
4
|
+
data.tar.gz: 530301c50e4dd6f121015b5821b1e4d971a7de37eb8016ded73143e37ab03dfd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2667f0a8b869354315893203b60b4a091565c027b95136ca42636bffc175d82add61ce900ea8a3430f3d6c09e21482f0489651a188c181ed08b35ef197c9e911
|
|
7
|
+
data.tar.gz: 3c6a9be2da83277ac8286c41c2512bfb8f49995a30fb0231169e61c4dbb1fc7284c647c60a181003cb7e32ca7fb4c354d2784877da3932bc31f392610586f13a
|
|
@@ -43,32 +43,14 @@ module Asciidoctor
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def olist(node)
|
|
46
|
+
id = Asciidoctor::Standoc::Utils::anchor_or_uuid(node)
|
|
46
47
|
noko do |xml|
|
|
47
|
-
xml.ol **attr_code(id:
|
|
48
|
-
class: node.attr("class")) do |xml_ol|
|
|
48
|
+
xml.ol **attr_code(id: id, class: node.attr("class")) do |xml_ol|
|
|
49
49
|
node.items.each { |item| li(xml_ol, item) }
|
|
50
50
|
end
|
|
51
51
|
end.join("\n")
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
def clause_parse(attrs, xml, node)
|
|
55
|
-
attrs[:preface] = true if node.attr("style") == "preface"
|
|
56
|
-
super
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
def move_sections_into_preface(x, preface)
|
|
60
|
-
x.xpath("//clause[@preface]").each do |c|
|
|
61
|
-
c.delete("preface")
|
|
62
|
-
preface.add_child c.remove
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def make_preface(x, s)
|
|
67
|
-
s.add_previous_sibling("<preface/>") unless x.at("//preface")
|
|
68
|
-
make_abstract(x, s)
|
|
69
|
-
move_sections_into_preface(x, x.at("//preface"))
|
|
70
|
-
end
|
|
71
|
-
|
|
72
54
|
def document(node)
|
|
73
55
|
init(node)
|
|
74
56
|
ret1 = makexml(node)
|
|
@@ -99,40 +81,12 @@ module Asciidoctor
|
|
|
99
81
|
case ret
|
|
100
82
|
when "definitions" then "terms and definitions"
|
|
101
83
|
when "abbreviations and acronyms" then "symbols and abbreviated terms"
|
|
84
|
+
when "references" then "normative references"
|
|
102
85
|
else
|
|
103
86
|
super
|
|
104
87
|
end
|
|
105
88
|
end
|
|
106
89
|
|
|
107
|
-
def section(node)
|
|
108
|
-
a = section_attributes(node)
|
|
109
|
-
noko do |xml|
|
|
110
|
-
case sectiontype(node)
|
|
111
|
-
when "references" then norm_ref_parse(a, xml, node)
|
|
112
|
-
when "terms and definitions"
|
|
113
|
-
@term_def = true
|
|
114
|
-
term_def_parse(a, xml, node, true)
|
|
115
|
-
@term_def = false
|
|
116
|
-
when "symbols and abbreviated terms"
|
|
117
|
-
symbols_parse(a, xml, node)
|
|
118
|
-
when "bibliography" then bibliography_parse(a, xml, node)
|
|
119
|
-
else
|
|
120
|
-
if @term_def then term_def_subclause_parse(a, xml, node)
|
|
121
|
-
elsif @definitions then symbols_parse(a, xml, node)
|
|
122
|
-
elsif @biblio then bibliography_parse(a, xml, node)
|
|
123
|
-
elsif node.attr("style") == "bibliography"
|
|
124
|
-
bibliography_parse(a, xml, node)
|
|
125
|
-
elsif node.attr("style") == "abstract"
|
|
126
|
-
abstract_parse(a, xml, node)
|
|
127
|
-
elsif node.attr("style") == "appendix" && node.level == 1
|
|
128
|
-
annex_parse(a, xml, node)
|
|
129
|
-
else
|
|
130
|
-
clause_parse(a, xml, node)
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
end.join("\n")
|
|
134
|
-
end
|
|
135
|
-
|
|
136
90
|
def norm_ref_parse(attrs, xml, node)
|
|
137
91
|
@norm_ref = true
|
|
138
92
|
xml.references **attr_code(attrs) do |xml_section|
|
|
@@ -29,7 +29,7 @@ module IsoDoc
|
|
|
29
29
|
isoxml.xpath(ns(FRONT_CLAUSE)).each do |c|
|
|
30
30
|
title = c&.at(ns("./title"))
|
|
31
31
|
out.div **attr_code(id: c["id"]) do |s|
|
|
32
|
-
clause_name(nil, title
|
|
32
|
+
clause_name(nil, title, s, class: "IntroTitle")
|
|
33
33
|
c.elements.reject { |c1| c1.name == "title" }.each do |c1|
|
|
34
34
|
parse(c1, s)
|
|
35
35
|
end
|
data/lib/isodoc/itu/xref.rb
CHANGED
|
@@ -70,9 +70,9 @@ module IsoDoc
|
|
|
70
70
|
def middle_section_asset_names(d)
|
|
71
71
|
return super unless @hierarchical_assets
|
|
72
72
|
middle_sections = "//clause[title = 'Scope'] | "\
|
|
73
|
-
"//foreword | //introduction | "\
|
|
73
|
+
"//foreword | //introduction | //acknowledgements | "\
|
|
74
74
|
"//references[title = 'References' or title = 'references'] | "\
|
|
75
|
-
"//sections/terms | "\
|
|
75
|
+
"//sections/terms | //preface/clause | "\
|
|
76
76
|
"//sections/definitions | //clause[parent::sections]"
|
|
77
77
|
d.xpath(ns(middle_sections)).each do |c|
|
|
78
78
|
hierarchical_asset_names(c, @anchors[c["id"]][:label])
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-itu
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.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: 2020-02-
|
|
11
|
+
date: 2020-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: htmlentities
|