asciidoctor-rsd 0.3.1 → 0.3.2

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: 2723df1c0ac9bb06a222642149ea3d90dbf267638b0782e3368982ef5ca81598
4
- data.tar.gz: e75ebd707565d73372c8feabc3d0840f2d7bbf9c5dc7a73e7add5afba800bfce
3
+ metadata.gz: e526a0019eca20c9c067e73648cc475bc832be4b28236e8eb44d5b4db09c3943
4
+ data.tar.gz: 34fd9a52e1c5fa4cb258e268fd70b3689e77292393d0058fd4bb788d67316ca8
5
5
  SHA512:
6
- metadata.gz: 8f513ee8972d8d48d2076b3555236aaa570cc12705ac693d6e9d6f72b05b95397fbc155672887567aaba44bfc96be57fd17e2423c00040ac9e5ad4fb601d42a5
7
- data.tar.gz: 9b72a04b926ba90fafc6fb88c41a0c6fdb6dafa838139c0eb785c067cb95134e0071b44b53b64a2394143f35cd9253710a40b49fd01e6740d74a8df57dad54fe
6
+ metadata.gz: b54fca6af0a03b5975faf337cc8cc865c859229b9d3444774f36d92c198da12cf1904c38967d34e742bc4134402223a3872b48a9ae87e647dda901cda2ddef25
7
+ data.tar.gz: 7307404bd340d97a68687721bcc79f3e9579e9f29a0d660adca957da48d49c9b570afb8c5aafcac78c1d25f70e431277d29acabcf9db1b7a7b0456783fa519b7
@@ -1,12 +1,12 @@
1
1
  GIT
2
2
  remote: https://github.com/riboseinc/asciidoctor-iso
3
- revision: 1a28d27a2ea737a42ba1f01501bb11ff41b4551e
3
+ revision: 817ec3dc9345b85e3464bb9e4385562dbcdd9e9f
4
4
  specs:
5
- asciidoctor-iso (0.9.0)
5
+ asciidoctor-iso (0.9.5)
6
6
  asciidoctor (~> 1.5.7)
7
- iso-bib-item (~> 0.1.6)
8
- isobib (~> 0.1.6)
7
+ iev (~> 0.1.0)
9
8
  isodoc (>= 0.8)
9
+ relaton (~> 0.0.1)
10
10
  ruby-jing
11
11
 
12
12
  GIT
@@ -25,9 +25,9 @@ GIT
25
25
 
26
26
  GIT
27
27
  remote: https://github.com/riboseinc/isodoc
28
- revision: 601c1870fea386cb54fd8b2f112f680f71bd58a3
28
+ revision: adf9e4abfe0a9d0270b271bcadb075fc577b7a78
29
29
  specs:
30
- isodoc (0.8)
30
+ isodoc (0.8.1)
31
31
  asciimath
32
32
  html2doc (>= 0.7.1)
33
33
  htmlentities (~> 4.3.4)
@@ -44,7 +44,7 @@ GIT
44
44
  PATH
45
45
  remote: .
46
46
  specs:
47
- asciidoctor-rsd (0.3.0)
47
+ asciidoctor-rsd (0.3.2)
48
48
  asciidoctor (~> 1.5.7)
49
49
  asciidoctor-iso (>= 0.8.0)
50
50
  asciimath
@@ -65,9 +65,52 @@ GEM
65
65
  httpclient (~> 2.8, >= 2.8.3)
66
66
  json (>= 1.5.1)
67
67
  asciidoctor (1.5.7.1)
68
+ asciidoctor-csand (0.3.1)
69
+ asciidoctor (~> 1.5.7)
70
+ asciidoctor-iso (>= 0.9.0)
71
+ asciimath
72
+ htmlentities (~> 4.3.4)
73
+ image_size
74
+ isodoc (>= 0.8.0)
75
+ mime-types
76
+ nokogiri
77
+ ruby-jing
78
+ ruby-xslt
79
+ thread_safe
80
+ uuidtools
81
+ asciidoctor-csd (0.4.2)
82
+ asciidoctor-iso (>= 0.9.0)
83
+ isodoc (>= 0.8.0)
84
+ asciidoctor-gb (0.3.2)
85
+ asciidoctor-iso (>= 0.9.0)
86
+ gbbib
87
+ isodoc (>= 0.8.0)
88
+ twitter_cldr
89
+ asciidoctor-m3d (0.3.2)
90
+ asciidoctor (~> 1.5.7)
91
+ asciidoctor-iso (>= 0.9.0)
92
+ asciimath
93
+ htmlentities (~> 4.3.4)
94
+ image_size
95
+ isodoc (>= 0.8.0)
96
+ mime-types
97
+ nokogiri
98
+ ruby-jing
99
+ ruby-xslt
100
+ thread_safe
101
+ uuidtools
102
+ asciidoctor-rfc (0.9.0)
103
+ asciidoctor (~> 1.5.7)
104
+ htmlentities (~> 4.3.4)
105
+ nokogiri
106
+ ruby-jing
107
+ thread_safe
68
108
  asciimath (1.0.4)
69
109
  ast (2.4.0)
70
110
  byebug (9.1.0)
111
+ camertron-eprun (1.1.1)
112
+ cldr-plurals-runtime-rb (1.0.1)
113
+ cnccs (0.1.1)
71
114
  coderay (1.1.2)
72
115
  diff-lcs (1.3)
73
116
  docile (1.3.1)
@@ -76,6 +119,9 @@ GEM
76
119
  nokogiri (>= 1.4.3)
77
120
  ffi (1.9.25)
78
121
  formatador (0.2.5)
122
+ gbbib (0.1.4)
123
+ cnccs
124
+ iso-bib-item
79
125
  guard (2.14.2)
