metanorma-iso 2.0.8.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/lib/html2doc/lists.rb +169 -0
  3. data/lib/isodoc/iso/base_convert.rb +11 -1
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +7 -0
  5. data/lib/isodoc/iso/html/isodoc-dis.css +407 -427
  6. data/lib/isodoc/iso/html/isodoc-dis.scss +482 -438
  7. data/lib/isodoc/iso/html/isodoc.css +38 -13
  8. data/lib/isodoc/iso/html/isodoc.scss +38 -12
  9. data/lib/isodoc/iso/html/style-human.css +14 -1
  10. data/lib/isodoc/iso/html/style-human.scss +10 -1
  11. data/lib/isodoc/iso/html/style-iso.css +35 -23
  12. data/lib/isodoc/iso/html/style-iso.scss +31 -23
  13. data/lib/isodoc/iso/html/word_iso_intro-dis.html +3 -1
  14. data/lib/isodoc/iso/html/word_iso_titlepage-dis.html +26 -13
  15. data/lib/isodoc/iso/html/word_iso_titlepage-prf.html +58 -0
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +16 -6
  17. data/lib/isodoc/iso/html/wordstyle-dis.css +168 -48
  18. data/lib/isodoc/iso/html/wordstyle-dis.scss +158 -43
  19. data/lib/isodoc/iso/html_convert.rb +7 -2
  20. data/lib/isodoc/iso/i18n-en.yaml +33 -4
  21. data/lib/isodoc/iso/i18n-fr.yaml +30 -3
  22. data/lib/isodoc/iso/i18n-ru.yaml +33 -4
  23. data/lib/isodoc/iso/i18n-zh-Hans.yaml +33 -3
  24. data/lib/isodoc/iso/i18n.rb +1 -1
  25. data/lib/isodoc/iso/init.rb +17 -1
  26. data/lib/isodoc/iso/iso.amendment.xsl +1711 -367
  27. data/lib/isodoc/iso/iso.international-standard.xsl +1711 -367
  28. data/lib/isodoc/iso/metadata.rb +72 -78
  29. data/lib/isodoc/iso/presentation_bibdata.rb +74 -0
  30. data/lib/isodoc/iso/presentation_xml_convert.rb +52 -100
  31. data/lib/isodoc/iso/presentation_xref.rb +132 -0
  32. data/lib/isodoc/iso/sections.rb +3 -3
  33. data/lib/isodoc/iso/word_cleanup.rb +17 -0
  34. data/lib/isodoc/iso/word_convert.rb +32 -12
  35. data/lib/isodoc/iso/word_dis_cleanup.rb +235 -0
  36. data/lib/isodoc/iso/word_dis_convert.rb +122 -0
  37. data/lib/isodoc/iso/xref.rb +78 -29
  38. data/lib/metanorma/iso/base.rb +20 -1
  39. data/lib/metanorma/iso/biblio.rng +69 -42
  40. data/lib/metanorma/iso/boilerplate-fr.xml +4 -1
  41. data/lib/metanorma/iso/boilerplate-ru.xml +4 -3
  42. data/lib/metanorma/iso/boilerplate.xml +4 -3
  43. data/lib/metanorma/iso/cleanup.rb +29 -1
  44. data/lib/metanorma/iso/front.rb +31 -6
  45. data/lib/metanorma/iso/front_id.rb +2 -0
  46. data/lib/metanorma/iso/isodoc.rng +65 -0
  47. data/lib/metanorma/iso/isostandard.rng +30 -12
  48. data/lib/metanorma/iso/macros.rb +29 -0
  49. data/lib/metanorma/iso/version.rb +1 -1
  50. data/lib/metanorma-iso.rb +1 -0
  51. data/lib/relaton/render/config.yml +4 -0
  52. data/lib/relaton/render/general.rb +13 -0
  53. data/metanorma-iso.gemspec +1 -1
  54. data/spec/isodoc/amd_spec.rb +35 -60
  55. data/spec/isodoc/blocks_spec.rb +783 -179
  56. data/spec/isodoc/i18n_spec.rb +331 -100
  57. data/spec/isodoc/inline_spec.rb +35 -42
  58. data/spec/isodoc/iso_spec.rb +51 -170
  59. data/spec/isodoc/metadata_spec.rb +240 -99
  60. data/spec/isodoc/postproc_spec.rb +68 -7
  61. data/spec/isodoc/ref_spec.rb +66 -69
  62. data/spec/isodoc/section_spec.rb +88 -80
  63. data/spec/isodoc/table_spec.rb +2 -2
  64. data/spec/isodoc/terms_spec.rb +2 -2
  65. data/spec/isodoc/word_dis_spec.rb +1886 -0
  66. data/spec/isodoc/xref_spec.rb +138 -64
  67. data/spec/metanorma/amd_spec.rb +53 -1
  68. data/spec/metanorma/base_spec.rb +195 -20
  69. data/spec/metanorma/blocks_spec.rb +54 -0
  70. data/spec/metanorma/lists_spec.rb +2 -2
  71. data/spec/metanorma/section_spec.rb +2 -2
  72. data/spec/spec_helper.rb +23 -4
  73. data/spec/vcr_cassettes/withdrawn_iso.yml +25 -25
  74. metadata +15 -10
  75. data/docs/asciiiso-syntax.adoc +0 -307
  76. data/docs/guidance.adoc +0 -487
  77. data/docs/navigation.adoc +0 -23
  78. data/docs/quickstart.adoc +0 -179
  79. data/spec/vcr_cassettes/docrels.yml +0 -385
