metanorma-mpfd 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/.rubocop.yml +10 -0
- data/README.adoc +302 -1
- data/lib/asciidoctor/mpfd/biblio.rng +60 -6
- data/lib/asciidoctor/mpfd/converter.rb +1 -19
- data/lib/asciidoctor/mpfd/isodoc.rng +54 -26
- data/lib/asciidoctor/mpfd/isostandard.rng +6 -0
- data/lib/asciidoctor/mpfd/mpfd.rng +35 -20
- data/lib/asciidoctor/mpfd/section.rb +16 -19
- data/lib/isodoc/mpfd/html/htmlstyle.scss +1 -1
- data/lib/isodoc/mpfd/html/word_rsd_titlepage.html +1 -1
- data/lib/isodoc/mpfd/html_convert.rb +13 -30
- data/lib/isodoc/mpfd/i18n-en.yaml +1 -0
- data/lib/isodoc/mpfd/i18n-zh-Hans.yaml +2 -0
- data/lib/isodoc/mpfd/metadata.rb +1 -25
- data/lib/isodoc/mpfd/pdf_convert.rb +12 -22
- data/lib/isodoc/mpfd/word_convert.rb +11 -92
- data/lib/metanorma/mpfd/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16aa0d3330809464979d425181b5ecbdaa5d24b5f38a4c6ed29cfc7376291b28
|
4
|
+
data.tar.gz: 05b5d56e2ab0edbbf69373c85ddd1bd8070dc06683fe15214ad04eca897abe4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92d22d04a12532be21d51535b68da3cf3d4df3a49cf0c9fd853975e4479fa30ad34bb5e1329c59d6f22ff991371c1017e91f8b09a0c70654dfc2c0da038909b8
|
7
|
+
data.tar.gz: 5b77a57e4e14e78ba2fbb34c4def5cf53ae7871f5987cd16a9ca1b3ceeb0f5f52c6c87edcfe7e2847845d7a78783f9a0e40b47ba0f8a4f124ec5c1554c5d4ccf
|
data/.hound.yml
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
# This project follows the Ribose OSS style guide.
|
2
|
+
# https://github.com/riboseinc/oss-guides
|
3
|
+
# All project-specific additions and overrides should be specified in this file.
|
4
|
+
|
5
|
+
inherit_from:
|
6
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
|
+
AllCops:
|
8
|
+
TargetRubyVersion: 2.3
|
9
|
+
Rails:
|
10
|
+
Enabled: true
|
data/README.adoc
CHANGED
@@ -1 +1,302 @@
|
|
1
|
-
=
|
1
|
+
= Metanorma-MPFD: Metanorma processor for MPFA documents
|
2
|
+
|
3
|
+
image:https://img.shields.io/gem/v/metanorma-mpfd.svg["Gem Version", link="https://rubygems.org/gems/metanorma-mpfd"]
|
4
|
+
image:https://img.shields.io/travis/riboseinc/metanorma-mpfd/master.svg["Build Status", link="https://travis-ci.org/riboseinc/metanorma-mpfd"]
|
5
|
+
image:https://codeclimate.com/github/riboseinc/metanorma-mpfd/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/metanorma-mpfd"]
|
6
|
+
|
7
|
+
WARNING: This gem is still under development. Moreover, unlike other Metanorma gems,
|
8
|
+
there is no formal MPFD specification, and this work is still currently exploratory.
|
9
|
+
|
10
|
+
== Functionality
|
11
|
+
|
12
|
+
This gem processes http://asciidoctor.org/[Asciidoctor] documents following
|
13
|
+
a template for generating documents for the http://www.mpfa.org.hk[Mandatory Provident Fund Schemes Authority of Hong Kong]
|
14
|
+
(MPFA). (MPFD stands for Mandatory Provident Fund Schemes Authority Documents.)
|
15
|
+
|
16
|
+
The gem currently inherits from the https://github.com/riboseinc/metanorma-standoc
|
17
|
+
gem, and aligns closely to it. Refer to the ISO gem documentation
|
18
|
+
for guidance, including https://github.com/riboseinc/metanorma-iso/wiki/Guidance-for-authoring
|
19
|
+
|
20
|
+
The following outputs are generated.
|
21
|
+
|
22
|
+
* (Optional) An HTML preview generated directly from the Asciidoctor document,
|
23
|
+
using native Asciidoctor formatting.
|
24
|
+
** http://asciimath.org[AsciiMathML] is to be used for mathematical formatting.
|
25
|
+
The gem uses the https://github.com/asciidoctor/asciimath[Ruby AsciiMath parser],
|
26
|
+
which is syntactically stricter than the common MathJax processor;
|
27
|
+
if you do not get expected results, try bracketing terms your in AsciiMathML
|
28
|
+
expressions.
|
29
|
+
* an XML representation of the document, intended as a document model for MPFD
|
30
|
+
International Standards.
|
31
|
+
* The XML representation is processed in turn to generate the following outputs
|
32
|
+
as end deliverable MPFD standard drafts.
|
33
|
+
** DOC
|
34
|
+
** HTML
|
35
|
+
|
36
|
+
== Usage
|
37
|
+
|
38
|
+
The preferred way to invoke this gem is via the `metanorma` script:
|
39
|
+
|
40
|
+
[source,console]
|
41
|
+
----
|
42
|
+
$ metanorma --type mpfd a.adoc # output HTML and DOC
|
43
|
+
$ metanorma --type mpfd --extensions html a.adoc # output just HTML
|
44
|
+
$ metanorma --type mpfd --extensions doc a.adoc # output just DOC
|
45
|
+
$ metanorma --type mpfd --extensions xml a.adoc # output MPFD XML
|
46
|
+
----
|
47
|
+
|
48
|
+
The gem translates the document into Metanorma XML format, and then
|
49
|
+
validates its output against the Metanorma XML document model; errors are
|
50
|
+
reported to console against the XML, and are intended for users to
|
51
|
+
check that they have provided all necessary components of the
|
52
|
+
document.
|
53
|
+
|
54
|
+
The gem then converts the XML into HTML and DOC.
|
55
|
+
|
56
|
+
Sample documents are available at http://github.com/riboseinc/mpfd-documents/
|
57
|
+
|
58
|
+
=== Installation
|
59
|
+
|
60
|
+
If you are using a Mac, the https://github.com/riboseinc/metanorma-macos-setup
|
61
|
+
repository has instructions on setting up your machine to run Metanorma
|
62
|
+
scripts such as this one. You need only run the following in a Terminal console:
|
63
|
+
|
64
|
+
[source,console]
|
65
|
+
----
|
66
|
+
$ bash <(curl -s https://raw.githubusercontent.com/riboseinc/metanorma-macos-setup/master/metanorma-setup)
|
67
|
+
$ gem install metanorma-mpfd
|
68
|
+
$ gem install metanorma-cli
|
69
|
+
----
|
70
|
+
|
71
|
+
The metanorma-cli gem is the command-line interface for the Metanorma tool suite
|
72
|
+
(incorporating the `metanorma` executable seen above).
|
73
|
+
|
74
|
+
== Approach
|
75
|
+
|
76
|
+
=== Document model
|
77
|
+
|
78
|
+
The MPFD model is an instance of the
|
79
|
+
https://github.com/riboseinc/isodoc-models[StandardDocument model].
|
80
|
+
|
81
|
+
The Metanorma XML format intends to introduce rigor into the MPFD
|
82
|
+
standards authoring process, and is prescribed in a separate document.
|
83
|
+
|
84
|
+
=== Asciidoctor
|
85
|
+
|
86
|
+
Asciidoctor has been selected as the authoring tool to generate the document
|
87
|
+
model representation of MPFD documents. It is a document formatting tool like
|
88
|
+
Markdown and DocBook, which combines the relative ease of use of the former
|
89
|
+
(using relatively lightweight markup), and the rigor and expressively of the
|
90
|
+
latter (it has a well-defined syntax, and was in fact initially developed as a
|
91
|
+
DocBook document authoring tool). Asciidoctor has built-in capability to output
|
92
|
+
Text, DocBook and HTML; so it can be used to preview the file as it is being
|
93
|
+
authored.
|
94
|
+
|
95
|
+
[[model_additions]]
|
96
|
+
== Asciidoctor model additions
|
97
|
+
|
98
|
+
Refer also to https://github.com/riboseinc/metanorma-standoc/blob/master/README.adoc; this section lists additions specific only to metanorma-mpfd
|
99
|
+
|
100
|
+
All the following modifications to the basic Metanorma model are provisional, as a full analysis of the
|
101
|
+
formatting requirements of MPFD has not yet been conducted.
|
102
|
+
|
103
|
+
=== Glossary
|
104
|
+
|
105
|
+
Sections with the title `glossary` are treated as equivalent to `Terms and Definitions`
|
106
|
+
in other Metanorma docuemnts.
|
107
|
+
|
108
|
+
[source,asciidoctor]
|
109
|
+
--
|
110
|
+
== Glossary
|
111
|
+
=== Term
|
112
|
+
|
113
|
+
Definition
|
114
|
+
|
115
|
+
=== Term 2
|
116
|
+
|
117
|
+
Definition 2
|
118
|
+
--
|
119
|
+
|
120
|
+
Also unlike other Metanorma documents, the glossary is considererd part of the document
|
121
|
+
preface, along with the foreword and introduction, and is moved to the preface regardless
|
122
|
+
of where it appears in the source Asciidoctor document.
|
123
|
+
|
124
|
+
Any clause that has the `preface` style attribute is also moved to the document preface,
|
125
|
+
regardless of where it appears in the source Asciidoctor document.
|
126
|
+
|
127
|
+
[source,asciidoctor]
|
128
|
+
--
|
129
|
+
[preface]
|
130
|
+
== Initial Discussion
|
131
|
+
This section will be moved to the document preface, after the foreword, introduction,
|
132
|
+
and glossary.
|
133
|
+
--
|
134
|
+
|
135
|
+
=== Guidance clauses
|
136
|
+
|
137
|
+
Compliance documents in the MPFA (e.g. https://github.com/riboseinc/mpfd-documents/blob/master/compliance/mpfd-compliance.adoc)
|
138
|
+
present compliance standards, following by an "Explanatory Notes and Guidance" clause. That clause is nested within the
|
139
|
+
standards clause, and has a special identifier: the standards clause identifier, followed by E.
|
140
|
+
|
141
|
+
In MPFD Asciidoctor, the "Explanatory Notes and Guidance" clause is tagged with a `.guidance` role attribute,
|
142
|
+
and should be entered as a sibling clause to the standard clause it elaborates on:
|
143
|
+
|
144
|
+
[source,asciidoctor]
|
145
|
+
--
|
146
|
+
== Compliance Programme to Address Statutory Obligations
|
147
|
+
|
148
|
+
An approved trustee should have in place a compliance programme to help it meet its statutory obligations.
|
149
|
+
|
150
|
+
[.guidance]
|
151
|
+
== Explanatory Notes and Guidance
|
152
|
+
|
153
|
+
An approved trustee must comply with obligations under the Legislation, including the general trustee duties as well as specific requirements relating to the operation of MPF schemes.
|
154
|
+
--
|
155
|
+
|
156
|
+
This will be rendered as follows:
|
157
|
+
|
158
|
+
____
|
159
|
+
*1. Compliance Programme to Address Statutory Obligations*
|
160
|
+
|
161
|
+
An approved trustee should have in place a compliance programme to help it meet its statutory obligations.
|
162
|
+
|
163
|
+
_1E. Explanatory Notes and Guidance_
|
164
|
+
|
165
|
+
An approved trustee must comply with obligations under the Legislation, including the general trustee duties as well as specific requirements relating to the operation of MPF schemes.
|
166
|
+
____
|
167
|
+
|
168
|
+
=== Container clauses
|
169
|
+
|
170
|
+
MPFD docuemnts follow a hierarchically numbered clause structure. However, there are some floating titles
|
171
|
+
in MPFD which group clauses together, but are not numbered themselves. These are tagged in MPFD Asciidoctor
|
172
|
+
with a `.container` role attribute. When the gem numbers clauses, these containers are ignored.
|
173
|
+
|
174
|
+
[source,asciidoctor]
|
175
|
+
--
|
176
|
+
== MPFD Structure
|
177
|
+
|
178
|
+
[.container]
|
179
|
+
=== Benefits
|
180
|
+
|
181
|
+
==== Autonumbering
|
182
|
+
|
183
|
+
==== Automaated cross-references
|
184
|
+
|
185
|
+
[.container]
|
186
|
+
=== Challenges
|
187
|
+
|
188
|
+
==== No WYSIWYG
|
189
|
+
|
190
|
+
==== Command Line Interface
|
191
|
+
--
|
192
|
+
|
193
|
+
Without the `.container` tags, the foregoing example would be rendered in HTML as:
|
194
|
+
|
195
|
+
[source,html]
|
196
|
+
--
|
197
|
+
<h1>1. MPFD Structure</h1>
|
198
|
+
|
199
|
+
<h2>1.1. Benefits</h2>
|
200
|
+
|
201
|
+
<h3>1.1.1. Autonumbering</h3>
|
202
|
+
|
203
|
+
<h3>1.1.2. Automated cross-references</h3>
|
204
|
+
|
205
|
+
<h2>1.2. Challenges</h2>
|
206
|
+
|
207
|
+
<h3>1.2.1. No WYSIWYG</h3>
|
208
|
+
|
209
|
+
<h3>1.2.2. Command Line Interface</h3>
|
210
|
+
--
|
211
|
+
|
212
|
+
With the `.container` tags, the nesting of clauses is the same, but the container titles
|
213
|
+
are at the same level as their parent sections, and are ignored in numbering:
|
214
|
+
|
215
|
+
[source,html]
|
216
|
+
--
|
217
|
+
<h1>1. MPFD Structure</h1>
|
218
|
+
|
219
|
+
<h1>Benefits</h1>
|
220
|
+
|
221
|
+
<h3>1.1. Autonumbering</h3>
|
222
|
+
|
223
|
+
<h3>1.2. Automated cross-references</h3>
|
224
|
+
|
225
|
+
<h1>Challenges</h1>
|
226
|
+
|
227
|
+
<h3>1.3. No WYSIWYG</h3>
|
228
|
+
|
229
|
+
<h3>1.4. Command Line Interface</h3>
|
230
|
+
--
|
231
|
+
|
232
|
+
=== Paragraph numbering
|
233
|
+
|
234
|
+
Currently paragraph numbering at the terminal node level is implemented by giving the paragraph a blank section title,
|
235
|
+
at the appropriate nesting level, which makes it a separate subclause. with an inline clause number.
|
236
|
+
|
237
|
+
[source,asciidoctor]
|
238
|
+
--
|
239
|
+
[[clause1]]
|
240
|
+
== Relationship between MPF trustees and promoters
|
241
|
+
|
242
|
+
[[clause1-1]]
|
243
|
+
=== {blank}
|
244
|
+
|
245
|
+
The Authority imposes a number of conditions when approving applications to become an approved MPF trustee.
|
246
|
+
--
|
247
|
+
|
248
|
+
This is rendered as
|
249
|
+
|
250
|
+
[source,html]
|
251
|
+
--
|
252
|
+
<div id="clause1">
|
253
|
+
<h1>1.  Relationship between MPF trustees and promoters</h1>
|
254
|
+
<div id="clause1-1"><h2>1.1. </h2>
|
255
|
+
|
256
|
+
<p id="_">The Authority imposes a number of conditions when approving applications to become an approved MPF trustee.</p>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
--
|
260
|
+
|
261
|
+
== Document Attributes
|
262
|
+
|
263
|
+
The gem uses the document attributes defined for metanorma-standoc (see
|
264
|
+
the https://github.com/riboseinc/metanorma-model-standoc/blob/master/README.adoc[metanorma-standoc README]).
|
265
|
+
|
266
|
+
The gem relies on Asciidoctor document attributes to provide necessary
|
267
|
+
metadata about the document. These include:
|
268
|
+
|
269
|
+
`:edition:`:: The document edition
|
270
|
+
|
271
|
+
`:revdate:`:: The date the document was last updated
|
272
|
+
|
273
|
+
`:copyright-year:`:: The year which will be claimed as when the copyright for
|
274
|
+
the document was issued
|
275
|
+
|
276
|
+
`:title:`:: The main component of the English title of the document
|
277
|
+
(mandatory). (The first line of the AsciiDoc document, which contains the title
|
278
|
+
introduced with `=`, is ignored)
|
279
|
+
|
280
|
+
`:doctype:`:: The document type (see RSD deliverables: The different types of
|
281
|
+
MPFD publications) (mandatory).
|
282
|
+
|
283
|
+
`:status:`:: The document status; e.g. `published`, `draft`.
|
284
|
+
|
285
|
+
`:committee:`:: The name of the relevant authoring committee
|
286
|
+
`:committee-type:`:: The type of the relevant authoring committee
|
287
|
+
|
288
|
+
`:language:` :: The language of the document (only `en` for now) (mandatory)
|
289
|
+
|
290
|
+
|
291
|
+
The attribute `:draft:`, if present, includes review notes in the XML output;
|
292
|
+
these are otherwise suppressed.
|
293
|
+
|
294
|
+
== Data Models
|
295
|
+
|
296
|
+
The MPFD Document format is an instance of the
|
297
|
+
https://github.com/riboseinc/isodoc-models[StandardDocument model]. Details of
|
298
|
+
this general model can be found on its page.
|
299
|
+
|
300
|
+
== Examples
|
301
|
+
|
302
|
+
Sample documents are available at http://github.com/riboseinc/mpfd-documents/
|
@@ -259,6 +259,9 @@
|
|
259
259
|
</define>
|
260
260
|
<define name="uri">
|
261
261
|
<element name="uri">
|
262
|
+
<optional>
|
263
|
+
<attribute name="type"/>
|
264
|
+
</optional>
|
262
265
|
<data type="anyURI"/>
|
263
266
|
</element>
|
264
267
|
</define>
|
@@ -384,7 +387,7 @@
|
|
384
387
|
</define>
|
385
388
|
<define name="LocalityType">
|
386
389
|
<data type="string">
|
387
|
-
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|example|volume|issue|locality:[a-zA-Z0-9_]+</param>
|
390
|
+
<param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|locality:[a-zA-Z0-9_]+</param>
|
388
391
|
</data>
|
389
392
|
</define>
|
390
393
|
<define name="referenceFrom">
|
@@ -411,6 +414,20 @@
|
|
411
414
|
<ref name="BibliographicItem"/>
|
412
415
|
</element>
|
413
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>
|
414
431
|
<define name="BibItemType" combine="choice">
|
415
432
|
<choice>
|
416
433
|
<value>article</value>
|
@@ -444,6 +461,9 @@
|
|
444
461
|
<ref name="BibItemType"/>
|
445
462
|
</attribute>
|
446
463
|
</optional>
|
464
|
+
<optional>
|
465
|
+
<ref name="fetched"/>
|
466
|
+
</optional>
|
447
467
|
<choice>
|
448
468
|
<oneOrMore>
|
449
469
|
<ref name="btitle"/>
|
@@ -456,6 +476,9 @@
|
|
456
476
|
<zeroOrMore>
|
457
477
|
<ref name="docidentifier"/>
|
458
478
|
</zeroOrMore>
|
479
|
+
<optional>
|
480
|
+
<ref name="docnumber"/>
|
481
|
+
</optional>
|
459
482
|
<zeroOrMore>
|
460
483
|
<ref name="bdate"/>
|
461
484
|
</zeroOrMore>
|
@@ -523,6 +546,14 @@
|
|
523
546
|
<ref name="FormattedString"/>
|
524
547
|
</element>
|
525
548
|
</define>
|
549
|
+
<define name="fetched">
|
550
|
+
<element name="fetched">
|
551
|
+
<choice>
|
552
|
+
<data type="dateTime"/>
|
553
|
+
<data type="date"/>
|
554
|
+
</choice>
|
555
|
+
</element>
|
556
|
+
</define>
|
526
557
|
<define name="validity">
|
527
558
|
<element name="validity">
|
528
559
|
<optional>
|
@@ -538,17 +569,26 @@
|
|
538
569
|
</define>
|
539
570
|
<define name="validityBegins">
|
540
571
|
<element name="validityBegins">
|
541
|
-
<
|
572
|
+
<choice>
|
573
|
+
<data type="dateTime"/>
|
574
|
+
<data type="date"/>
|
575
|
+
</choice>
|
542
576
|
</element>
|
543
577
|
</define>
|
544
578
|
<define name="validityEnds">
|
545
579
|
<element name="validityEnds">
|
546
|
-
<
|
580
|
+
<choice>
|
581
|
+
<data type="dateTime"/>
|
582
|
+
<data type="date"/>
|
583
|
+
</choice>
|
547
584
|
</element>
|
548
585
|
</define>
|
549
586
|
<define name="validityRevision">
|
550
587
|
<element name="revision">
|
551
|
-
<
|
588
|
+
<choice>
|
589
|
+
<data type="dateTime"/>
|
590
|
+
<data type="date"/>
|
591
|
+
</choice>
|
552
592
|
</element>
|
553
593
|
</define>
|
554
594
|
<define name="TypedTitleString">
|
@@ -599,6 +639,9 @@
|
|
599
639
|
<value>issued</value>
|
600
640
|
<value>transmitted</value>
|
601
641
|
<value>copied</value>
|
642
|
+
<value>unchanged</value>
|
643
|
+
<value>circulated</value>
|
644
|
+
<text/>
|
602
645
|
</choice>
|
603
646
|
</attribute>
|
604
647
|
<choice>
|
@@ -635,6 +678,11 @@
|
|
635
678
|
<text/>
|
636
679
|
</element>
|
637
680
|
</define>
|
681
|
+
<define name="docnumber">
|
682
|
+
<element name="docnumber">
|
683
|
+
<text/>
|
684
|
+
</element>
|
685
|
+
</define>
|
638
686
|
<define name="bclassification">
|
639
687
|
<element name="classification">
|
640
688
|
<optional>
|
@@ -700,8 +748,12 @@
|
|
700
748
|
<ref name="btitle"/>
|
701
749
|
<ref name="formattedref"/>
|
702
750
|
</choice>
|
703
|
-
<
|
704
|
-
|
751
|
+
<optional>
|
752
|
+
<ref name="bplace"/>
|
753
|
+
</optional>
|
754
|
+
<optional>
|
755
|
+
<ref name="seriesorganization"/>
|
756
|
+
</optional>
|
705
757
|
<optional>
|
706
758
|
<ref name="abbreviation"/>
|
707
759
|
</optional>
|
@@ -728,6 +780,7 @@
|
|
728
780
|
<element name="from">
|
729
781
|
<choice>
|
730
782
|
<data type="dateTime"/>
|
783
|
+
<data type="date"/>
|
731
784
|
<data type="gYear"/>
|
732
785
|
</choice>
|
733
786
|
</element>
|
@@ -736,6 +789,7 @@
|
|
736
789
|
<element name="to">
|
737
790
|
<choice>
|
738
791
|
<data type="dateTime"/>
|
792
|
+
<data type="date"/>
|
739
793
|
<data type="gYear"/>
|
740
794
|
</choice>
|
741
795
|
</element>
|
@@ -49,20 +49,13 @@ module Asciidoctor
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
|
-
def title(node, xml)
|
53
|
-
["en"].each do |lang|
|
54
|
-
xml.title **{ language: lang, format: "plain" } do |t|
|
55
|
-
t << asciidoc_sub(node.attr("title"))
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
52
|
def metadata_status(node, xml)
|
61
53
|
xml.status(**{ format: "plain" }) { |s| s << node.attr("status") }
|
62
54
|
end
|
63
55
|
|
64
56
|
def metadata_id(node, xml)
|
65
57
|
xml.docidentifier { |i| i << node.attr("docnumber") }
|
58
|
+
xml.docnumber { |i| i << node.attr("docnumber") }
|
66
59
|
end
|
67
60
|
|
68
61
|
def metadata_copyright(node, xml)
|
@@ -135,10 +128,6 @@ module Asciidoctor
|
|
135
128
|
File.join(File.dirname(__FILE__), "mpfd.rng"))
|
136
129
|
end
|
137
130
|
|
138
|
-
def rsd_html_path(file)
|
139
|
-
File.join(File.dirname(__FILE__), File.join("html", file))
|
140
|
-
end
|
141
|
-
|
142
131
|
def literal(node)
|
143
132
|
noko do |xml|
|
144
133
|
xml.figure **id_attr(node) do |f|
|
@@ -148,13 +137,6 @@ module Asciidoctor
|
|
148
137
|
end
|
149
138
|
end
|
150
139
|
|
151
|
-
def sections_cleanup(x)
|
152
|
-
super
|
153
|
-
x.xpath("//*[@inline-header]").each do |h|
|
154
|
-
h.delete("inline-header")
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
140
|
def style(n, t)
|
159
141
|
return
|
160
142
|
end
|
@@ -18,7 +18,21 @@
|
|
18
18
|
of this.
|
19
19
|
-->
|
20
20
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
21
|
-
<include href="biblio.rng"
|
21
|
+
<include href="biblio.rng">
|
22
|
+
<define name="status">
|
23
|
+
<element name="status">
|
24
|
+
<choice>
|
25
|
+
<value>proposal</value>
|
26
|
+
<value>working_draft</value>
|
27
|
+
<value>committee_draft</value>
|
28
|
+
<value>draft_standard</value>
|
29
|
+
<value>final_draft</value>
|
30
|
+
<value>published</value>
|
31
|
+
<value>withdrawn</value>
|
32
|
+
</choice>
|
33
|
+
</element>
|
34
|
+
</define>
|
35
|
+
</include>
|
22
36
|
<start>
|
23
37
|
<ref name="standard-document"/>
|
24
38
|
</start>
|
@@ -28,9 +42,10 @@
|
|
28
42
|
<optional>
|
29
43
|
<ref name="version"/>
|
30
44
|
</optional>
|
31
|
-
<
|
32
|
-
<ref name="
|
33
|
-
</
|
45
|
+
<optional>
|
46
|
+
<ref name="preface"/>
|
47
|
+
</optional>
|
48
|
+
<ref name="sections"/>
|
34
49
|
<zeroOrMore>
|
35
50
|
<ref name="annex"/>
|
36
51
|
</zeroOrMore>
|
@@ -44,11 +59,6 @@
|
|
44
59
|
<ref name="BibData"/>
|
45
60
|
</element>
|
46
61
|
</define>
|
47
|
-
<define name="status">
|
48
|
-
<element name="status">
|
49
|
-
<ref name="FormattedString"/>
|
50
|
-
</element>
|
51
|
-
</define>
|
52
62
|
<define name="version">
|
53
63
|
<element name="version">
|
54
64
|
<optional>
|
@@ -77,6 +87,13 @@
|
|
77
87
|
<text/>
|
78
88
|
</element>
|
79
89
|
</define>
|
90
|
+
<define name="preface">
|
91
|
+
<element name="preface">
|
92
|
+
<oneOrMore>
|
93
|
+
<ref name="content"/>
|
94
|
+
</oneOrMore>
|
95
|
+
</element>
|
96
|
+
</define>
|
80
97
|
<define name="sections">
|
81
98
|
<element name="sections">
|
82
99
|
<oneOrMore>
|
@@ -104,7 +121,9 @@
|
|
104
121
|
</define>
|
105
122
|
<define name="section-title">
|
106
123
|
<element name="title">
|
107
|
-
<
|
124
|
+
<zeroOrMore>
|
125
|
+
<ref name="TextElement"/>
|
126
|
+
</zeroOrMore>
|
108
127
|
</element>
|
109
128
|
</define>
|
110
129
|
<define name="content">
|
@@ -324,7 +343,7 @@
|
|
324
343
|
<attribute name="id">
|
325
344
|
<data type="ID"/>
|
326
345
|
</attribute>
|
327
|
-
<ref name="
|
346
|
+
<ref name="paragraph"/>
|
328
347
|
</element>
|
329
348
|
</define>
|
330
349
|
<define name="termsource">
|
@@ -423,7 +442,7 @@
|
|
423
442
|
<data type="ID"/>
|
424
443
|
</attribute>
|
425
444
|
<oneOrMore>
|
426
|
-
<ref name="paragraph
|
445
|
+
<ref name="paragraph"/>
|
427
446
|
</oneOrMore>
|
428
447
|
</element>
|
429
448
|
</define>
|
@@ -690,21 +709,20 @@
|
|
690
709
|
<ref name="tname"/>
|
691
710
|
</optional>
|
692
711
|
<choice>
|
693
|
-
<
|
712
|
+
<ref name="image"/>
|
713
|
+
<zeroOrMore>
|
694
714
|
<ref name="figure"/>
|
695
|
-
</
|
696
|
-
<group>
|
697
|
-
<zeroOrMore>
|
698
|
-
<ref name="TextElement"/>
|
699
|
-
</zeroOrMore>
|
700
|
-
<zeroOrMore>
|
701
|
-
<ref name="note"/>
|
702
|
-
</zeroOrMore>
|
703
|
-
<optional>
|
704
|
-
<ref name="dl"/>
|
705
|
-
</optional>
|
706
|
-
</group>
|
715
|
+
</zeroOrMore>
|
707
716
|
</choice>
|
717
|
+
<zeroOrMore>
|
718
|
+
<ref name="fn"/>
|
719
|
+
</zeroOrMore>
|
720
|
+
<optional>
|
721
|
+
<ref name="dl"/>
|
722
|
+
</optional>
|
723
|
+
<zeroOrMore>
|
724
|
+
<ref name="note"/>
|
725
|
+
</zeroOrMore>
|
708
726
|
</element>
|
709
727
|
</define>
|
710
728
|
<define name="TextElement">
|
@@ -938,6 +956,11 @@
|
|
938
956
|
</define>
|
939
957
|
<define name="li">
|
940
958
|
<element name="li">
|
959
|
+
<optional>
|
960
|
+
<attribute name="id">
|
961
|
+
<data type="ID"/>
|
962
|
+
</attribute>
|
963
|
+
</optional>
|
941
964
|
<oneOrMore>
|
942
965
|
<ref name="paragraph-with-footnote"/>
|
943
966
|
</oneOrMore>
|
@@ -981,7 +1004,9 @@
|
|
981
1004
|
</define>
|
982
1005
|
<define name="dt">
|
983
1006
|
<element name="dt">
|
984
|
-
<
|
1007
|
+
<zeroOrMore>
|
1008
|
+
<ref name="TextElement"/>
|
1009
|
+
</zeroOrMore>
|
985
1010
|
</element>
|
986
1011
|
</define>
|
987
1012
|
<define name="dd">
|
@@ -1009,6 +1034,9 @@
|
|
1009
1034
|
<zeroOrMore>
|
1010
1035
|
<ref name="docidentifier"/>
|
1011
1036
|
</zeroOrMore>
|
1037
|
+
<optional>
|
1038
|
+
<ref name="docnumber"/>
|
1039
|
+
</optional>
|
1012
1040
|
<zeroOrMore>
|
1013
1041
|
<ref name="bdate"/>
|
1014
1042
|
</zeroOrMore>
|