80
126
  formatador (>= 0.2.4)
81
127
  listen (>= 2.7, < 4.0)
@@ -92,14 +138,16 @@ GEM
92
138
  rspec (>= 2.99.0, < 4.0)
93
139
  htmlentities (4.3.4)
94
140
  httpclient (2.8.3)
141
+ iev (0.1.0)
142
+ nokogiri
95
143
  image_size (2.0.0)
96
- iso-bib-item (0.1.6)
97
- duplicate
144
+ iso-bib-item (0.1.10)
145
+ duplicate (~> 1.1.1)
98
146
  isoics (~> 0.1.6)
99
147
  nokogiri
100
- isobib (0.1.6)
148
+ isobib (0.1.9)
101
149
  algoliasearch
102
- iso-bib-item (~> 0.1.2)
150
+ iso-bib-item (~> 0.1.10)
103
151
  isoics (0.1.6)
104
152
  jaro_winkler (1.5.1)
105
153
  json (2.1.0)
@@ -109,13 +157,22 @@ GEM
109
157
  rb-inotify (~> 0.9, >= 0.9.7)
110
158
  ruby_dep (~> 1.2)
111
159
  lumberjack (1.0.13)
160
+ metanorma (0.2.5)
161
+ asciidoctor-csand (>= 0.3.0)
162
+ asciidoctor-csd (>= 0.4.0)
163
+ asciidoctor-gb (>= 0.3.0)
164
+ asciidoctor-iso (>= 0.9.1)
165
+ asciidoctor-m3d (>= 0.3.1)
166
+ asciidoctor-rfc (>= 0.9.0)
167
+ asciidoctor-rsd (>= 0.3.0)
168
+ isodoc (>= 0.8.0)
112
169
  method_source (0.9.0)
113
170
  mime-types (3.1)
114
171
  mime-types-data (~> 3.2015)
115
172
  mime-types-data (3.2016.0521)
116
173
  mini_portile2 (2.3.0)
117
174
  nenv (0.3.0)
118
- nokogiri (1.8.3)
175
+ nokogiri (1.8.4)
119
176
  mini_portile2 (~> 2.3.0)
120
177
  notiffany (0.1.1)
121
178
  nenv (~> 0.1)
@@ -133,6 +190,15 @@ GEM
133
190
  rb-fsevent (0.10.3)
134
191
  rb-inotify (0.9.10)
135
192
  ffi (>= 0.5.0, < 2)
193
+ relaton (0.0.1)
194
+ asciidoctor (~> 1.5.7)
195
+ gbbib (~> 0.1.0)
196
+ iev (~> 0.1.0)
197
+ iso-bib-item (~> 0.1.6)
198
+ isobib (~> 0.1.8)
199
+ rfcbib (~> 0.1.0)
200
+ rfcbib (0.1.1)
201
+ iso-bib-item (~> 0.1.10)
136
202
  roman-numerals (0.3.0)
137
203
  rspec (3.7.0)
138
204
  rspec-core (~> 3.7.0)
@@ -174,6 +240,12 @@ GEM
174
240
  thor (0.20.0)
175
241
  thread_safe (0.3.6)
176
242
  timecop (0.9.1)
243
+ twitter_cldr (4.4.3)
244
+ camertron-eprun
245
+ cldr-plurals-runtime-rb (~> 1.0)
246
+ tzinfo
247
+ tzinfo (1.2.5)
248
+ thread_safe (~> 0.1)
177
249
  unicode-display_width (1.4.0)
178
250
  uuidtools (2.1.5)
179
251
 
@@ -190,6 +262,7 @@ DEPENDENCIES
190
262
  guard-rspec (~> 4.7)
191
263
  html2doc!
192
264
  isodoc!
265
+ metanorma
193
266
  rake (~> 12.0)
194
267
  rspec (~> 3.6)
195
268
  rubocop (~> 0.50)
@@ -28,20 +28,21 @@ expressions.
28
28
  International Standards.
29
29
  * The XML representation is processed in turn to generate the following outputs
30
30
  as end deliverable RSD standard drafts.
31
- ** Microsoft Word output (`.doc`), following the style conventions of the
32
- https://www.rsd.org/rsd-templates.html[RSD Standard Microsoft Word template].
33
- (In development)
34
- ** PDF (forthcoming)
35
- ** HTML (forthcoming)
31
+ ** DOC
32
+ ** HTML
36
33
 
37
34
  This AsciiDoc syntax for writing RSD standards is hereby named "AsciiRSD".
38
35
 
39
36
  == Usage
40
37
 
38
+ The preferred way to invoke this gem is via the `metanorma` script:
39
+
41
40
  [source,console]
42
41
  ----
43
- $ asciidoctor a.adoc # HTML output of Asciidoc file
44
- $ asciidoctor -b rsd -r 'asciidoctor-rsd' a.adoc # RSD XML output
42
+ $ metanorma --type rsd a.adoc # output HTML and DOC
43
+ $ metanorma --type rsd --extensions html a.adoc # output just HTML
44
+ $ metanorma --type rsd --extensions doc a.adoc # output just DOC
45
+ $ metanorma --type rsd --extensions xml a.adoc # output RSD XML
45
46
  ----
46
47
 
47
48
  The gem translates the document into RSD XML format, and then
@@ -50,39 +51,27 @@ reported to console against the XML, and are intended for users to
50
51
  check that they have provided all necessary components of the
51
52
  document.
52
53
 
