asciidoctor-csand 0.3.0 → 0.3.1

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: 64a6d22ce8dc776cd2f64ef77b55df5a903abc98a56fc6cd2245f7b5fe97c04c
4
- data.tar.gz: db40f9ed86dd73a03a32d73e4348cd006b86257539db653c9fa52237aaa27d7c
3
+ metadata.gz: a0b9a7c1dddf60cd463c47b59fd40b21f97089f77347e25587a16d728eda9bff
4
+ data.tar.gz: 7162ad6d864ea523d6710fe44725b563f58d74186af640eef45779970582081b
5
5
  SHA512:
6
- metadata.gz: '0158a7ca61c916bd4ddf0ef1c0360ba8bf5f142ba74e245f245608713e8f9f0d3c86e3312b763c419cc1c1a4ee178b022f1632883acabdfab0918ae1001bc475'
7
- data.tar.gz: 341cab8af82ecd42c3c321da3dc5fffd008ba08169df04c0afe5bde038842e43c17f458af37b89197f090b7404d7dfca41a439dd8e53e526c13291f196ed352d
6
+ metadata.gz: 53354dcb72c62ee58cfcb3b7d2f1e4f62e0f5f021f5fb668346032caf1928a32281c08a579e692f0d50514ed7d396f55d16c0649394598f72a5f087df9e5d193
7
+ data.tar.gz: ae75ceb67875df08ac2f6f7f00ad4928916239f04ea938872df9d032d6ae723a5d3c5e92c2e76a00bcb1891370947e16b6d7ed77dbe7e299c84c39ef99a562af
@@ -1,8 +1,8 @@
1
1
  GIT
2
2
  remote: https://github.com/riboseinc/asciidoctor-iso
3
- revision: 1fca67f1a4e7a67461ea3999918abc10bca3ca2c
3
+ revision: 575341655824ef6fd612e710dcee60aa30177b9d
4
4
  specs:
5
- asciidoctor-iso (0.9.0)
5
+ asciidoctor-iso (0.9.1)
6
6
  asciidoctor (~> 1.5.7)
7
7
  iso-bib-item (~> 0.1.6)
8
8
  isobib (~> 0.1.6)
@@ -51,9 +51,50 @@ GEM
51
51
  httpclient (~> 2.8, >= 2.8.3)
52
52
  json (>= 1.5.1)
53
53
  asciidoctor (1.5.7.1)
54
+ asciidoctor-csd (0.4.0)
55
+ asciidoctor-iso (>= 0.9.0)
56
+ isodoc (>= 0.8.0)
57
+ asciidoctor-gb (0.3.0)
58
+ asciidoctor-iso (>= 0.9.0)
59
+ isodoc (>= 0.8.0)
60
+ twitter_cldr
61
+ asciidoctor-m3d (0.3.1)
62
+ asciidoctor (~> 1.5.7)
63
+ asciidoctor-iso (>= 0.9.0)
64
+ asciimath
65
+ htmlentities (~> 4.3.4)
66
+ image_size
67
+ isodoc (>= 0.8.0)
68
+ mime-types
69
+ nokogiri
70
+ ruby-jing
71
+ ruby-xslt
72
+ thread_safe
73
+ uuidtools
74
+ asciidoctor-rfc (0.9.0)
75
+ asciidoctor (~> 1.5.7)
76
+ htmlentities (~> 4.3.4)
77
+ nokogiri
78
+ ruby-jing
79
+ thread_safe
80
+ asciidoctor-rsd (0.3.1)
81
+ asciidoctor (~> 1.5.7)
82
+ asciidoctor-iso (>= 0.8.0)
83
+ asciimath
84
+ htmlentities (~> 4.3.4)
85
+ image_size
86
+ isodoc (>= 0.7.0)
87
+ mime-types
88
+ nokogiri
89
+ ruby-jing
90
+ ruby-xslt
91
+ thread_safe
92
+ uuidtools
54
93
  asciimath (1.0.4)
