metanorma-m3aawg 1.5.5 → 1.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +62 -0
- data/README.adoc +2 -4
- data/lib/asciidoctor/m3aawg/basicdoc.rng +50 -3
- data/lib/asciidoctor/m3aawg/converter.rb +4 -49
- data/lib/asciidoctor/m3aawg/isodoc.rng +36 -43
- data/lib/isodoc/m3aawg/base_convert.rb +2 -12
- data/lib/isodoc/m3aawg/html/htmlstyle.css +7 -3
- data/lib/isodoc/m3aawg/html/htmlstyle.scss +2 -2
- data/lib/isodoc/m3aawg/html/m3d.css +41 -41
- data/lib/isodoc/m3aawg/html/m3d.scss +41 -41
- data/lib/isodoc/m3aawg/html/wordstyle.css +31 -31
- data/lib/isodoc/m3aawg/html/wordstyle.scss +31 -31
- data/lib/isodoc/m3aawg/html_convert.rb +7 -31
- data/lib/isodoc/m3aawg/i18n.rb +3 -4
- data/lib/isodoc/m3aawg/init.rb +2 -5
- data/lib/isodoc/m3aawg/m3d.report.xsl +371 -111
- data/lib/isodoc/m3aawg/metadata.rb +5 -17
- data/lib/isodoc/m3aawg/presentation_xml_convert.rb +11 -6
- data/lib/isodoc/m3aawg/word_convert.rb +4 -35
- data/lib/isodoc/m3aawg/xref.rb +5 -0
- data/lib/metanorma/m3aawg.rb +28 -2
- data/lib/metanorma/m3aawg/processor.rb +16 -9
- data/lib/metanorma/m3aawg/version.rb +1 -1
- data/metanorma-m3d.gemspec +1 -2
- data/metanorma.yml +51 -0
- metadata +7 -23
- data/.github/workflows/macos.yml +0 -38
- data/.github/workflows/ubuntu.yml +0 -56
- data/.github/workflows/windows.yml +0 -40
- data/lib/asciidoctor/m3aawg/validate.rb +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05e03f4d8aa09a9f187402ebdc4458ed44a74ce997f2e73eb4d8aa7f6fc74166
|
4
|
+
data.tar.gz: 03b1472ddeb5befa4ca2b1c4c7f9792b2445fc3e76e6f2ab74d21abe844f3e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa0e526bc5c4121ca63de30e5442d3c6ae25d0e98295d6e043de06a9d18c1b41e23b65301be77ef594a6e0a80d579fac6f5836d03c4ce1786e8172185f511df8
|
7
|
+
data.tar.gz: 70174fb0222d2d757fd8985ddf49cb6872cb74453de568369c8785b6fd0f94d31d9e0b21b2333ef872f519b0ab213dadac247c28a786352a3d8564c75bfa89fb
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
3
|
+
name: rake
|
4
|
+
|
5
|
+
on:
|
6
|
+
push:
|
7
|
+
branches: [ master, main ]
|
8
|
+
tags: [ v* ]
|
9
|
+
pull_request:
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
rake:
|
13
|
+
name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
|
14
|
+
runs-on: ${{ matrix.os }}
|
15
|
+
continue-on-error: ${{ matrix.experimental }}
|
16
|
+
strategy:
|
17
|
+
fail-fast: false
|
18
|
+
matrix:
|
19
|
+
ruby: [ '2.6', '2.5', '2.4' ]
|
20
|
+
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
|
+
experimental: [ false ]
|
22
|
+
include:
|
23
|
+
- ruby: '2.7'
|
24
|
+
os: 'ubuntu-latest'
|
25
|
+
experimental: true
|
26
|
+
- ruby: '2.7'
|
27
|
+
os: 'windows-latest'
|
28
|
+
experimental: true
|
29
|
+
- ruby: '2.7'
|
30
|
+
os: 'macos-latest'
|
31
|
+
experimental: true
|
32
|
+
steps:
|
33
|
+
- uses: actions/checkout@master
|
34
|
+
|
35
|
+
- uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
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
|
48
|
+
|
49
|
+
- 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/README.adoc
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
= Metanorma processor for M3AAWG documents
|
2
2
|
|
3
3
|
https://github.com/metanorma/metanorma-m3aawg[metanorma-m3aawg] image:https://img.shields.io/gem/v/metanorma-m3aawg.svg["Gem Version", link="https://rubygems.org/gems/metanorma-m3aawg"]::
|
4
|
-
image:https://github.com/metanorma/metanorma-m3aawg/workflows/
|
5
|
-
image:https://github.com/metanorma/metanorma-m3aawg/workflows/windows/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-m3aawg/actions?workflow=windows"]
|
6
|
-
image:https://github.com/metanorma/metanorma-m3aawg/workflows/ubuntu/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-m3aawg/actions?workflow=ubuntu"]
|
4
|
+
image:https://github.com/metanorma/metanorma-m3aawg/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-m3aawg/actions?workflow=rake"]
|
7
5
|
image:https://codeclimate.com/github/metanorma/metanorma-m3aawg/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-m3aawg"]
|
8
6
|
image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-m3aawg.svg["Pull Requests", link="https://github.com/metanorma/metanorma-m3aawg/pulls"]
|
9
7
|
image:https://img.shields.io/github/commits-since/metanorma/metanorma-m3aawg/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-m3aawg/releases"]
|
@@ -12,7 +10,7 @@ _Formerly known as_ `asciidoctor-m3d`.
|
|
12
10
|
|
13
11
|
== Functionality
|
14
12
|
|
15
|
-
This gem processes
|
13
|
+
This gem processes https://www.metanorma.com[Metanorma documents] following
|
16
14
|
a template for generating M3AAWG documents.
|
17
15
|
|
18
16
|
The gem currently inherits from the https://github.com/metanorma/metanorma-standoc
|
@@ -596,6 +596,7 @@
|
|
596
596
|
<ref name="bookmark"/>
|
597
597
|
<ref name="image"/>
|
598
598
|
<ref name="index"/>
|
599
|
+
<ref name="index-xref"/>
|
599
600
|
</choice>
|
600
601
|
</define>
|
601
602
|
<define name="PureTextElement">
|
@@ -728,15 +729,61 @@
|
|
728
729
|
</define>
|
729
730
|
<define name="index">
|
730
731
|
<element name="index">
|
731
|
-
<attribute name="
|
732
|
+
<attribute name="to">
|
733
|
+
<data type="IDREF"/>
|
734
|
+
</attribute>
|
735
|
+
<element name="primary">
|
736
|
+
<oneOrMore>
|
737
|
+
<ref name="PureTextElement"/>
|
738
|
+
</oneOrMore>
|
739
|
+
</element>
|
732
740
|
<optional>
|
733
|
-
<
|
741
|
+
<element name="secondary">
|
742
|
+
<oneOrMore>
|
743
|
+
<ref name="PureTextElement"/>
|
744
|
+
</oneOrMore>
|
745
|
+
</element>
|
734
746
|
</optional>
|
735
747
|
<optional>
|
736
|
-
<
|
748
|
+
<element name="tertiary">
|
749
|
+
<oneOrMore>
|
750
|
+
<ref name="PureTextElement"/>
|
751
|
+
</oneOrMore>
|
752
|
+
</element>
|
737
753
|
</optional>
|
738
754
|
</element>
|
739
755
|
</define>
|
756
|
+
<define name="index-xref">
|
757
|
+
<element name="index-xref">
|
758
|
+
<attribute name="also">
|
759
|
+
<data type="boolean"/>
|
760
|
+
</attribute>
|
761
|
+
<element name="primary">
|
762
|
+
<oneOrMore>
|
763
|
+
<ref name="PureTextElement"/>
|
764
|
+
</oneOrMore>
|
765
|
+
</element>
|
766
|
+
<optional>
|
767
|
+
<element name="secondary">
|
768
|
+
<oneOrMore>
|
769
|
+
<ref name="PureTextElement"/>
|
770
|
+
</oneOrMore>
|
771
|
+
</element>
|
772
|
+
</optional>
|
773
|
+
<optional>
|
774
|
+
<element name="tertiary">
|
775
|
+
<oneOrMore>
|
776
|
+
<ref name="PureTextElement"/>
|
777
|
+
</oneOrMore>
|
778
|
+
</element>
|
779
|
+
</optional>
|
780
|
+
<element name="target">
|
781
|
+
<oneOrMore>
|
782
|
+
<ref name="PureTextElement"/>
|
783
|
+
</oneOrMore>
|
784
|
+
</element>
|
785
|
+
</element>
|
786
|
+
</define>
|
740
787
|
<!-- bare ID element, used for referencing arbitrary spans of text -->
|
741
788
|
<define name="bookmark">
|
742
789
|
<element name="bookmark">
|
@@ -1,27 +1,14 @@
|
|
1
|
-
require "asciidoctor"
|
2
|
-
require "metanorma/m3aawg/version"
|
3
|
-
require "isodoc/m3aawg/html_convert"
|
4
|
-
require "isodoc/m3aawg/word_convert"
|
5
|
-
require "isodoc/m3aawg/pdf_convert"
|
6
1
|
require "asciidoctor/standoc/converter"
|
7
|
-
require
|
8
|
-
require_relative "./validate.rb"
|
2
|
+
require 'asciidoctor/generic/converter'
|
9
3
|
|
10
4
|
module Asciidoctor
|
11
5
|
module M3AAWG
|
12
|
-
|
13
|
-
# A {Converter} implementation that generates M3D output, and a document
|
14
|
-
# schema encapsulation of the document for validation
|
15
|
-
class Converter < Standoc::Converter
|
6
|
+
class Converter < Asciidoctor::Generic::Converter
|
16
7
|
XML_ROOT_TAG = "m3d-standard".freeze
|
17
8
|
XML_NAMESPACE = "https://www.metanorma.org/ns/m3d".freeze
|
18
9
|
|
19
10
|
register_for "m3aawg"
|
20
11
|
|
21
|
-
def default_publisher
|
22
|
-
"Messaging Malware and Mobile Anti-Abuse Working Group"
|
23
|
-
end
|
24
|
-
|
25
12
|
def metadata_committee(node, xml)
|
26
13
|
return unless node.attr("technical-committee")
|
27
14
|
xml.editorialgroup do |a|
|
@@ -36,21 +23,8 @@ module Asciidoctor
|
|
36
23
|
end
|
37
24
|
end
|
38
25
|
|
39
|
-
|
40
|
-
|
41
|
-
dn = node.attr("docnumber")
|
42
|
-
if docstatus
|
43
|
-
abbr = IsoDoc::M3AAWG::Metadata.new("en", "Latn", @i18n).
|
44
|
-
stage_abbr(docstatus)
|
45
|
-
dn = "#{dn}(#{abbr})" unless abbr.empty?
|
46
|
-
end
|
47
|
-
node.attr("copyright-year") and dn += ":#{node.attr("copyright-year")}"
|
48
|
-
xml.docidentifier dn, **{type: "M3AAWG"}
|
49
|
-
xml.docnumber { |i| i << node.attr("docnumber") }
|
50
|
-
end
|
51
|
-
|
52
|
-
def title_validate(root)
|
53
|
-
nil
|
26
|
+
def configuration
|
27
|
+
Metanorma::M3AAWG.configuration
|
54
28
|
end
|
55
29
|
|
56
30
|
def makexml(node)
|
@@ -58,15 +32,6 @@ module Asciidoctor
|
|
58
32
|
super
|
59
33
|
end
|
60
34
|
|
61
|
-
def doctype(node)
|
62
|
-
d = super
|
63
|
-
unless %w{policy best-practices supporting-document report}.include? d
|
64
|
-
@log.add("Document Attributes", nil, "#{d} is not a legal document type: reverting to 'report'")
|
65
|
-
d = "report"
|
66
|
-
end
|
67
|
-
d
|
68
|
-
end
|
69
|
-
|
70
35
|
def outputs(node, ret)
|
71
36
|
File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
|
72
37
|
presentation_xml_converter(node).convert(@filename + ".xml")
|
@@ -75,12 +40,6 @@ module Asciidoctor
|
|
75
40
|
pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
|
76
41
|
end
|
77
42
|
|
78
|
-
def validate(doc)
|
79
|
-
content_validate(doc)
|
80
|
-
schema_validate(formattedstr_strip(doc.dup),
|
81
|
-
File.join(File.dirname(__FILE__), "m3d.rng"))
|
82
|
-
end
|
83
|
-
|
84
43
|
def sections_cleanup(x)
|
85
44
|
super
|
86
45
|
x.xpath("//*[@inline-header]").each do |h|
|
@@ -88,10 +47,6 @@ module Asciidoctor
|
|
88
47
|
end
|
89
48
|
end
|
90
49
|
|
91
|
-
def style(n, t)
|
92
|
-
return
|
93
|
-
end
|
94
|
-
|
95
50
|
def presentation_xml_converter(node)
|
96
51
|
IsoDoc::M3AAWG::PresentationXMLConvert.new(html_extract_attributes(node))
|
97
52
|
end
|
@@ -24,6 +24,14 @@
|
|
24
24
|
<start>
|
25
25
|
<ref name="standard-document"/>
|
26
26
|
</start>
|
27
|
+
<define name="doctype">
|
28
|
+
<element name="doctype">
|
29
|
+
<optional>
|
30
|
+
<attribute name="abbreviation"/>
|
31
|
+
</optional>
|
32
|
+
<ref name="DocumentType"/>
|
33
|
+
</element>
|
34
|
+
</define>
|
27
35
|
<define name="hyperlink">
|
28
36
|
<element name="link">
|
29
37
|
<attribute name="target">
|
@@ -47,6 +55,13 @@
|
|
47
55
|
<param name="pattern">\i\c*|\c+#\c+</param>
|
48
56
|
</data>
|
49
57
|
</attribute>
|
58
|
+
<optional>
|
59
|
+
<attribute name="to">
|
60
|
+
<data type="string">
|
61
|
+
<param name="pattern">\i\c*|\c+#\c+</param>
|
62
|
+
</data>
|
63
|
+
</attribute>
|
64
|
+
</optional>
|
50
65
|
<optional>
|
51
66
|
<attribute name="type">
|
52
67
|
<ref name="ReferenceFormat"/>
|
@@ -141,6 +156,11 @@
|
|
141
156
|
<data type="boolean"/>
|
142
157
|
</attribute>
|
143
158
|
</optional>
|
159
|
+
<optional>
|
160
|
+
<attribute name="key">
|
161
|
+
<data type="boolean"/>
|
162
|
+
</attribute>
|
163
|
+
</optional>
|
144
164
|
<oneOrMore>
|
145
165
|
<ref name="dt"/>
|
146
166
|
<ref name="dd"/>
|
@@ -233,6 +253,9 @@
|
|
233
253
|
<data type="boolean"/>
|
234
254
|
</attribute>
|
235
255
|
</optional>
|
256
|
+
<optional>
|
257
|
+
<ref name="colgroup"/>
|
258
|
+
</optional>
|
236
259
|
<optional>
|
237
260
|
<ref name="tname"/>
|
238
261
|
</optional>
|
@@ -751,6 +774,18 @@
|
|
751
774
|
</define>
|
752
775
|
</include>
|
753
776
|
<!-- end overrides -->
|
777
|
+
<define name="colgroup">
|
778
|
+
<element name="colgroup">
|
779
|
+
<oneOrMore>
|
780
|
+
<ref name="col"/>
|
781
|
+
</oneOrMore>
|
782
|
+
</element>
|
783
|
+
</define>
|
784
|
+
<define name="col">
|
785
|
+
<element name="col">
|
786
|
+
<attribute name="width"/>
|
787
|
+
</element>
|
788
|
+
</define>
|
754
789
|
<define name="TextElement" combine="choice">
|
755
790
|
<ref name="concept"/>
|
756
791
|
</define>
|
@@ -1164,49 +1199,7 @@
|
|
1164
1199
|
</define>
|
1165
1200
|
<define name="annex">
|
1166
1201
|
<element name="annex">
|
1167
|
-
<
|
1168
|
-
<attribute name="id">
|
1169
|
-
<data type="ID"/>
|
1170
|
-
</attribute>
|
1171
|
-
</optional>
|
1172
|
-
<optional>
|
1173
|
-
<attribute name="language"/>
|
1174
|
-
</optional>
|
1175
|
-
<optional>
|
1176
|
-
<attribute name="script"/>
|
1177
|
-
</optional>
|
1178
|
-
<optional>
|
1179
|
-
<attribute name="inline-header">
|
1180
|
-
<data type="boolean"/>
|
1181
|
-
</attribute>
|
1182
|
-
</optional>
|
1183
|
-
<attribute name="obligation">
|
1184
|
-
<choice>
|
1185
|
-
<value>normative</value>
|
1186
|
-
<value>informative</value>
|
1187
|
-
</choice>
|
1188
|
-
</attribute>
|
1189
|
-
<optional>
|
1190
|
-
<ref name="section-title"/>
|
1191
|
-
</optional>
|
1192
|
-
<group>
|
1193
|
-
<group>
|
1194
|
-
<zeroOrMore>
|
1195
|
-
<ref name="BasicBlock"/>
|
1196
|
-
</zeroOrMore>
|
1197
|
-
<zeroOrMore>
|
1198
|
-
<ref name="note"/>
|
1199
|
-
</zeroOrMore>
|
1200
|
-
</group>
|
1201
|
-
<zeroOrMore>
|
1202
|
-
<choice>
|
1203
|
-
<ref name="annex-subsection"/>
|
1204
|
-
<ref name="terms"/>
|
1205
|
-
<ref name="definitions"/>
|
1206
|
-
<ref name="references"/>
|
1207
|
-
</choice>
|
1208
|
-
</zeroOrMore>
|
1209
|
-
</group>
|
1202
|
+
<ref name="Annex-Section"/>
|
1210
1203
|
</element>
|
1211
1204
|
</define>
|
1212
1205
|
<define name="terms">
|
@@ -3,18 +3,8 @@ require "fileutils"
|
|
3
3
|
module IsoDoc
|
4
4
|
module M3AAWG
|
5
5
|
module BaseRender
|
6
|
-
def
|
7
|
-
|
8
|
-
term_cleanup(docxml)
|
9
|
-
end
|
10
|
-
|
11
|
-
def term_cleanup(docxml)
|
12
|
-
docxml.xpath("//p[@class = 'Terms']").each do |d|
|
13
|
-
h2 = d.at("./preceding-sibling::*[@class = 'TermNum'][1]")
|
14
|
-
h2.add_child(" ")
|
15
|
-
h2.add_child(d.remove)
|
16
|
-
end
|
17
|
-
docxml
|
6
|
+
def configuration
|
7
|
+
Metanorma::M3AAWG.configuration
|
18
8
|
end
|
19
9
|
end
|
20
10
|
end
|
@@ -118,6 +118,10 @@ b, strong {
|
|
118
118
|
div.document-stage-band, div.document-type-band {
|
119
119
|
background-color: #333333; }
|
120
120
|
|
121
|
+
a.FootnoteRef + a.FootnoteRef:before {
|
122
|
+
content: ", ";
|
123
|
+
vertical-align: super; }
|
124
|
+
|
121
125
|
#standard-band {
|
122
126
|
background-color: #0AC442; }
|
123
127
|
|
@@ -224,7 +228,7 @@ body {
|
|
224
228
|
margin-left: auto;
|
225
229
|
margin-right: auto;
|
226
230
|
max-width: 100%;
|
227
|
-
font-size:
|
231
|
+
font-size: {{normalfontsize}};
|
228
232
|
font-weight: 300;
|
229
233
|
line-height: 1.4em;
|
230
234
|
color: #1d1d1d;
|
@@ -662,7 +666,7 @@ p.Biblio, p.NormRef {
|
|
662
666
|
pre,
|
663
667
|
.pseudocode {
|
664
668
|
background-color: #F5F6F6;
|
665
|
-
font-size:
|
669
|
+
font-size: {{monospacefontsize}};
|
666
670
|
line-height: 1.6em;
|
667
671
|
padding: 1.5em;
|
668
672
|
margin: 2em 0 1em 0;
|
@@ -785,7 +789,7 @@ a.footnote-number {
|
|
785
789
|
font-size: 0.8em; }
|
786
790
|
|
787
791
|
.footnote {
|
788
|
-
font-size:
|
792
|
+
font-size: {{footnotefontsize}}; }
|
789
793
|
|
790
794
|
/*
|
791
795
|
3.11 Blockquotes
|
@@ -18,7 +18,7 @@ Light Gray: #F5F6F6
|
|
18
18
|
@import 'base_style/all';
|
19
19
|
|
20
20
|
body {
|
21
|
-
@include bodyStyle1(
|
21
|
+
@include bodyStyle1($normalfontsize, 1.4em, #1d1d1d, #ffffff, 300);
|
22
22
|
}
|
23
23
|
|
24
24
|
#report {
|
@@ -431,7 +431,7 @@ a.footnote-number {
|
|
431
431
|
}
|
432
432
|
|
433
433
|
.footnote {
|
434
|
-
font-size:
|
434
|
+
font-size: $footnotefontsize;
|
435
435
|
}
|
436
436
|
|
437
437
|
|