metanorma-m3d 1.0.7 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.adoc +0 -3
- data/lib/asciidoctor/m3d/biblio.rng +32 -4
- data/lib/asciidoctor/m3d/converter.rb +0 -5
- data/lib/isodoc/m3d/html/htmlstyle.scss +8 -0
- data/lib/isodoc/m3d/html/m3d.scss +13 -0
- data/lib/isodoc/m3d/html/wordstyle.scss +6 -21
- data/lib/isodoc/m3d/m3dhtmlconvert.rb +0 -60
- data/lib/isodoc/m3d/m3dhtmlrender.rb +5 -8
- data/lib/isodoc/m3d/m3dpdfconvert.rb +0 -60
- data/lib/isodoc/m3d/m3dpdfrender.rb +4 -7
- data/lib/isodoc/m3d/m3wordrender.rb +5 -8
- data/lib/metanorma/m3d/processor.rb +2 -2
- data/lib/metanorma/m3d/version.rb +1 -1
- data/metanorma-m3d.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e547037e67b0e0e801e60628c592161fbb2f8f3475e9430dc4b804ceaed0bea
|
4
|
+
data.tar.gz: 7a821dff76506187b273df899d7fe4e84a4b7299d67f13591bf8ce00cbc763ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87c1537944eb92c2d3d3599ecb63e635150357ce07a900ac25661b750054f192a7efd07d12dd3437d557bc43654952e87fef319c9e50a08e57a2a20cd0f7145c
|
7
|
+
data.tar.gz: 759fe729cd05b687c2bd2b3c700ed8a080e756a244827e1cec25bc093c5ce5e94ff376f80f8170ba7b1dd6e58154e94bbe43b105ad8eaf62b4cf65975c96a3fd
|
data/README.adoc
CHANGED
@@ -144,9 +144,6 @@ report:: report
|
|
144
144
|
|
145
145
|
`:language:` :: The language of the document (only `en` for now) (mandatory)
|
146
146
|
|
147
|
-
`:url:` :: The URL that the HTML version of the document will be published to
|
148
|
-
(optional)
|
149
|
-
|
150
147
|
The attribute `:draft:`, if present, includes review notes in the XML output;
|
151
148
|
these are otherwise suppressed.
|
152
149
|
|
@@ -414,6 +414,20 @@
|
|
414
414
|
<ref name="BibliographicItem"/>
|
415
415
|
</element>
|
416
416
|
</define>
|
417
|
+
<define name="relaton_collection">
|
418
|
+
<element name="relaton-collection">
|
419
|
+
<optional>
|
420
|
+
<attribute name="type"/>
|
421
|
+
</optional>
|
422
|
+
<ref name="btitle"/>
|
423
|
+
<zeroOrMore>
|
424
|
+
<ref name="contributor"/>
|
425
|
+
</zeroOrMore>
|
426
|
+
<zeroOrMore>
|
427
|
+
<ref name="docrelation"/>
|
428
|
+
</zeroOrMore>
|
429
|
+
</element>
|
430
|
+
</define>
|
417
431
|
<define name="BibItemType" combine="choice">
|
418
432
|
<choice>
|
419
433
|
<value>article</value>
|
@@ -531,7 +545,10 @@
|
|
531
545
|
</define>
|
532
546
|
<define name="fetched">
|
533
547
|
<element name="fetched">
|
534
|
-
<
|
548
|
+
<choice>
|
549
|
+
<data type="dateTime"/>
|
550
|
+
<data type="date"/>
|
551
|
+
</choice>
|
535
552
|
</element>
|
536
553
|
</define>
|
537
554
|
<define name="validity">
|
@@ -549,17 +566,26 @@
|
|
549
566
|
</define>
|
550
567
|
<define name="validityBegins">
|
551
568
|
<element name="validityBegins">
|
552
|
-
<
|
569
|
+
<choice>
|
570
|
+
<data type="dateTime"/>
|
571
|
+
<data type="date"/>
|
572
|
+
</choice>
|
553
573
|
</element>
|
554
574
|
</define>
|
555
575
|
<define name="validityEnds">
|
556
576
|
<element name="validityEnds">
|
557
|
-
<
|
577
|
+
<choice>
|
578
|
+
<data type="dateTime"/>
|
579
|
+
<data type="date"/>
|
580
|
+
</choice>
|
558
581
|
</element>
|
559
582
|
</define>
|
560
583
|
<define name="validityRevision">
|
561
584
|
<element name="revision">
|
562
|
-
<
|
585
|
+
<choice>
|
586
|
+
<data type="dateTime"/>
|
587
|
+
<data type="date"/>
|
588
|
+
</choice>
|
563
589
|
</element>
|
564
590
|
</define>
|
565
591
|
<define name="TypedTitleString">
|
@@ -744,6 +770,7 @@
|
|
744
770
|
<element name="from">
|
745
771
|
<choice>
|
746
772
|
<data type="dateTime"/>
|
773
|
+
<data type="date"/>
|
747
774
|
<data type="gYear"/>
|
748
775
|
</choice>
|
749
776
|
</element>
|
@@ -752,6 +779,7 @@
|
|
752
779
|
<element name="to">
|
753
780
|
<choice>
|
754
781
|
<data type="dateTime"/>
|
782
|
+
<data type="date"/>
|
755
783
|
<data type="gYear"/>
|
756
784
|
</choice>
|
757
785
|
</element>
|
@@ -29,11 +29,6 @@ module Asciidoctor
|
|
29
29
|
metadata_ics(node, xml)
|
30
30
|
end
|
31
31
|
|
32
|
-
def metadata_source(node, xml)
|
33
|
-
return unless node.attr("url")
|
34
|
-
xml.source node.attr("url")
|
35
|
-
end
|
36
|
-
|
37
32
|
def metadata_author(node, xml)
|
38
33
|
xml.contributor do |c|
|
39
34
|
c.role **{ type: "author" }
|
@@ -478,6 +478,8 @@ table.MsoISOTable
|
|
478
478
|
mso-yfti-tbllook:480;
|
479
479
|
mso-border-insideh:.75pt solid windowtext;
|
480
480
|
mso-border-insidev:.75pt solid windowtext;
|
481
|
+
mso-table-anchor-vertical:paragraph;
|
482
|
+
mso-table-bspace:12.0pt;
|
481
483
|
font-size:10.0pt;
|
482
484
|
font-family:$bodyfont;}
|
483
485
|
table.MsoISOTable tr
|
@@ -504,6 +506,8 @@ table.MsoTableGrid
|
|
504
506
|
mso-para-margin:0cm;
|
505
507
|
mso-para-margin-bottom:.0001pt;
|
506
508
|
mso-pagination:widow-orphan;
|
509
|
+
mso-table-anchor-vertical:paragraph;
|
510
|
+
mso-table-bspace:12.0pt;
|
507
511
|
font-size:10.0pt;
|
508
512
|
font-family:$bodyfont;}
|
509
513
|
td { page-break-inside:avoid; }
|
@@ -645,6 +649,15 @@ p.example, li.example, div.example, td.example
|
|
645
649
|
mso-pagination:none;
|
646
650
|
font-size:10.0pt;
|
647
651
|
font-family:$bodyfont;}
|
652
|
+
|
653
|
+
table.example {
|
654
|
+
margin-bottom:12pt;
|
655
|
+
}
|
656
|
+
|
657
|
+
td.example p.MsoListParagraph {
|
658
|
+
font-size: 10.0pt;
|
659
|
+
}
|
660
|
+
|
648
661
|
span.note_label, span.example_label, td.example_label, td.note_label
|
649
662
|
{
|
650
663
|
font-size: 10.0pt;
|
@@ -81,9 +81,8 @@ p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
|
|
81
81
|
mso-style-qformat:yes;
|
82
82
|
margin-top:0cm;
|
83
83
|
margin-right:0cm;
|
84
|
-
margin-bottom:
|
84
|
+
margin-bottom:12.0pt;
|
85
85
|
/* do not put in margin-left, it is specific to list level */
|
86
|
-
margin-bottom:.0001pt;
|
87
86
|
mso-add-space:auto;
|
88
87
|
mso-pagination:widow-orphan;
|
89
88
|
font-size:11.0pt;
|
@@ -97,9 +96,8 @@ p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphC
|
|
97
96
|
mso-style-type:export-only;
|
98
97
|
margin-top:0cm;
|
99
98
|
margin-right:0cm;
|
100
|
-
margin-bottom:
|
99
|
+
margin-bottom:12.0pt;
|
101
100
|
/* do not put in margin-left, it is specific to list level */
|
102
|
-
margin-bottom:.0001pt;
|
103
101
|
mso-add-space:auto;
|
104
102
|
mso-pagination:widow-orphan;
|
105
103
|
font-size:11.0pt;
|
@@ -113,9 +111,8 @@ p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagrap
|
|
113
111
|
mso-style-type:export-only;
|
114
112
|
margin-top:0cm;
|
115
113
|
margin-right:0cm;
|
116
|
-
margin-bottom:
|
114
|
+
margin-bottom:12.0pt;
|
117
115
|
/* do not put in margin-left, it is specific to list level */
|
118
|
-
margin-bottom:.0001pt;
|
119
116
|
mso-add-space:auto;
|
120
117
|
mso-pagination:widow-orphan;
|
121
118
|
font-size:11.0pt;
|
@@ -129,9 +126,8 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
|
|
129
126
|
mso-style-type:export-only;
|
130
127
|
margin-top:0cm;
|
131
128
|
margin-right:0cm;
|
132
|
-
margin-bottom:0cm;
|
133
|
-
/* do not put in margin-left, it is specific to list level */
|
134
129
|
margin-bottom:12.0pt;
|
130
|
+
/* do not put in margin-left, it is specific to list level */
|
135
131
|
mso-add-space:auto;
|
136
132
|
mso-pagination:widow-orphan;
|
137
133
|
font-size:11.0pt;
|
@@ -204,19 +200,6 @@ a:visited, span.MsoHyperlinkFollowed
|
|
204
200
|
color:purple;
|
205
201
|
text-decoration:underline;
|
206
202
|
text-underline:single;}
|
207
|
-
p
|
208
|
-
{mso-style-priority:99;
|
209
|
-
mso-margin-top-alt:auto;
|
210
|
-
margin-right:0cm;
|
211
|
-
mso-margin-bottom-alt:auto;
|
212
|
-
margin-left:0cm;
|
213
|
-
mso-pagination:widow-orphan;
|
214
|
-
font-size:10.0pt;
|
215
|
-
font-family:$bodyfont;
|
216
|
-
mso-fareast-font-family:"MS Mincho";
|
217
|
-
mso-bidi-font-family:"Times New Roman";
|
218
|
-
mso-ansi-language:EN-US;
|
219
|
-
mso-fareast-language:EN-US;}
|
220
203
|
p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
|
221
204
|
{mso-style-noshow:yes;
|
222
205
|
mso-style-unhide:no;
|
@@ -1078,6 +1061,8 @@ table.MsoNormalTable
|
|
1078
1061
|
mso-para-margin:0cm;
|
1079
1062
|
mso-para-margin-bottom:.0001pt;
|
1080
1063
|
mso-pagination:widow-orphan;
|
1064
|
+
mso-table-anchor-vertical:paragraph;
|
1065
|
+
mso-table-bspace:12.0pt;
|
1081
1066
|
font-size:10.0pt;
|
1082
1067
|
font-family:$bodyfont;}
|
1083
1068
|
br.section
|
@@ -85,66 +85,6 @@ module IsoDoc
|
|
85
85
|
docxml
|
86
86
|
end
|
87
87
|
|
88
|
-
def annex_name(annex, name, div)
|
89
|
-
div.h1 **{ class: "Annex" } do |t|
|
90
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
91
|
-
t << "<b>#{name.text}</b>"
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def annex_name_lbl(clause, num)
|
96
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
97
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
98
|
-
l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
|
99
|
-
end
|
100
|
-
|
101
|
-
def pre_parse(node, out)
|
102
|
-
out.pre node.text # content.gsub(/</, "<").gsub(/>/, ">")
|
103
|
-
end
|
104
|
-
|
105
|
-
def term_defs_boilerplate(div, source, term, preface)
|
106
|
-
if source.empty? && term.nil?
|
107
|
-
div << @no_terms_boilerplate
|
108
|
-
else
|
109
|
-
div << term_defs_boilerplate_cont(source, term)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
def i18n_init(lang, script)
|
114
|
-
super
|
115
|
-
@annex_lbl = "Appendix"
|
116
|
-
end
|
117
|
-
|
118
|
-
def error_parse(node, out)
|
119
|
-
# catch elements not defined in ISO
|
120
|
-
case node.name
|
121
|
-
when "pre"
|
122
|
-
pre_parse(node, out)
|
123
|
-
when "keyword"
|
124
|
-
out.span node.text, **{ class: "keyword" }
|
125
|
-
else
|
126
|
-
super
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
def fileloc(loc)
|
131
|
-
File.join(File.dirname(__FILE__), loc)
|
132
|
-
end
|
133
|
-
|
134
|
-
def cleanup(docxml)
|
135
|
-
super
|
136
|
-
term_cleanup(docxml)
|
137
|
-
end
|
138
|
-
|
139
|
-
def term_cleanup(docxml)
|
140
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
141
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
142
|
-
h2.add_child(" ")
|
143
|
-
h2.add_child(d.remove)
|
144
|
-
end
|
145
|
-
docxml
|
146
|
-
end
|
147
|
-
|
148
88
|
def info(isoxml, out)
|
149
89
|
@meta.url isoxml, out
|
150
90
|
super
|
@@ -3,19 +3,16 @@ module IsoDoc
|
|
3
3
|
# A {Converter} implementation that generates CSAND output, and a document
|
4
4
|
# schema encapsulation of the document for validation
|
5
5
|
class HtmlConvert < IsoDoc::HtmlConvert
|
6
|
-
|
6
|
+
def annex_name(annex, name, div)
|
7
7
|
div.h1 **{ class: "Annex" } do |t|
|
8
8
|
t << "#{get_anchors[annex['id']][:label]} "
|
9
|
-
t
|
9
|
+
t.br
|
10
|
+
t.b do |b|
|
11
|
+
name&.children&.each { |c2| parse(c2, b) }
|
12
|
+
end
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
13
|
-
def annex_name_lbl(clause, num)
|
14
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
15
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
16
|
-
l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
|
17
|
-
end
|
18
|
-
|
19
16
|
def pre_parse(node, out)
|
20
17
|
out.pre node.text # content.gsub(/</, "<").gsub(/>/, ">")
|
21
18
|
end
|
@@ -85,66 +85,6 @@ module IsoDoc
|
|
85
85
|
docxml
|
86
86
|
end
|
87
87
|
|
88
|
-
def annex_name(annex, name, div)
|
89
|
-
div.h1 **{ class: "Annex" } do |t|
|
90
|
-
t << "#{get_anchors[annex['id']][:label]} "
|
91
|
-
t << "<b>#{name.text}</b>"
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
|
-
def annex_name_lbl(clause, num)
|
96
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
97
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
98
|
-
l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
|
99
|
-
end
|
100
|
-
|
101
|
-
def pre_parse(node, out)
|
102
|
-
out.pre node.text # content.gsub(/</, "<").gsub(/>/, ">")
|
103
|
-
end
|
104
|
-
|
105
|
-
def term_defs_boilerplate(div, source, term, preface)
|
106
|
-
if source.empty? && term.nil?
|
107
|
-
div << @no_terms_boilerplate
|
108
|
-
else
|
109
|
-
div << term_defs_boilerplate_cont(source, term)
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
def i18n_init(lang, script)
|
114
|
-
super
|
115
|
-
@annex_lbl = "Appendix"
|
116
|
-
end
|
117
|
-
|
118
|
-
def error_parse(node, out)
|
119
|
-
# catch elements not defined in ISO
|
120
|
-
case node.name
|
121
|
-
when "pre"
|
122
|
-
pre_parse(node, out)
|
123
|
-
when "keyword"
|
124
|
-
out.span node.text, **{ class: "keyword" }
|
125
|
-
else
|
126
|
-
super
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
def fileloc(loc)
|
131
|
-
File.join(File.dirname(__FILE__), loc)
|
132
|
-
end
|
133
|
-
|
134
|
-
def cleanup(docxml)
|
135
|
-
super
|
136
|
-
term_cleanup(docxml)
|
137
|
-
end
|
138
|
-
|
139
|
-
def term_cleanup(docxml)
|
140
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
141
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
142
|
-
h2.add_child(" ")
|
143
|
-
h2.add_child(d.remove)
|
144
|
-
end
|
145
|
-
docxml
|
146
|
-
end
|
147
|
-
|
148
88
|
def info(isoxml, out)
|
149
89
|
@meta.url isoxml, out
|
150
90
|
super
|
@@ -6,16 +6,13 @@ module IsoDoc
|
|
6
6
|
def annex_name(annex, name, div)
|
7
7
|
div.h1 **{ class: "Annex" } do |t|
|
8
8
|
t << "#{get_anchors[annex['id']][:label]} "
|
9
|
-
t
|
9
|
+
t.br
|
10
|
+
t.b do |b|
|
11
|
+
name&.children&.each { |c2| parse(c2, b) }
|
12
|
+
end
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
13
|
-
def annex_name_lbl(clause, num)
|
14
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
15
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
16
|
-
l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
|
17
|
-
end
|
18
|
-
|
19
16
|
def pre_parse(node, out)
|
20
17
|
out.pre node.text # content.gsub(/</, "<").gsub(/>/, ">")
|
21
18
|
end
|
@@ -3,19 +3,16 @@ module IsoDoc
|
|
3
3
|
# A {Converter} implementation that generates CSAND output, and a document
|
4
4
|
# schema encapsulation of the document for validation
|
5
5
|
class WordConvert < IsoDoc::WordConvert
|
6
|
-
|
6
|
+
def annex_name(annex, name, div)
|
7
7
|
div.h1 **{ class: "Annex" } do |t|
|
8
8
|
t << "#{get_anchors[annex['id']][:label]} "
|
9
|
-
t
|
9
|
+
t.br
|
10
|
+
t.b do |b|
|
11
|
+
name&.children&.each { |c2| parse(c2, b) }
|
12
|
+
end
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
13
|
-
def annex_name_lbl(clause, num)
|
14
|
-
obl = l10n("(#{@inform_annex_lbl})")
|
15
|
-
obl = l10n("(#{@norm_annex_lbl})") if clause["obligation"] == "normative"
|
16
|
-
l10n("<b>#{@annex_lbl} #{num}</b> #{obl}")
|
17
|
-
end
|
18
|
-
|
19
16
|
def pre_parse(node, out)
|
20
17
|
out.pre node.text # content.gsub(/</, "<").gsub(/>/, ">")
|
21
18
|
end
|
@@ -22,8 +22,8 @@ module Metanorma
|
|
22
22
|
"Metanorma::M3d #{Metanorma::M3d::VERSION}"
|
23
23
|
end
|
24
24
|
|
25
|
-
def input_to_isodoc(file)
|
26
|
-
Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
|
25
|
+
def input_to_isodoc(file, filename)
|
26
|
+
Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
|
27
27
|
end
|
28
28
|
|
29
29
|
def output(isodoc_node, outname, format, options={})
|
data/metanorma-m3d.gemspec
CHANGED
@@ -51,5 +51,5 @@ Gem::Specification.new do |spec|
|
|
51
51
|
spec.add_development_dependency "rubocop", "~> 0.50"
|
52
52
|
spec.add_development_dependency "simplecov", "~> 0.15"
|
53
53
|
spec.add_development_dependency "timecop", "~> 0.9"
|
54
|
-
spec.add_development_dependency "metanorma", "~> 0.
|
54
|
+
spec.add_development_dependency "metanorma", "~> 0.3.0"
|
55
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-m3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -324,14 +324,14 @@ dependencies:
|
|
324
324
|
requirements:
|
325
325
|
- - "~>"
|
326
326
|
- !ruby/object:Gem::Version
|
327
|
-
version: 0.
|
327
|
+
version: 0.3.0
|
328
328
|
type: :development
|
329
329
|
prerelease: false
|
330
330
|
version_requirements: !ruby/object:Gem::Requirement
|
331
331
|
requirements:
|
332
332
|
- - "~>"
|
333
333
|
- !ruby/object:Gem::Version
|
334
|
-
version: 0.
|
334
|
+
version: 0.3.0
|
335
335
|
description: |
|
336
336
|
metanorma-m3d lets you write M3AAWG Documents (M3D) in AsciiDoc syntax.
|
337
337
|
|