55
94
  ast (2.4.0)
56
95
  byebug (9.1.0)
96
+ camertron-eprun (1.1.1)
97
+ cldr-plurals-runtime-rb (1.0.1)
57
98
  coderay (1.1.2)
58
99
  diff-lcs (1.3)
59
100
  docile (1.3.1)
@@ -88,11 +129,11 @@ GEM
88
129
  htmlentities (4.3.4)
89
130
  httpclient (2.8.3)
90
131
  image_size (2.0.0)
91
- iso-bib-item (0.1.6)
132
+ iso-bib-item (0.1.8)
92
133
  duplicate
93
134
  isoics (~> 0.1.6)
94
135
  nokogiri
95
- isobib (0.1.6)
136
+ isobib (0.1.7)
96
137
  algoliasearch
97
138
  iso-bib-item (~> 0.1.2)
98
139
  isoics (0.1.6)
@@ -104,6 +145,15 @@ GEM
104
145
  rb-inotify (~> 0.9, >= 0.9.7)
105
146
  ruby_dep (~> 1.2)
106
147
  lumberjack (1.0.13)
148
+ metanorma (0.2.2)
149
+ asciidoctor-csand (>= 0.3.0)
150
+ asciidoctor-csd (>= 0.4.0)
151
+ asciidoctor-gb (>= 0.3.0)
152
+ asciidoctor-iso (>= 0.9.0)
153
+ asciidoctor-m3d (>= 0.3.1)
154
+ asciidoctor-rfc (>= 0.9.0)
155
+ asciidoctor-rsd (>= 0.3.0)
156
+ isodoc (>= 0.8.0)
107
157
  method_source (0.9.0)
108
158
  mime-types (3.1)
109
159
  mime-types-data (~> 3.2015)
@@ -169,6 +219,12 @@ GEM
169
219
  thor (0.20.0)
170
220
  thread_safe (0.3.6)
171
221
  timecop (0.9.1)
222
+ twitter_cldr (4.4.3)
223
+ camertron-eprun
224
+ cldr-plurals-runtime-rb (~> 1.0)
225
+ tzinfo
226
+ tzinfo (1.2.5)
227
+ thread_safe (~> 0.1)
172
228
  unicode-display_width (1.4.0)
173
229
  uuidtools (2.1.5)
174
230
 
@@ -184,6 +240,7 @@ DEPENDENCIES
184
240
  guard (~> 2.14)
185
241
  guard-rspec (~> 4.7)
186
242
  isodoc!
243
+ metanorma
187
244
  rake (~> 12.0)
188
245
  rspec (~> 3.6)
189
246
  rubocop (~> 0.50)
@@ -28,20 +28,19 @@ expressions.
28
28
  International Standards.
29
29
  * The XML representation is processed in turn to generate the following outputs
30
30
  as end deliverable CSAND standard drafts.
31
- ** Microsoft Word output (`.doc`), following the style conventions of the
32
- https://www.csand.org/csand-templates.html[CSAND Standard Microsoft Word template].
33
- (In development)
34
- ** PDF (forthcoming)
35
- ** HTML (forthcoming)
31
+ ** HTML output.
36
32
 
37
33
  This AsciiDoc syntax for writing CSAND standards is hereby named "AsciiCSAND".
38
34
 
39
35
  == Usage
40
36
 
37
+ The preferred way to invoke this gem is via the `metanorma` script:
38
+
41
39
  [source,console]
42
40
  ----
43
- $ asciidoctor a.adoc # HTML output of Asciidoc file
44
- $ asciidoctor -b csand -r 'asciidoctor-csand' a.adoc # CSAND XML output
41
+ $ metanorma --type csand a.adoc # output just HTML
42
+ $ metanorma --type csand a.adoc --extensions html # output just HTML
43
+ $ metanorma --type csand a.adoc --extensions xml # output CSAND XML
45
44
  ----