53
- TODO: The gem will then convert the XML to Word Document, HTML, and
54
- PDF, and output those files with the appropriate file suffixes.
55
- `lib/asciidoctor/rsd/rsd2wordhtml.rb` is work in progress, and not yet
56
- integrated into the executable.
57
-
58
- === Content Warnings
59
-
60
- The gem also realises several format checks as prescribed in ISO/IEC
61
- DIR 2, and warns the user about them in the console:
62
-
63
- * Numbers with what looks like dots instead of commas for decimal points.
64
-
65
- * Groups of numbers without spacing for every three digits. (The gem attempts
66
- to ignore RSD references.)
54
+ The gem then converts the XML into HTML and PDF.
67
55
 
68
- * No space before percent sign.
56
+ The gem can also be invoked directly within asciidoctor, though this is deprecated:
69
57
 
70
- * No bracketing of tolerance in percentage (e.g. `15 ± 7 % .`)
71
-
72
- * No recommendations, permissions or requirements (detected by keyword) in:
73
- foreword, scope, introduction, term examples and examples, notes, footnotes.
74
-
75
- * No subclauses that are the only child of a clause. (In clauses, annexes, or
76
- scopes.)
58
+ [source,console]
59
+ ----
60
+ $ asciidoctor -b rsd -r 'asciidoctor-rsd' a.adoc
61
+ ----
77
62
 
78
- * 5 levels of subclause nesting. (Never actuated, AsciiDoc only permits 4
79
- levels of subsections.)
63
+ === Installation
80
64
 
81
- * Non-RSD/IEC reference turning up as normative.
65
+ If you are using a Mac, the https://github.com/riboseinc/metanorma-macos-setup
66
+ repository has instructions on setting up your machine to run Metanorma
67
+ scripts such as this one. You need only run the following in a Terminal console:
82
68
 
83
- * Term definition starts with an article, or ends with a period.
69
+ [source,console]
70
+ ----
71
+ $ bash <(curl -s https://raw.githubusercontent.com/riboseinc/metanorma-macos-setup/master/metanorma-setup)
72
+ $ gem install asciidoctor-rsd
73
+ ----
84
74
 
85
- * Title intro or title part appears in only one of French or English.
86
75
 
87
76
  == Approach
88
77
 
@@ -119,102 +108,6 @@ recognised by fixed titles such as `Normative References`). Authoring RSD
119
108
  standards in this fashion assumes that users will be populating an Asciidoc
120
109
  template, and not removing needed formatting instructions.
121
110
 
122
- === Features not visible in HTML preview
123
-
124
- The gem uses built-in Asciidoc formatting as much as possible, so that users
125
- can retain the ability to preview documents; for _Terms and Definitions_
126
- clauses, which have a good deal of explicit structure, macros have been
127
- introduced for semantic markup (admitted terms, deprecated terms, etc). The
128
- default HTML output of an Asciidoc-formatted RSD document is quite close to the
129
- intended final output, with the following exceptions. Note that the final
130
- outputs of the conversion (Microsoft Word, PDF, HTML) do not have these exceptions,
131
- and comply with the RSD Standard specifications.
132
-
133
- * _Terms and Definitions_: each term is marked up as an unnumbered subclause,
134
- the semantic markup of alternate and other terms is not rendered visually.
135
-
136
- * _Formulas_: Asciidoctor has no provision for the automated numbering of
137
- isolated block formulas ("stem"), and does not display the number assigned a
138
- block formula in its default HTML processor—although it does provide automated
139
- numbering of examples. Formula numbering is provided in the final outputs
140
- of the conversion.
141
-
142
- * _Missing elements_: The document model does not yet include Asciidoc elements
143
- that do not appear to be relevant to RSD Standards; these will be ignored in
144
- generating RSD XML. Those elements include:
145
- * sidebars (`aside`) (as distinct from warnings),
146
- * ASCII art/preformatted text (`literal`) (as distinct from sourcecode listings),
147
- * page breaks (`thematic break`).
148
-
149
- * _Markup_: Some connecting text which is used to convey markup structure is
150
- left out: in particular, `DEPRECATED` and `SOURCE` (replaced by formatting
151
- macros).
152
-
153
- * _Tables_: Table footnotes are treated like all other footnotes: they are
154
- rendered at the bottom of the document, rather than the bottom of the table,
155
- and they are not numbered separately.
156
-
157
- * _Cross-references_: Footnoted cross-references are indicated with the reference
158
- text `fn` in rsdlation, or `fn:` as a prefix to the reference text. The default
159
- HTML processor leaves these as is: if no reference text is given, only `fn`
160
- will be displayed (though it will still hyperlink to the right reference).
161
-
162
- * _References_: The convention for references is that RSD documents are cited
163
- without brackets by RSD number, and optionally year, whether they are normative
164
- or in the bibliography (e.g. `RSD 20483:2013`); while all other references are
165
- cited by bracketed number in the bibliography (e.g. `[1]`). The default HTML
166
- processor treats all references the same, and will bracket them (e.g. `[RSD
167
- 20483:2013]`). For the same reason, RSD references listed in the bibliography
168
- will be listed under an RSD reference, rather than a bracketed number.
169
-
170
- * _References_: References are rendered cited throughout, since they are
171
- automated. For that reason, if reference is to be made to both an undated and a
172
- dated version of an RSD reference, these need to be explicitly listed as
173
- separate references. (This is not done in the Rice model document, which lists
174
- RSD 6646, but under _Terms and Definitions_ cites the dated RSD 6646:2011.
175
-
176
- * _References_: RSD references that are undated but published have their date
177
- indicated under the RSD standards format in an explanatory footnote. Because of
178
- constraints introduced by Asciidoctor, that explanation is instead given in
179
- square brackets in Asciidoc format.
180
-
181
- * _Annexes_: Subheadings cannot preserve subsection numbering, while also
182
- appearing inline with their text (e.g. Rice document, Annex B.2): they appear
183
- as headings in separate lines.
184
-
185
- * _Annexes_: Cross-references to Annex subclauses are automatically prefixed
186
- with `Clause` rather than `Annex` or nothing.
187
-
188
- * _Metadata_: Document metadata such as document numbers, technical committees
189
- and title wording are not rendered in the default HTML output.
190
-
191
- * _Patent Notice_: Patent notices are treated and rendered as a subsection of
192
- the introduction, with an explicit subheading.
193
-
194
- * _Numbering_: The numbering of figures and tables is sequential in the default
195
- HTML processor: it does not include the Clause or Annex number. This,
196
- _Figure 1_, not _Figure A.1_.
197
-
198
- * _Notes_: There is no automatic note numbering by the default HTML processor.
199
-
200
- * _Review Notes_: The reviewer on the review note is not displayed.
201
-
202
- * _Keys_: Keys to formulas and figures are expected to be marked up as
203
- definition lists consistently, rather than as inline prose.
204
-
205
- * _Figures_: Simple figures are marked up as images, figures containing
206
- subfigures as examples. Numbering by the default HTML processor may be
207
- inconsistent. Subfigures are automatically numbered as independent figures.
208
-
209
- * _Markup_: The default HTML processor does not support CSS extensions such as
210
- small caps or strike through, though these can be marked up as CSS classes
211
- through custom macros in Asciidoctor: a custom CSS stylesheet will be needed to
212
- render them.
213
-
214
-
215
-
216
- TODO: May need to only encode figures as examples.
217
-
218
111
  == Document Attributes
219
112
 
220
113
  The gem relies on Asciidoctor document attributes to provide necessary
@@ -235,19 +128,23 @@ introduced with `=`, is ignored)
235
128
  RSD publications) (mandatory). The permitted types are:
236
129
  +
237
130
  --
238
- code:: Code Artifact
239
- presentation:: Presentation
240
- proposal:: Proposal; includes IETF DRAFT
241
- standard:: Recommendation; includes IETF RFC
242
- report:: report
131
+ * policy-and-procedures
132
+ * best-practices
133
+ * supporting-document
134
+ * report
135
+ * legal
136
+ * directives
137
+ * proposal
138
+ * standard
243
139
  --
244
140
 
245
141
  `:status:``:: The document status. The permitted types are: `proposal`,
246
142
  `working-draft`, `committee-draft`, `draft-standard`, `final-draft`,
247
143
  `published`, `withdrawn`.
248
144
 
249
- `:technical-committee:`:: The name of the relevant RSD technical committee
250
- (mandatory)
145
+ `:committee:`:: The name of the relevant RSD committee (mandatory)
146
+ `:committee-type:`:: The type of the relevant RSD committee (mandatory): `technical`
147
+ or `provisional`.
251
148
 
252
149
  `:language:` :: The language of the document (only `en` for now) (mandatory)
253
150
 
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  DESCRIPTION
17
17
 
18
18
  spec.homepage = "https://github.com/riboseinc/asciidoctor-rsd"
19
- spec.license = "MIT"
19
+ spec.license = "BSD-2-Clause"
20
20
 
21
21
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
22
22
  f.match(%r{^(test|spec|features)/})
@@ -49,4 +49,5 @@ Gem::Specification.new do |spec|
49
49
  spec.add_development_dependency "rubocop", "~> 0.50"
50
50
  spec.add_development_dependency "simplecov", "~> 0.15"
51
51
  spec.add_development_dependency "timecop", "~> 0.9"
52
+ spec.add_development_dependency "metanorma"
52
53
  end
@@ -37,7 +37,7 @@
37
37
  <define name="edition">
38
38
  <a:documentation>ISO-15924: Latn</a:documentation>
39
39
  <element name="edition">
40
- <data type="int"/>
40
+ <text/>
41
41
  </element>
42
42
  </define>
43
43
  <define name="LocalizedString">
@@ -102,9 +102,12 @@
102
102
  <attribute name="type">
103
103
  <choice>
104
104
  <value>author</value>
105
- <value>edition</value>
105
+ <value>performer</value>
106
106
  <value>publisher</value>
107
- <text/>
107
+ <value>editor</value>
108
+ <value>adapter</value>
109
+ <value>translator</value>
110
+ <value>distributor</value>
108
111
  </choice>
109
112
  </attribute>
110
113
  </optional>
@@ -145,18 +148,26 @@
145
148
  </define>
146
149
  <define name="fullname">
147
150
  <element name="name">
151
+ <choice>
152
+ <group>
153
+ <zeroOrMore>
154
+ <ref name="prefix"/>
155
+ </zeroOrMore>
156
+ <zeroOrMore>
157
+ <ref name="forename"/>
158
+ </zeroOrMore>
159
+ <zeroOrMore>
160
+ <ref name="initial"/>
161
+ </zeroOrMore>
162
+ <ref name="surname"/>
163
+ <zeroOrMore>
164
+ <ref name="addition"/>
165
+ </zeroOrMore>
166
+ </group>
167
+ <ref name="completeName"/>
168
+ </choice>
148
169
  <zeroOrMore>
149
- <ref name="prefix"/>
150
- </zeroOrMore>
151
- <zeroOrMore>
152
- <ref name="forename"/>
153
- </zeroOrMore>
154
- <zeroOrMore>
155
- <ref name="initial"/>
156
- </zeroOrMore>
157
- <ref name="surname"/>
158
- <zeroOrMore>
159
- <ref name="addition"/>
170
+ <ref name="biblionote"/>
160
171
  </zeroOrMore>
161
172
  </element>
162
173
  </define>
@@ -185,6 +196,11 @@
185
196
  <ref name="LocalizedString"/>
186
197
  </element>
187
198
  </define>
199
+ <define name="completeName">
200
+ <element name="completename">
201
+ <ref name="LocalizedString"/>
202
+ </element>
203
+ </define>
188
204
  <define name="affiliation">
189
205
  <element name="affiliation">
190
206
  <optional>
@@ -209,6 +225,9 @@
209
225
  <define name="organization">
210
226
  <element name="organization">
211
227
  <ref name="orgname"/>
228
+ <optional>
229
+ <ref name="subdivision"/>
230
+ </optional>
212
231
  <optional>
213
232
  <ref name="abbreviation"/>
214
233
  </optional>
@@ -228,6 +247,11 @@
228
247
  <ref name="LocalizedString"/>
229
248
  </element>
230
249
  </define>
250
+ <define name="subdivision">
251
+ <element name="subdivision">
252
+ <ref name="LocalizedString"/>
253
+ </element>
254
+ </define>
231
255
  <define name="abbreviation">
232
256
  <element name="abbreviation">
233
257
  <ref name="LocalizedString"/>
@@ -346,19 +370,21 @@
346
370
  </define>
347
371
  <define name="locality">
348
372
  <element name="locality">
349
- <!-- attribute type { ( "section" | "clause" | "part" | "paragraph" | "chapter" | "page" | "whole" | "table" | "annex" | "figure" | "note" | "example" | ("locality:", text) ) }, -->
350
- <attribute name="type">
351
- <ref name="LocalityType"/>
352
- </attribute>
353
- <ref name="referenceFrom"/>
354
- <optional>
355
- <ref name="referenceTo"/>
356
- </optional>
373
+ <ref name="BibItemLocality"/>
357
374
  </element>
358
375
  </define>
376
+ <define name="BibItemLocality">
377
+ <attribute name="type">
378
+ <ref name="LocalityType"/>
379
+ </attribute>
380
+ <ref name="referenceFrom"/>
381
+ <optional>
382
+ <ref name="referenceTo"/>
383
+ </optional>
384
+ </define>
359
385
  <define name="LocalityType">
360
386
  <data type="string">
361
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|example|locality:[a-zA-Z0-9_]+</param>
387
+ <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|example|volume|issue|locality:[a-zA-Z0-9_]+</param>
362
388
  </data>
363
389
  </define>
364
390
  <define name="referenceFrom">
@@ -398,6 +424,18 @@
398
424
  <value>techreport</value>
399
425
  <value>standard</value>
400
426
  <value>unpublished</value>
427
+ <value>map</value>
428
+ <value>electronic resource</value>
429
+ <value>audiovisual</value>
430
+ <value>film</value>
431
+ <value>video</value>
432
+ <value>broadcast</value>
433
+ <value>graphic work</value>
434
+ <value>music</value>
435
+ <value>patent</value>
436
+ <value>inbook</value>
437
+ <value>incollection</value>
438
+ <value>inproceedings</value>
401
439
  </choice>
402
440
  </define>
403
441
  <define name="BibliographicItem">
@@ -442,20 +480,41 @@
442
480
  <optional>
443
481
  <ref name="status"/>
444
482
  </optional>
445
- <zeroOrMore>
483
+ <optional>
446
484
  <ref name="copyright"/>
447
- </zeroOrMore>
485
+ </optional>
448
486
  <zeroOrMore>
449
487
  <ref name="docrelation"/>
450
488
  </zeroOrMore>
489
+ <zeroOrMore>
490
+ <ref name="series"/>
491
+ </zeroOrMore>
492
+ <optional>
493
+ <ref name="medium"/>
494
+ </optional>
495
+ <zeroOrMore>
496
+ <ref name="bplace"/>
497
+ </zeroOrMore>
498
+ <zeroOrMore>
499
+ <ref name="extent"/>
500
+ </zeroOrMore>
501
+ <zeroOrMore>
502
+ <ref name="accesslocation"/>
503
+ </zeroOrMore>
504
+ <optional>
505
+ <ref name="bclassification"/>
506
+ </optional>
507
+ <optional>
508
+ <ref name="validity"/>
509
+ </optional>
451
510
  </define>
452
511
  <define name="btitle">
453
512
  <element name="title">
454
- <ref name="FormattedString"/>
513
+ <ref name="TypedTitleString"/>
455
514
  </element>
456
515
  </define>
457
516
  <define name="bsource">
458
- <element name="source">
517
+ <element name="uri">
459
518
  <ref name="TypedUri"/>
460
519
  </element>
461
520
  </define>
@@ -464,17 +523,68 @@
464
523
  <ref name="FormattedString"/>
465
524
  </element>
466
525
  </define>
467
- <define name="link">
468
- <element name="link">
469
- <ref name="TypedUri"/>
526
+ <define name="validity">
527
+ <element name="validity">
528
+ <optional>
529
+ <ref name="validityBegins"/>
530
+ </optional>
531
+ <optional>
532
+ <ref name="validityEnds"/>
533
+ </optional>
534
+ <optional>
535
+ <ref name="validityRevision"/>
536
+ </optional>
537
+ </element>
538
+ </define>
539
+ <define name="validityBegins">
540
+ <element name="validityBegins">
541
+ <data type="dateTime"/>
542
+ </element>
543
+ </define>
544
+ <define name="validityEnds">
545
+ <element name="validityEnds">
546
+ <data type="dateTime"/>
470
547
  </element>
471
548
  </define>
549
+ <define name="validityRevision">
550
+ <element name="revision">
551
+ <data type="dateTime"/>
552
+ </element>
553
+ </define>
554
+ <define name="TypedTitleString">
555
+ <optional>
556
+ <attribute name="type">
557
+ <ref name="TitleType"/>
558
+ </attribute>
559
+ </optional>
560
+ <ref name="FormattedString"/>
561
+ </define>
562
+ <define name="TitleType">
563
+ <choice>
564
+ <value>alternative</value>
565
+ <value>original</value>
566
+ <value>unofficial</value>
567
+ <value>subtitle</value>
568
+ <value>main</value>
569
+ </choice>
570
+ </define>
472
571
  <define name="TypedUri">
473
572
  <optional>
474
573
  <attribute name="type"/>
475
574
  </optional>
476
575
  <data type="anyURI"/>
477
576
  </define>
577
+ <define name="DateType">
578
+ <optional>
579
+ <attribute name="text"/>
580
+ </optional>
581
+ <optional>
582
+ <choice>
583
+ <data type="gYear"/>
584
+ <data type="date"/>
585
+ </choice>
586
+ </optional>
587
+ </define>
478
588
  <define name="bdate">
479
589
  <element name="date">
480
590
  <attribute name="type">
@@ -487,9 +597,10 @@
487
597
  <value>confirmed</value>
488
598
  <value>updated</value>
489
599
  <value>issued</value>
600
+ <value>transmitted</value>
601
+ <value>copied</value>
490
602
  </choice>
491
603
  </attribute>
492
- <!-- ( ( bfrom, bto? ) | date_on ) -->
493
604
  <choice>
494
605
  <group>
495
606
  <element name="from">
@@ -516,35 +627,126 @@
516
627
  </choice>
517
628
  </element>
518
629
  </define>
519
- <define name="bfrom">
520
- <element name="from">
630
+ <define name="docidentifier">
631
+ <element name="docidentifier">
632
+ <optional>
633
+ <attribute name="type"/>
634
+ </optional>
635
+ <text/>
636
+ </element>
637
+ </define>
638
+ <define name="bclassification">
639
+ <element name="classification">
640
+ <optional>
641
+ <attribute name="type"/>
642
+ </optional>
643
+ <text/>
644
+ </element>
645
+ </define>
646
+ <define name="bplace">
647
+ <element name="place">
648
+ <text/>
649
+ </element>
650
+ </define>
651
+ <define name="medium">
652
+ <element name="medium">
653
+ <optional>
654
+ <ref name="form"/>
655
+ </optional>
656
+ <optional>
657
+ <ref name="size"/>
658
+ </optional>
659
+ <optional>
660
+ <ref name="scale"/>
661
+ </optional>
662
+ </element>
663
+ </define>
664
+ <define name="form">
665
+ <element name="form">
666
+ <text/>
667
+ </element>
668
+ </define>
669
+ <define name="size">
670
+ <element name="size">
671
+ <text/>
672
+ </element>
673
+ </define>
674
+ <define name="scale">
675
+ <element name="scale">
676
+ <text/>
677
+ </element>
678
+ </define>
679
+ <define name="accesslocation">
680
+ <element name="accesslocation">
681
+ <text/>
682
+ </element>
683
+ </define>
684
+ <define name="extent">
685
+ <element name="extent">
686
+ <ref name="BibItemLocality"/>
687
+ </element>
688
+ </define>
689
+ <define name="series">
690
+ <element name="series">
691
+ <optional>
692
+ <attribute name="type">
693
+ <choice>
694
+ <value>main</value>
695
+ <value>alt</value>
696
+ </choice>
697
+ </attribute>
698
+ </optional>
521
699
  <choice>
522
- <data type="gYear"/>
523
- <data type="date"/>
700
+ <ref name="btitle"/>
701
+ <ref name="formattedref"/>
524
702
  </choice>
703
+ <ref name="bplace"/>
704
+ <ref name="seriesorganization"/>
705
+ <optional>
706
+ <ref name="abbreviation"/>
707
+ </optional>
708
+ <optional>
709
+ <ref name="seriesfrom"/>
710
+ </optional>
711
+ <optional>
712
+ <ref name="seriesto"/>
713
+ </optional>
714
+ <optional>
715
+ <ref name="seriesnumber"/>
716
+ </optional>
717
+ <optional>
718
+ <ref name="seriespartnumber"/>
719
+ </optional>
525
720
  </element>
526
721
  </define>
527
- <define name="bto">
528
- <element name="to">
722
+ <define name="seriesorganization">
723
+ <element name="organization">
724
+ <text/>
725
+ </element>
726
+ </define>
727
+ <define name="seriesfrom">
728
+ <element name="from">
529
729
  <choice>
730
+ <data type="dateTime"/>
530
731
  <data type="gYear"/>
531
- <data type="date"/>
532
732
  </choice>
533
733
  </element>
534
734
  </define>
535
- <define name="date_on">
536
- <element name="on">
735
+ <define name="seriesto">
736
+ <element name="to">
537
737
  <choice>
738
+ <data type="dateTime"/>
538
739
  <data type="gYear"/>
539
- <data type="date"/>
540
740
  </choice>
541
741
  </element>
542
742
  </define>
543
- <define name="docidentifier">
544
- <element name="docidentifier">
545
- <optional>
546
- <attribute name="type"/>
547
- </optional>
743
+ <define name="seriesnumber">
744
+ <element name="number">
745
+ <text/>
746
+ </element>
747
+ </define>
748
+ <define name="seriespartnumber">
749
+ <element name="partnumber">
548
750
  <text/>
549
751
  </element>
550
752
  </define>
@@ -586,17 +788,20 @@
586
788
  <element name="relation">
587
789
  <attribute name="type">
588
790
  <choice>
589
- <value>parent</value>
590
- <value>child</value>
591
791
  <value>obsoletes</value>
592
792
  <value>updates</value>
593
793
  <value>updatedBy</value>
594
794
  <value>complements</value>
595
795
  <value>derivedFrom</value>
796
+ <value>translatedFrom</value>
596
797
  <value>adoptedFrom</value>
597
798
  <value>equivalent</value>
598
799
  <value>identical</value>
599
800
  <value>nonequivalent</value>
801
+ <value>includedIn</value>
802
+ <value>includes</value>
803
+ <value>instance</value>
804
+ <value>partOf</value>
600
805
  </choice>
601
806
  </attribute>
602
807
  <element name="bibitem">
@@ -34,8 +34,8 @@ module Asciidoctor
34
34
 
35
35
  def metadata_committee(node, xml)
36
36
  xml.editorialgroup do |a|
37
- a.technical_committee node.attr("technical-committee"),
38
- **attr_code(type: node.attr("technical-committee-type"))
37
+ a.committee node.attr("committee"),
38
+ **attr_code(type: node.attr("committee-type"))
39
39
  end
40
40
  end
41
41
 
@@ -86,13 +86,20 @@ module Asciidoctor
86
86
 
87
87
  def doctype(node)
88
88
  d = node.attr("doctype")
89
- unless %w{policy best-practices supporting-document report legal directives}.include? d
89
+ unless %w{policy-and-procedures best-practices supporting-document report legal directives proposal standard}.include? d
90
90
  warn "#{d} is not a legal document type: reverting to 'standard'"
91
91
  d = "standard"
92
92
  end
93
93
  d
94
94
  end
95
95
 
96
+ def pdf_convert(filename)
97
+ url = "#{Dir.pwd}/#{filename}.html"
98
+ pdfjs = File.join(File.dirname(__FILE__), 'pdf.js')
99
+ system "export NODE_PATH=$(npm root --quiet -g);
100
+ node #{pdfjs} file://#{url} #{filename}.pdf"
101
+ end
102
+
96
103
  def document(node)
97
104
  init(node)
98
105
  ret1 = makexml(node)
@@ -103,6 +110,7 @@ module Asciidoctor
103
110
  File.open(filename, "w") { |f| f.write(ret) }
104
111
  html_converter(node).convert filename unless node.attr("nodoc")
105
112
  word_converter(node).convert filename unless node.attr("nodoc")
113
+ pdf_convert(filename.sub(/\.xml$/, "")) unless node.attr("nodoc")
106
114
  end
107
115
  @files_to_delete.each { |f| system "rm #{f}" }
108
116
  ret
@@ -998,7 +998,7 @@
998
998
  <ref name="formattedref"/>
999
999
  </optional>
1000
1000
  <zeroOrMore>
1001
- <ref name="source"/>
1001
+ <ref name="bsource"/>
1002
1002
  </zeroOrMore>
1003
1003
  <zeroOrMore>
1004
1004
  <ref name="docidentifier"/>
@@ -804,7 +804,7 @@
804
804
  <data type="int"/>
805
805
  </attribute>
806
806
  </optional>
807
- <data type="int"/>
807
+ <text/>
808
808
  </element>
809
809
  </define>
810
810
  <define name="tc-documentnumber">
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ try {
4
+ require.resolve("puppeteer");
5
+ } catch(e) {
6
+ console.error("puppeteer Node library is not installed; will not generate PDF");
7
+ process.exit(e.code);
8
+ }
9
+
10
+ const puppeteer = require('puppeteer');
11
+
12
+ const createPdf = async() => {
13
+ let browser;
14
+ try {
15
+ browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
16
+ const page = await browser.newPage();
17
+ await page.goto(process.argv[2], {waitUntil: 'networkidle2'});
18
+ await page.pdf({
19
+ path: process.argv[3],
20
+ format: 'A4'
21
+ });
22
+ } catch (err) {
23
+ console.log(err.message);
24
+ } finally {
25
+ if (browser) {
26
+ browser.close();
27
+ }
28
+ process.exit();
29
+ }
30
+ };
31
+ createPdf();
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Rsd
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
@@ -20,7 +20,7 @@
20
20
  <div class="doc-number">
21
21
  <span class="docnumber">{{ docnumber }}</span>
22
22
  <span class="docnumber-separator">:</span>
23
- <span class="docyear">{{ docyear }}</span>
23
+ <span class="docyear">{{ docyear }} {{ draftinfo }}</span>
24
24
  </div>
25
25
 
26
26
  <div class="coverpage-title">
@@ -49,6 +49,10 @@
49
49
  <span class="coverpage-maturity" id="{{ status | replace: ' ', '-' | downcase }}">{{ status }}</span>
50
50
  </div>
51
51
 
52
+ {% if doctype == "Policy And Procedures" or doctype == "Proposal" %}
53
+ <div class="coverpage-stage-block" >{{ revdate }}</div>
54
+ {% endif %}
55
+
52
56
  {% if status != "Published" and status != "Withdrawn" %}
53
57
  <div class="coverpage-warning">
54
58
  <span class="title">Warning for Drafts</span>
@@ -3,8 +3,8 @@ normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ docnumbe
3
3
  style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:14.0pt'><o:p></o:p></span></b></p>
4
4
 
5
5
  <p class="MsoNormal" align="right" style='text-align:right'><span lang="EN-GB"
6
- style='mso-no-proof:yes'>{{ agency }}&nbsp;</span><span lang="EN-GB"><span
7
- style='mso-no-proof:yes'>{{ editorialgroup | join: "/" }}</span></p>
6
+ style='mso-no-proof:yes'>Ribose&nbsp;</span><span lang="EN-GB"><span
7
+ style='mso-no-proof:yes'>{{ tc | join: "/" }}</span></p>
8
8
 
9
9
  <p class="MsoNormal" align="center" style='text-align:center;line-height:18.0pt;margin-bottom:0.0pt'><b
10
10
  style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:24.0pt'>{{ doctitle }}</span>
@@ -20,6 +20,11 @@ margin-left:4.25pt;margin-right:4.25pt'>
20
20
  mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span
21
21
  lang="EN-GB" style='font-size:16.0pt'>{{ status }} {{ doctype }}<o:p></o:p></span></p>
22
22
 
23
+ {% if doctype == "Policy And Procedures" or doctype == "Proposal" %}
24
+ <p class="MsoNormal" align="center" style='text-align:center;border:none;
25
+ mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span
26
+ lang="EN-GB" style='font-size:16.0pt'>{{ revdate }}<o:p></o:p></span></p>
27
+ {% endif %}
23
28
  </div>
24
29
 
25
30
  <p class="MsoNormal" style='margin-bottom:6.0pt'><span lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
@@ -28,18 +33,20 @@ mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0
28
33
  mso-border-alt:solid windowtext .5pt;padding:1.0pt 4.0pt 1.0pt 4.0pt;
29
34
  margin-left:4.25pt;margin-right:4.25pt'>
30
35
 
36
+ {% if status != "Published" and status != "Withdrawn" %}
31
37
  <p class="MsoNormal" align="center" style='margin-bottom:6.0pt;text-align:center;
32
38
  border:none;mso-border-alt:solid windowtext .5pt;padding:0cm;mso-padding-alt:
33
39
  1.0pt 4.0pt 1.0pt 4.0pt'><b style='mso-bidi-font-weight:normal'><span
34
- lang="EN-GB" style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>Warning for WDs
35
- and CDs<o:p></o:p></span></b></p>
40
+ lang="EN-GB" style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>Warning for drafts<o:p></o:p></span></b></p>
36
41
 
37
42
  <p class="MsoNormal" style='margin-bottom:6.0pt;border:none;mso-border-alt:solid windowtext .5pt;
38
43
  padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span lang="EN-GB"
39
- style='font-size:10.0pt;mso-bidi-font-size:11.0pt;mso-bidi-font-weight:bold'>This
40
- document is not an ISO International Standard. It is distributed for review and
41
- comment. It is subject to change without notice and may not be referred to as
42
- an International Standard.<o:p></o:p></span></p>
44
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt;mso-bidi-font-weight:bold'>This document
45
+ is not a Ribose Standard. It is distributed for review and
46
+ comment, and is subject to change without notice and may not be referred to as
47
+ a Standard. Recipients of this draft are invited to submit, with their
48
+ comments, notification of any relevant patent rights of which they are aware
49
+ and to provide supporting documentation.<o:p></o:p></span></p>
43
50
 
44
51
  <p class="MsoNormal" style='border:none;mso-border-alt:solid windowtext .5pt;
45
52
  padding:0cm;mso-padding-alt:1.0pt 4.0pt 1.0pt 4.0pt'><span lang="EN-GB"
@@ -49,6 +56,8 @@ relevant patent rights of which they are aware and to provide supporting
49
56
  documentation.</span><span lang="EN-GB" style='font-size:10.0pt;mso-bidi-font-size:
50
57
  11.0pt'><o:p></o:p></span></p>
51
58
 
59
+ {% endif %}
60
+
52
61
  </div>
53
62
 
54
63
 
@@ -11,9 +11,15 @@ module Metanorma
11
11
  end
12
12
 
13
13
  def output_formats
14
- {
15
- html: "html"
16
- }
14
+ super.merge(
15
+ html: "html",
16
+ doc: "doc",
17
+ pdf: "pdf"
18
+ )
19
+ end
20
+
21
+ def version
22
+ "Asciidoctor::Rsd #{Asciidoctor::Rsd::VERSION}"
17
23
  end
18
24
 
19
25
  def input_to_isodoc(file)
@@ -24,9 +30,19 @@ module Metanorma
24
30
  case format
25
31
  when :html
26
32
  IsoDoc::Rsd::HtmlConvert.new(options).convert(outname, isodoc_node)
33
+ when :doc
34
+ IsoDoc::Rsd::WordConvert.new(options).convert(outname, isodoc_node)
35
+ when :pdf
36
+ require 'tempfile'
37
+ outname_html = outname + ".html"
38
+ IsoDoc::Rsd::HtmlConvert.new(options).convert(outname_html, isodoc_node)
39
+ puts outname_html
40
+ system "cat #{outname_html}"
41
+ Metanorma::Output::Pdf.new.convert(outname_html, outname)
42
+ else
43
+ super
27
44
  end
28
45
  end
29
-
30
46
  end
31
47
  end
32
- end
48
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-rsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
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-06-20 00:00:00.000000000 Z
11
+ date: 2018-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor
@@ -318,6 +318,20 @@ dependencies:
318
318
  - - "~>"
319
319
  - !ruby/object:Gem::Version
320
320
  version: '0.9'
321
+ - !ruby/object:Gem::Dependency
322
+ name: metanorma
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ type: :development
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - ">="
333
+ - !ruby/object:Gem::Version
334
+ version: '0'
321
335
  description: |
322
336
  asciidoctor-rsd lets you write RSD in AsciiDoc syntax.
323
337
 
@@ -347,6 +361,7 @@ files:
347
361
  - lib/asciidoctor/rsd/isodoc.rng
348
362
  - lib/asciidoctor/rsd/isostandard.rng
349
363
  - lib/asciidoctor/rsd/m3d.rng
364
+ - lib/asciidoctor/rsd/pdf.js
350
365
  - lib/asciidoctor/rsd/rsd.rng
351
366
  - lib/asciidoctor/rsd/version.rb
352
367
  - lib/isodoc/rsd/html/dots-w@2x.png
@@ -370,7 +385,7 @@ files:
370
385
  - lib/metanorma/rsd/processor.rb
371
386
  homepage: https://github.com/riboseinc/asciidoctor-rsd
372
387
  licenses:
373
- - MIT
388
+ - BSD-2-Clause
374
389
  metadata: {}
375
390
  post_install_message:
376
391
  rdoc_options: []