data/docs/quickstart.adoc DELETED
@@ -1,179 +0,0 @@
1
- = Quickstart Guide
2
-
3
- TIP: This guide has been authored for ISO standards, but most of it applies to all Metanorma standards. We indicate where guidance differs for different standards classes. See link:https://www.metanorma.com/software/Metanorma_processor/[List of Metanorma processors].
4
-
5
- This is a guide on how to get started using Metanorma to create documents aligned with different standards classes (such as ISO, GB, CSD, etc), in Microsoft Word and HTML formats. This guide is written to apply generically across the standards classes that can be expressed in Metanorma; guidance specific to a particular standards class is given as TIPs.
6
-
7
- Metanorma takes text in the _Asciidoctor markup language_ as input (consult the https://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual] on the basics of this markup language).
8
- Metanorma makes some adjustments to the text format for its requirements;
9
- these adjustments (which we refer to as _Metanorma Asciidoctor_, or AsciiISO) are documented in relevant sections of this documentation.
10
- Metanorma uses Asciidoctor to generate _Metanorma XML_, as an intermediate, semantic representation of standards content.
11
- Metanorma XML in turn is processed by the https://github.com/metanorma/isodoc[isodoc] gem to generate output in Microsoft Word (`.doc`) and HTML (`.html`).
12
-
13
- == Even quicker summary
14
-
15
- In order to start a new Metanorma document, or migrate your document from Word:
16
-
17
- . Install <<installation>> (for your specific Metanorma standards class)
18
- . Clone the https://github.com/metanorma/isodoc-rice/[AsciiISO Rice]
19
-
20
- To migrate:
21
-
22
- . Use our https://github.com/metanorma/reverse_asciidoctor[reverse_asciidoctor] gem to help you convert a Word document into Asciidoctor. Be warned that the conversion will not be 100% clean, and you will have to manually fix some syntax (especially if your Word document contains an index, stray anchors, and equations).
23
- . Move the content back to the cloned isodoc-rice.
24
- . The isodoc-rice repository is set up for the ISO standards class; if you are not working with ISO, change its makefile to refer to the correct standards class (e.g. from `bundle exec metanorma -t iso -x doc,xml,html $^` to `bundle exec metanorma -t rsd -x doc,xml,html $^`
25
-
26
- [[supported-standards]]
27
- == Supported standards
28
-
29
-
30
- As of this writing, Metanorma supports the following standards classes:
31
-
32
- * https://github.com/metanorma/metanorma-iso[ISO and IEC] (`iso`)
33
- * https://github.com/metanorma/metanorma-gb[Chinese National standards] (`gb`)
34
- * https://github.com/metanorma/metanorma-csd[Calconnect] (`csd`)
35
- * https://github.com/metanorma/metanorma-csand[Cloud Security Alliance] (`csand`)
36
- * https://github.com/metanorma/metanorma-m3d[Messaging, Malware and Mobile Anti-Abuse Working Group (M^3^AAWG)] (`m3d`)
37
- * https://github.com/metanorma/metanorma-rsd[Ribose] (`rsd`)
38
- * https://github.com/metanorma/metanorma-acme[Acme (shell for user-customised standards)] (`acme`)
39
- * https://github.com/metanorma/metanorma-mpfd[Mandatory Provident Fund Schemes Authority, Hong Kong (MPFA)] (`mpfd`)
40
- * https://github.com/metanorma/metanorma-unece[United Nations Economic Commission for Europe] (`unece`)
41
-
42
- == Installing on Linux and macOS
43
-
44
- Install Metanorma-ISO gem and its dependencies:
45
-
46
- You can install the metanorma-cli gem, and all its dependencies, through the Ruby gem installer:
47
-
48
-
49
- [source,console]
50
- --
51
- gem install metanorma-cli
52
- --
53
-
54
- If you want the latest version (note: may not be stable due to active development),
55
- you can install it from Github:
56
-
57
- [source,console]
58
- --
59
- git clone https://github.com/metanorma/metanorma-cli.git
60
- cd metanorma-cli
61
- gem build *.gemspec
62
- gem install *.gem
63
- bundle update
64
- --
65
-
66
- The final `bundle update` step updates the dependent gems, and is necessary because those gems are even more heavily under development.
67
-
68
- [TIP]
69
- ====
70
- The Metanorma tool is a suite of https://en.wikipedia.org/wiki/RubyGems[Ruby gems], and works on the command line. The https://en.wikipedia.org/wiki/Ruby_programming_language[Ruby programming language] can be installed on Windows (e.g. https://rubyinstaller.org), but is typically run on a Unix command line—including Linux and MacOS. The following instructions are for the Unix console.
71
-
72
- The starting poing of the Metanorma tool is the `metanorma-cli` gem (command line interface); it references various other gems that the tool is based on, including the converter from Asciidoctor to Metanorma XML (`metanorma-standoc`), the converters from Metanorma XML to HTML and Word (`isodoc`, `html2doc`), the variants of Metanorma for different standards classes (`metanorma-iso`, `metanorma-csd`, etc.), and tools for processing bibliographies (`relaton`, `isobib` etc.)
73
-
74
- The Metanorma tools processing Asciidoctor, in turn, build on the https://asciidoctor.org[Asciidoctor gem], which interprets the Asciidoctor markup language in Ruby. Installing the Metanorma gem will install the Asciidoctor gem, if it is not already installed.
75
-
76
- Ruby comes with Linux and MacOS. Asciidoctor-ISO uses at minimum Ruby 2.3.0, and you may need to update your Ruby instance to use that version. Refer to https://www.ruby-lang.org/en/documentation/installation/
77
- ====
78
-
79
-
80
-
81
-
82
- == Setting up a new project
83
-
84
- At its simplest, all you need is a text document in Asciidoctor-like AsciiISO format,
85
- which you compile using the Metanorma-ISO gem.
86
-
87
- To keep document dependencies in order, place your document in a distinct folder:
88
-
89
-
90
- [source,console]
91
- --
92
- mkdir new_standard
93
- cd new_standard
94
- vi new_standard.adoc
95
- --
96
-
97
- To compile the document, execute the `asciidoctor` script, flagging it to use a specific standards class with the `-t` flag (refer to <<stupported-standards>> for the abbreviations used); e.g.
98
-
99
- [source,console]
100
- --
101
- metanorma -t iso new_standard.adoc
102
- --
103
-
104
- This will generate two files from the `new_standard.adoc` document (provided it is well-formed):
105
-
106
- * `new_standard.html`, a standalone HTML document,
107
- * `new_standard.doc`, a Word document
108
- (currently in the pre-2007 `.doc` format, but Microsoft Word will open it fine).
109
-
110
- Both these files are generated via an intermediate XML file, `new_standard.xml`, which represents the structure of the document as it is formally defined by the standards body, and captured in the https://github.com/metanorma/metanorma-model-iso[Metanorma XML schema].
111
-
112
- Even if there are no errors in the Asciidoctor syntax, the document may still raise warnings to the console as it is being validated. The validation comes from the formal definition of the standard class (e.g. ISO/IEC DIR 2 in the case of ISO and IEC), and consists of two parts: warnings about document content (e.g., for ISO, requiring space before a percentage sign; requiring that the scope not contain text that looks like a recommendation); and warnings about document structure. The latter are generated by running the generated XML against the ISOXML schema, and report the line numbers of the XML document where issues are observed.
113
-
114
-
115
-
116
- Even if there are no errors in the syntax, the document may still raise warnings
117
- to the console as it is being validated.
118
- The validation comes from ISO/IEC DIR 2, and consists of two parts:
119
-
120
- * Warnings about document content
121
- (e.g., requiring space before a percentage sign,
122
- or requiring that the scope not contain text that looks like a recommendation).
123
- * Warnings about document structure
124
- (found from running the generated XML against the ISOXML schema,
125
- they report the line numbers of the XML document where issues are observed).
126
-
127
- == Starting with an example project
128
-
129
- Perhaps the simplest way to get started is to take an existing Metanorma-ISO document
130
- and edit it, observing how it approaches various formatting tasks.
131
-
132
- The https://www.iso.org/publication/PUB100407.html["Rice document"]
133
- is the ISO's model document of an international standard.
134
- An Metanorma-ISO version of the document is available
135
- at https://github.com/metanorma/isodoc-rice/.
136
- We suggest downloading the site, and editing it.
137
-
138
- The `iso-rice-en.adoc` document consists of a document header,
139
- and it references the separate `body/body-en.adoc` document for the document proper (`include::body/body-en.adoc[]`).
140
- You can just continue on with the document text after the document header—so long as you remember to leave a blank line between the two.
141
-
142
- == Learning the AsciiDoc-based syntax
143
-
144
- To author AsciiDoc documents, you need to be familiar with the _core AsciiDoc syntax_,
145
- as well as _the syntax extensions and conventions_ that are specific to Metanorma-ISO.
146
-
147
- - Check out link:asciiiso-syntax[our AsciiISO syntax reference],
148
- and link:guidance.adoc[Guidance for Authoring in Metanorma-ISO].
149
-
150
- - See also https://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual]
151
- documenting Asciidoctor itself
152
- and https://github.com/metanorma/metanorma-iso/blob/master/README.adoc[Metanorma-ISO README].
153
-
154
- == Migrating existing documents from Microsoft Word
155
-
156
- . Use our https://github.com/metanorma/reverse_asciidoctor[reverse_asciidoctor]
157
- gem to help you convert a Word document into AsciiISO.
158
- +
159
- You will likely have to manually clean up some syntax
160
- (especially if your Word document contains an index, stray anchors, and equations):
161
- don’t rely on the automatic conversion to be 100% correct.
162
-
163
- - Check out link:asciiiso-syntax[our AsciiISO syntax reference],
164
- and link:guidance.adoc[Guidance for Authoring in Asciidoctor-ISO].
165
-
166
- - See also https://asciidoctor.org/docs/user-manual/[Asciidoctor User Manual]
167
- documenting Asciidoctor itself
168
- and https://github.com/metanorma/metanorma-iso/blob/master/README.adoc[Metanorma-ISO README].
169
-
170
- == Migrating existing documents from Microsoft Word:
171
-
172
- . Use our https://github.com/metanorma/reverse_asciidoctor[reverse_asciidoctor]
173
- gem to help you convert a Word document into AsciiISO.
174
-
175
- You will likely have to manually clean up some syntax
176
- (especially if your Word document contains an index, stray anchors, and equations):
177
- don’t rely on the automatic conversion to be 100% correct.
178
- . Move the content back to the cloned isodoc-rice.
179
-