46
45
 
47
46
  The gem translates the document into CSAND XML format, and then
@@ -50,42 +49,30 @@ reported to console against the XML, and are intended for users to
50
49
  check that they have provided all necessary components of the
51
50
  document.
52
51
 
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/csand/csand2wordhtml.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 CSAND references.)
52
+ The gem then converts the XML to HTML, and
53
+ outputs that files with the appropriate `.html` suffix.
67
54
 
68
- * No space before percent sign.
55
+ The gem can also be invoked directly within asciidoctor, though this is deprecated:
69
56
 
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.)
57
+ [source,console]
58
+ ----
59
+ $ asciidoctor -b csand -r 'asciidoctor-csand' a.adoc
60
+ ----
77
61
 
78
- * 5 levels of subclause nesting. (Never actuated, AsciiDoc only permits 4
79
- levels of subsections.)
62
+ === Installation
80
63
 
81
- * Non-CSAND/IEC reference turning up as normative.
64
+ If you are using a Mac, the https://github.com/riboseinc/metanorma-macos-setup
65
+ repository has instructions on setting up your machine to run Metanorma
66
+ scripts such as this one. You need only run the following in a Terminal console:
82
67
 
83
- * Term definition starts with an article, or ends with a period.
68
+ [source,console]
69
+ ----
70
+ $ bash <(curl -s https://raw.githubusercontent.com/riboseinc/metanorma-macos-setup/master/metanorma-setup)
71
+ $ gem install asciidoctor-csand
84
72
 
85
- * Title intro or title part appears in only one of French or English.
73
+ ----
86
74
 
87
75
  == Approach
88
-
89
76
  === Document model
90
77
 
91
78
  The Ribose Standard Document model is an instance of the
@@ -119,102 +106,6 @@ recognised by fixed titles such as `Normative References`). Authoring CSAND
119
106
  standards in this fashion assumes that users will be populating an Asciidoc
120
107
  template, and not removing needed formatting instructions.
121
108
 
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 CSAND 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 CSAND 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 CSAND Standards; these will be ignored in
144
- generating CSAND 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 csandlation, 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 CSAND documents are cited
163
- without brackets by CSAND number, and optionally year, whether they are normative
164
- or in the bibliography (e.g. `CSAND 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. `[CSAND
167
- 20483:2013]`). For the same reason, CSAND references listed in the bibliography
168
- will be listed under an CSAND 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 CSAND reference, these need to be explicitly listed as
173
- separate references. (This is not done in the Rice model document, which lists
174
- CSAND 6646, but under _Terms and Definitions_ cites the dated CSAND 6646:2011.
175
-
176
- * _References_: CSAND references that are undated but published have their date
177
- indicated under the CSAND 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
109
  == Document Attributes
219
110
 
220
111
  The gem relies on Asciidoctor document attributes to provide necessary
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module Csand
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
5
5
  end
@@ -16,6 +16,10 @@ module Metanorma
16
16
  }
17
17
  end
18
18
 
19
+ def version
20
+ "Asciidoctor::Csand #{Asciidoctor::Csand::VERSION}"
21
+ end
22
+
19
23
  def input_to_isodoc(file)
20
24
  Metanorma::Input::Asciidoc.new.process(file, @asciidoctor_backend)
21
25
  end
@@ -29,4 +33,4 @@ module Metanorma
29
33
 
30
34
  end
31
35
  end
32
- end
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-csand
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
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-02 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-csand lets you write CSA Normal Documents (CSAND) in AsciiDoc syntax.
323
337
 
@@ -380,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
380
394
  version: '0'
381
395
  requirements: []
382
396
  rubyforge_project:
383
- rubygems_version: 2.7.7
397
+ rubygems_version: 2.7.6
384
398
  signing_key:
385
399
  specification_version: 4
386
400
  summary: asciidoctor-csand lets you write CSA Normal Documents (CSAND) in AsciiDoc.