metanorma-sample 1.0.10 → 1.3.8

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c2e9242fe6f3b66d57f6db63c8da787fb79289a9bf9d244b1c35a08943b753c
4
- data.tar.gz: ecc62ec3a128afecedcfd1ae875a44c01e4dcc1413bba385cff4a0fd32724e44
3
+ metadata.gz: b31599505e6067bf7d3f589e0692cac63c9cc67cfd5f1b49591573dfefbb6d28
4
+ data.tar.gz: a8938174db426c577731f35e8f2c02c255220d68bfa0a677723ed293233049e2
5
5
  SHA512:
6
- metadata.gz: 4c18cc0cea371dbb925b63df38f43c61a6a4599936e8a26003d8a63488db4832d0367252a9525e0c51473dd12f172ed288970928ac663d2ad67474def777f95b
7
- data.tar.gz: 2be6aa30e3cac5c50cf1800e21fc693fc78a1ef0f27ea68c6777165e100a53ffea8900ae812b5024f62453b036dd2b1230b74ce972f0fbc61bbf0f22723da850
6
+ metadata.gz: 1694656607db98ddc01a624fe621186308a32eac575311ef0d969814acd828f2f13a55d8311229cc1849e4c9a21d51a1d0abe73c1191ccde7bd27805fe311abd
7
+ data.tar.gz: bfa5da88a17f6573f201bc31ba0b577c86aa7b426b25111d81cfadbcd46948c8af8906d44dbb58adb8818da82138ef48188a9549137968dbd6a68645358eb6b2
@@ -0,0 +1,35 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
3
+ name: macos
4
+
5
+ on: [push, pull_request]
6
+
7
+ jobs:
8
+ test-macos:
9
+ name: Test on Ruby ${{ matrix.ruby }} macOS
10
+ runs-on: macos-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [ '2.6', '2.5', '2.4' ]
15
+ steps:
16
+ - uses: actions/checkout@master
17
+ - name: Use Ruby
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ architecture: 'x64'
22
+ - name: Update gems
23
+ run: |
24
+ sudo gem install bundler --force
25
+ bundle install --jobs 4 --retry 3
26
+ - name: Use Node
27
+ uses: actions/setup-node@v1
28
+ with:
29
+ node-version: '8'
30
+ - name: Install Puppeteer
31
+ run: |
32
+ npm install -g puppeteer
33
+ - name: Run specs
34
+ run: |
35
+ bundle exec rake
@@ -0,0 +1,35 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
3
+ name: ubuntu
4
+
5
+ on: [push, pull_request]
6
+
7
+ jobs:
8
+ test-linux:
9
+ name: Test on Ruby ${{ matrix.ruby }} Ubuntu
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [ '2.6', '2.5', '2.4' ]
15
+ steps:
16
+ - uses: actions/checkout@master
17
+ - name: Use Ruby
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ architecture: 'x64'
22
+ - name: Update gems
23
+ run: |
24
+ gem install bundler
25
+ bundle install --jobs 4 --retry 3
26
+ - name: Use Node
27
+ uses: actions/setup-node@v1
28
+ with:
29
+ node-version: '8'
30
+ - name: Install Puppeteer
31
+ run: |
32
+ npm install -g puppeteer
33
+ - name: Run specs
34
+ run: |
35
+ bundle exec rake
@@ -0,0 +1,38 @@
1
+ # Auto-generated !!! Do not edit it manually
2
+ # use ci-master https://github.com/metanorma/metanorma-build-scripts
3
+ name: windows
4
+
5
+ on: [push, pull_request]
6
+
7
+ jobs:
8
+ test-windows:
9
+ name: Test on Ruby ${{ matrix.ruby }} Windows
10
+ runs-on: windows-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ ruby: [ '2.6', '2.5', '2.4' ]
15
+ steps:
16
+ - uses: actions/checkout@master
17
+ - name: Use Ruby
18
+ uses: actions/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ architecture: 'x64'
22
+ - name: Update gems
23
+ shell: pwsh
24
+ run: |
25
+ gem install bundler
26
+ bundle config --local path vendor/bundle
27
+ bundle update
28
+ bundle install --jobs 4 --retry 3
29
+ - name: Use Node
30
+ uses: actions/setup-node@v1
31
+ with:
32
+ node-version: '8'
33
+ - name: Install Puppeteer
34
+ run: |
35
+ npm install -g puppeteer
36
+ - name: Run specs
37
+ run: |
38
+ bundle exec rake
data/Gemfile CHANGED
@@ -1,4 +1,11 @@
1
+ Encoding.default_external = Encoding::UTF_8
2
+ Encoding.default_internal = Encoding::UTF_8
3
+
1
4
  source "https://rubygems.org"
2
- git_source(:github) {|repo| "https://github.com/#{repo}" }
5
+ git_source(:github) { |repo| "https://github.com/#{repo}" }
3
6
 
4
7
  gemspec
8
+
9
+ if File.exist? 'Gemfile.devel'
10
+ eval File.read('Gemfile.devel'), nil, 'Gemfile.devel' # rubocop:disable Security/Eval
11
+ end
@@ -1,13 +1,14 @@
1
1
  = metanorma-sample: Sample Asciidoctor processor for Metanorma documents
2
2
 
3
- ////
4
- image:https://img.shields.io/gem/v/asciidoctor-metanorma_sample.svg["Gem Version", link="https://rubygems.org/gems/asciidoctor-metanorma_sample"]
5
- image:https://img.shields.io/travis/riboseinc/asciidoctor-metanorma_sample/master.svg["Build Status", link="https://travis-ci.org/riboseinc/asciidoctor-metanorma_sample"]
6
- image:https://codeclimate.com/github/riboseinc/asciidoctor-metanorma_sample/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/asciidoctor-metanorma_sample"]
7
- ////
3
+ image:https://img.shields.io/gem/v/metanorma-acme.svg["Gem Version", link="https://rubygems.org/gems/metanorma-acme"]
4
+ image:https://travis-ci.com/metanorma/metanorma-sample.svg["Build Status", link="https://travis-ci.com/metanorma/metanorma-sample"]
5
+ image:https://ci.appveyor.com/api/projects/status/k8092dp6r0g2fojv?svg=true["Appveyor Build Status", link="https://ci.appveyor.com/project/metanorma/metanorma-sample"]
6
+ image:https://codeclimate.com/github/metanorma/metanorma-sample/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-sample"]
7
+ image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-sample.svg["Pull Requests", link="https://github.com/metanorma/metanorma-sample/pulls"]
8
+ image:https://img.shields.io/github/commits-since/metanorma/metanorma-sample/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-sample/releases"]
8
9
 
9
10
  == Functionality
10
11
 
11
- This is an example of a https://github.com/riboseinc/metanorma[Metanorma] gem for processing input formats (Asciidoctor) and generating output formats (Word, HTML, PDF).
12
- It has been created as an exemplar for generating new instances of Metanorma gems, as illustrated in https://github.com/riboseinc/asciidoctor-iso/wiki/Gem-Customisation-Guide
12
+ This is an example of a https://github.com/metanorma/metanorma[Metanorma] gem for processing input formats (Asciidoctor) and generating output formats (Word, HTML, PDF).
13
+ It has been created as an exemplar for generating new instances of Metanorma gems, as illustrated in https://www.metanorma.com/builder/howto/adopting-toolchain/
13
14
 
@@ -0,0 +1,1045 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
+ <include href="biblio.rng">
4
+ <start>
5
+ <ref name="document"/>
6
+ </start>
7
+ </include>
8
+ <define name="document">
9
+ <element name="document">
10
+ <optional>
11
+ <attribute name="identifier"/>
12
+ </optional>
13
+ <ref name="bibdata"/>
14
+ <ref name="sections"/>
15
+ <zeroOrMore>
16
+ <ref name="references"/>
17
+ </zeroOrMore>
18
+ </element>
19
+ </define>
20
+ <define name="bibdata">
21
+ <element name="bibdata">
22
+ <ref name="BibData"/>
23
+ </element>
24
+ </define>
25
+ <define name="sections">
26
+ <element name="sections">
27
+ <oneOrMore>
28
+ <ref name="section"/>
29
+ </oneOrMore>
30
+ </element>
31
+ </define>
32
+ <define name="section">
33
+ <element name="section">
34
+ <ref name="Basic-Section"/>
35
+ <zeroOrMore>
36
+ <ref name="section"/>
37
+ </zeroOrMore>
38
+ </element>
39
+ </define>
40
+ <define name="Basic-Section">
41
+ <optional>
42
+ <attribute name="id">
43
+ <data type="ID"/>
44
+ </attribute>
45
+ </optional>
46
+ <optional>
47
+ <attribute name="language"/>
48
+ </optional>
49
+ <optional>
50
+ <attribute name="script"/>
51
+ </optional>
52
+ <optional>
53
+ <ref name="section-title"/>
54
+ </optional>
55
+ <zeroOrMore>
56
+ <ref name="BasicBlock"/>
57
+ </zeroOrMore>
58
+ <zeroOrMore>
59
+ <ref name="note"/>
60
+ </zeroOrMore>
61
+ </define>
62
+ <define name="references">
63
+ <element name="references">
64
+ <optional>
65
+ <attribute name="id">
66
+ <data type="ID"/>
67
+ </attribute>
68
+ </optional>
69
+ <optional>
70
+ <ref name="section-title"/>
71
+ </optional>
72
+ <zeroOrMore>
73
+ <ref name="BasicBlock"/>
74
+ </zeroOrMore>
75
+ <zeroOrMore>
76
+ <ref name="bibitem"/>
77
+ </zeroOrMore>
78
+ </element>
79
+ </define>
80
+ <define name="section-title">
81
+ <element name="title">
82
+ <zeroOrMore>
83
+ <ref name="TextElement"/>
84
+ </zeroOrMore>
85
+ </element>
86
+ </define>
87
+ <define name="BasicBlock">
88
+ <choice>
89
+ <ref name="paragraph-with-footnote"/>
90
+ <ref name="table"/>
91
+ <ref name="formula"/>
92
+ <ref name="admonition"/>
93
+ <ref name="ol"/>
94
+ <ref name="ul"/>
95
+ <ref name="dl"/>
96
+ <ref name="figure"/>
97
+ <ref name="quote"/>
98
+ <ref name="sourcecode"/>
99
+ <ref name="example"/>
100
+ <ref name="review"/>
101
+ <ref name="pre"/>
102
+ </choice>
103
+ </define>
104
+ <define name="paragraph">
105
+ <element name="p">
106
+ <ref name="ParagraphType"/>
107
+ </element>
108
+ </define>
109
+ <define name="Alignments">
110
+ <choice>
111
+ <value>left</value>
112
+ <value>right</value>
113
+ <value>center</value>
114
+ <value>justified</value>
115
+ </choice>
116
+ </define>
117
+ <define name="ParagraphType">
118
+ <attribute name="id">
119
+ <data type="ID"/>
120
+ </attribute>
121
+ <optional>
122
+ <attribute name="align">
123
+ <ref name="Alignments"/>
124
+ </attribute>
125
+ </optional>
126
+ <zeroOrMore>
127
+ <ref name="TextElement"/>
128
+ </zeroOrMore>
129
+ <zeroOrMore>
130
+ <ref name="note"/>
131
+ </zeroOrMore>
132
+ </define>
133
+ <define name="paragraph-with-footnote">
134
+ <element name="p">
135
+ <attribute name="id">
136
+ <data type="ID"/>
137
+ </attribute>
138
+ <optional>
139
+ <attribute name="align">
140
+ <ref name="Alignments"/>
141
+ </attribute>
142
+ </optional>
143
+ <zeroOrMore>
144
+ <choice>
145
+ <ref name="TextElement"/>
146
+ <ref name="fn"/>
147
+ </choice>
148
+ </zeroOrMore>
149
+ <zeroOrMore>
150
+ <ref name="note"/>
151
+ </zeroOrMore>
152
+ </element>
153
+ </define>
154
+ <define name="note">
155
+ <element name="note">
156
+ <attribute name="id">
157
+ <data type="ID"/>
158
+ </attribute>
159
+ <oneOrMore>
160
+ <ref name="paragraph"/>
161
+ </oneOrMore>
162
+ </element>
163
+ </define>
164
+ <define name="review">
165
+ <element name="review">
166
+ <attribute name="id">
167
+ <data type="ID"/>
168
+ </attribute>
169
+ <attribute name="reviewer"/>
170
+ <optional>
171
+ <attribute name="date">
172
+ <data type="dateTime"/>
173
+ </attribute>
174
+ </optional>
175
+ <attribute name="from">
176
+ <data type="IDREF"/>
177
+ </attribute>
178
+ <optional>
179
+ <attribute name="to">
180
+ <data type="IDREF"/>
181
+ </attribute>
182
+ </optional>
183
+ <oneOrMore>
184
+ <ref name="paragraph"/>
185
+ </oneOrMore>
186
+ </element>
187
+ </define>
188
+ <define name="formula">
189
+ <element name="formula">
190
+ <attribute name="id">
191
+ <data type="ID"/>
192
+ </attribute>
193
+ <optional>
194
+ <attribute name="unnumbered">
195
+ <data type="boolean"/>
196
+ </attribute>
197
+ </optional>
198
+ <optional>
199
+ <attribute name="subsequence"/>
200
+ </optional>
201
+ <optional>
202
+ <attribute name="inequality">
203
+ <data type="boolean"/>
204
+ </attribute>
205
+ </optional>
206
+ <ref name="stem"/>
207
+ <optional>
208
+ <ref name="dl"/>
209
+ </optional>
210
+ <zeroOrMore>
211
+ <ref name="note"/>
212
+ </zeroOrMore>
213
+ </element>
214
+ </define>
215
+ <define name="quote">
216
+ <element name="quote">
217
+ <attribute name="id">
218
+ <data type="ID"/>
219
+ </attribute>
220
+ <optional>
221
+ <attribute name="alignment">
222
+ <ref name="Alignments"/>
223
+ </attribute>
224
+ </optional>
225
+ <optional>
226
+ <ref name="quote-source"/>
227
+ </optional>
228
+ <optional>
229
+ <ref name="quote-author"/>
230
+ </optional>
231
+ <oneOrMore>
232
+ <ref name="paragraph-with-footnote"/>
233
+ </oneOrMore>
234
+ <zeroOrMore>
235
+ <ref name="note"/>
236
+ </zeroOrMore>
237
+ </element>
238
+ </define>
239
+ <define name="quote-source">
240
+ <element name="source">
241
+ <ref name="erefType"/>
242
+ </element>
243
+ </define>
244
+ <define name="quote-author">
245
+ <element name="author">
246
+ <text/>
247
+ </element>
248
+ </define>
249
+ <define name="sourcecode">
250
+ <element name="sourcecode">
251
+ <attribute name="id">
252
+ <data type="ID"/>
253
+ </attribute>
254
+ <optional>
255
+ <attribute name="unnumbered">
256
+ <data type="boolean"/>
257
+ </attribute>
258
+ </optional>
259
+ <optional>
260
+ <attribute name="subsequence"/>
261
+ </optional>
262
+ <optional>
263
+ <attribute name="lang"/>
264
+ </optional>
265
+ <optional>
266
+ <ref name="tname"/>
267
+ </optional>
268
+ <oneOrMore>
269
+ <choice>
270
+ <text/>
271
+ <ref name="callout"/>
272
+ </choice>
273
+ </oneOrMore>
274
+ <zeroOrMore>
275
+ <ref name="annotation"/>
276
+ </zeroOrMore>
277
+ <zeroOrMore>
278
+ <ref name="note"/>
279
+ </zeroOrMore>
280
+ </element>
281
+ </define>
282
+ <define name="pre">
283
+ <element name="pre">
284
+ <attribute name="id">
285
+ <data type="ID"/>
286
+ </attribute>
287
+ <optional>
288
+ <attribute name="alt"/>
289
+ </optional>
290
+ <optional>
291
+ <ref name="tname"/>
292
+ </optional>
293
+ <text/>
294
+ <zeroOrMore>
295
+ <ref name="note"/>
296
+ </zeroOrMore>
297
+ </element>
298
+ </define>
299
+ <define name="table">
300
+ <element name="table">
301
+ <attribute name="id">
302
+ <data type="ID"/>
303
+ </attribute>
304
+ <optional>
305
+ <attribute name="unnumbered">
306
+ <data type="boolean"/>
307
+ </attribute>
308
+ </optional>
309
+ <optional>
310
+ <attribute name="subsequence"/>
311
+ </optional>
312
+ <optional>
313
+ <attribute name="alt"/>
314
+ </optional>
315
+ <optional>
316
+ <attribute name="summary"/>
317
+ </optional>
318
+ <optional>
319
+ <attribute name="uri">
320
+ <data type="anyURI"/>
321
+ </attribute>
322
+ </optional>
323
+ <optional>
324
+ <ref name="tname"/>
325
+ </optional>
326
+ <optional>
327
+ <ref name="thead"/>
328
+ </optional>
329
+ <ref name="tbody"/>
330
+ <optional>
331
+ <ref name="tfoot"/>
332
+ </optional>
333
+ <zeroOrMore>
334
+ <ref name="table-note"/>
335
+ </zeroOrMore>
336
+ <optional>
337
+ <ref name="dl"/>
338
+ </optional>
339
+ </element>
340
+ </define>
341
+ <define name="tname">
342
+ <element name="name">
343
+ <oneOrMore>
344
+ <ref name="PureTextElement"/>
345
+ </oneOrMore>
346
+ </element>
347
+ </define>
348
+ <define name="thead">
349
+ <element name="thead">
350
+ <ref name="tr"/>
351
+ </element>
352
+ </define>
353
+ <define name="tfoot">
354
+ <element name="tfoot">
355
+ <ref name="tr"/>
356
+ </element>
357
+ </define>
358
+ <define name="tbody">
359
+ <element name="tbody">
360
+ <oneOrMore>
361
+ <ref name="tr"/>
362
+ </oneOrMore>
363
+ </element>
364
+ </define>
365
+ <define name="table-note">
366
+ <element name="note">
367
+ <ref name="paragraph"/>
368
+ </element>
369
+ </define>
370
+ <define name="tr">
371
+ <element name="tr">
372
+ <oneOrMore>
373
+ <choice>
374
+ <ref name="td"/>
375
+ <ref name="th"/>
376
+ </choice>
377
+ </oneOrMore>
378
+ </element>
379
+ </define>
380
+ <define name="td">
381
+ <element name="td">
382
+ <optional>
383
+ <attribute name="colspan"/>
384
+ </optional>
385
+ <optional>
386
+ <attribute name="rowspan"/>
387
+ </optional>
388
+ <optional>
389
+ <attribute name="align">
390
+ <choice>
391
+ <value>left</value>
392
+ <value>right</value>
393
+ <value>center</value>
394
+ </choice>
395
+ </attribute>
396
+ </optional>
397
+ <choice>
398
+ <zeroOrMore>
399
+ <ref name="TextElement"/>
400
+ </zeroOrMore>
401
+ <oneOrMore>
402
+ <ref name="paragraph-with-footnote"/>
403
+ </oneOrMore>
404
+ </choice>
405
+ </element>
406
+ </define>
407
+ <define name="th">
408
+ <element name="th">
409
+ <optional>
410
+ <attribute name="colspan"/>
411
+ </optional>
412
+ <optional>
413
+ <attribute name="rowspan"/>
414
+ </optional>
415
+ <optional>
416
+ <attribute name="align">
417
+ <choice>
418
+ <value>left</value>
419
+ <value>right</value>
420
+ <value>center</value>
421
+ </choice>
422
+ </attribute>
423
+ </optional>
424
+ <choice>
425
+ <zeroOrMore>
426
+ <ref name="TextElement"/>
427
+ </zeroOrMore>
428
+ <oneOrMore>
429
+ <ref name="paragraph-with-footnote"/>
430
+ </oneOrMore>
431
+ </choice>
432
+ </element>
433
+ </define>
434
+ <define name="example">
435
+ <element name="example">
436
+ <attribute name="id">
437
+ <data type="ID"/>
438
+ </attribute>
439
+ <optional>
440
+ <attribute name="unnumbered">
441
+ <data type="boolean"/>
442
+ </attribute>
443
+ </optional>
444
+ <optional>
445
+ <attribute name="subsequence"/>
446
+ </optional>
447
+ <optional>
448
+ <ref name="tname"/>
449
+ </optional>
450
+ <oneOrMore>
451
+ <choice>
452
+ <ref name="formula"/>
453
+ <ref name="ul"/>
454
+ <ref name="ol"/>
455
+ <ref name="dl"/>
456
+ <ref name="quote"/>
457
+ <ref name="sourcecode"/>
458
+ <ref name="paragraph-with-footnote"/>
459
+ </choice>
460
+ </oneOrMore>
461
+ <zeroOrMore>
462
+ <ref name="note"/>
463
+ </zeroOrMore>
464
+ </element>
465
+ </define>
466
+ <define name="admonition">
467
+ <element name="admonition">
468
+ <attribute name="type">
469
+ <ref name="AdmonitionType"/>
470
+ </attribute>
471
+ <optional>
472
+ <attribute name="class"/>
473
+ </optional>
474
+ <attribute name="id">
475
+ <data type="ID"/>
476
+ </attribute>
477
+ <optional>
478
+ <attribute name="uri">
479
+ <data type="anyURI"/>
480
+ </attribute>
481
+ </optional>
482
+ <optional>
483
+ <ref name="tname"/>
484
+ </optional>
485
+ <zeroOrMore>
486
+ <ref name="paragraph-with-footnote"/>
487
+ </zeroOrMore>
488
+ <zeroOrMore>
489
+ <ref name="note"/>
490
+ </zeroOrMore>
491
+ </element>
492
+ </define>
493
+ <define name="AdmonitionType">
494
+ <choice>
495
+ <value>warning</value>
496
+ <value>note</value>
497
+ <value>tip</value>
498
+ <value>important</value>
499
+ <value>caution</value>
500
+ <value>statement</value>
501
+ </choice>
502
+ </define>
503
+ <define name="figure">
504
+ <element name="figure">
505
+ <attribute name="id">
506
+ <data type="ID"/>
507
+ </attribute>
508
+ <optional>
509
+ <attribute name="unnumbered">
510
+ <data type="boolean"/>
511
+ </attribute>
512
+ </optional>
513
+ <optional>
514
+ <attribute name="subsequence"/>
515
+ </optional>
516
+ <optional>
517
+ <attribute name="class"/>
518
+ </optional>
519
+ <optional>
520
+ <ref name="source"/>
521
+ </optional>
522
+ <optional>
523
+ <ref name="tname"/>
524
+ </optional>
525
+ <choice>
526
+ <ref name="image"/>
527
+ <ref name="video"/>
528
+ <ref name="audio"/>
529
+ <ref name="pre"/>
530
+ <oneOrMore>
531
+ <ref name="paragraph-with-footnote"/>
532
+ </oneOrMore>
533
+ <zeroOrMore>
534
+ <ref name="figure"/>
535
+ </zeroOrMore>
536
+ </choice>
537
+ <zeroOrMore>
538
+ <ref name="fn"/>
539
+ </zeroOrMore>
540
+ <optional>
541
+ <ref name="dl"/>
542
+ </optional>
543
+ <zeroOrMore>
544
+ <ref name="note"/>
545
+ </zeroOrMore>
546
+ </element>
547
+ </define>
548
+ <define name="TextElement">
549
+ <choice>
550
+ <text/>
551
+ <ref name="em"/>
552
+ <ref name="eref"/>
553
+ <ref name="strong"/>
554
+ <ref name="stem"/>
555
+ <ref name="sub"/>
556
+ <ref name="sup"/>
557
+ <ref name="tt"/>
558
+ <ref name="underline"/>
559
+ <ref name="keyword"/>
560
+ <ref name="ruby"/>
561
+ <ref name="strike"/>
562
+ <ref name="smallcap"/>
563
+ <ref name="xref"/>
564
+ <ref name="br"/>
565
+ <ref name="hyperlink"/>
566
+ <ref name="hr"/>
567
+ <ref name="pagebreak"/>
568
+ <ref name="bookmark"/>
569
+ <ref name="image"/>
570
+ <ref name="index"/>
571
+ </choice>
572
+ </define>
573
+ <define name="PureTextElement">
574
+ <choice>
575
+ <text/>
576
+ <ref name="em"/>
577
+ <ref name="strong"/>
578
+ <ref name="sub"/>
579
+ <ref name="sup"/>
580
+ <ref name="tt"/>
581
+ <ref name="underline"/>
582
+ <ref name="strike"/>
583
+ <ref name="smallcap"/>
584
+ <ref name="br"/>
585
+ </choice>
586
+ </define>
587
+ <define name="source">
588
+ <element name="source">
589
+ <ref name="TypedUri"/>
590
+ </element>
591
+ </define>
592
+ <define name="em">
593
+ <element name="em">
594
+ <zeroOrMore>
595
+ <ref name="PureTextElement"/>
596
+ </zeroOrMore>
597
+ </element>
598
+ </define>
599
+ <define name="strong">
600
+ <element name="strong">
601
+ <zeroOrMore>
602
+ <ref name="PureTextElement"/>
603
+ </zeroOrMore>
604
+ </element>
605
+ </define>
606
+ <define name="tt">
607
+ <element name="tt">
608
+ <zeroOrMore>
609
+ <ref name="PureTextElement"/>
610
+ </zeroOrMore>
611
+ </element>
612
+ </define>
613
+ <define name="keyword">
614
+ <element name="keyword">
615
+ <zeroOrMore>
616
+ <ref name="PureTextElement"/>
617
+ </zeroOrMore>
618
+ </element>
619
+ </define>
620
+ <define name="sub">
621
+ <element name="sub">
622
+ <zeroOrMore>
623
+ <ref name="PureTextElement"/>
624
+ </zeroOrMore>
625
+ </element>
626
+ </define>
627
+ <define name="sup">
628
+ <element name="sup">
629
+ <zeroOrMore>
630
+ <ref name="PureTextElement"/>
631
+ </zeroOrMore>
632
+ </element>
633
+ </define>
634
+ <define name="strike">
635
+ <element name="strike">
636
+ <zeroOrMore>
637
+ <ref name="PureTextElement"/>
638
+ </zeroOrMore>
639
+ </element>
640
+ </define>
641
+ <define name="underline">
642
+ <element name="underline">
643
+ <zeroOrMore>
644
+ <ref name="PureTextElement"/>
645
+ </zeroOrMore>
646
+ </element>
647
+ </define>
648
+ <define name="smallcap">
649
+ <element name="smallcap">
650
+ <zeroOrMore>
651
+ <ref name="PureTextElement"/>
652
+ </zeroOrMore>
653
+ </element>
654
+ </define>
655
+ <define name="ruby">
656
+ <element name="ruby">
657
+ <zeroOrMore>
658
+ <choice>
659
+ <ref name="PureTextElement"/>
660
+ <ref name="rp"/>
661
+ <ref name="rt"/>
662
+ </choice>
663
+ </zeroOrMore>
664
+ </element>
665
+ </define>
666
+ <define name="rp">
667
+ <element name="rp">
668
+ <zeroOrMore>
669
+ <ref name="PureTextElement"/>
670
+ </zeroOrMore>
671
+ </element>
672
+ </define>
673
+ <define name="rt">
674
+ <element name="rt">
675
+ <zeroOrMore>
676
+ <ref name="PureTextElement"/>
677
+ </zeroOrMore>
678
+ </element>
679
+ </define>
680
+ <define name="br">
681
+ <element name="br">
682
+ <empty/>
683
+ </element>
684
+ </define>
685
+ <define name="hr">
686
+ <element name="hr">
687
+ <empty/>
688
+ </element>
689
+ </define>
690
+ <define name="pagebreak">
691
+ <element name="pagebreak">
692
+ <empty/>
693
+ </element>
694
+ </define>
695
+ <define name="index">
696
+ <element name="index">
697
+ <attribute name="primary"/>
698
+ <optional>
699
+ <attribute name="secondary"/>
700
+ </optional>
701
+ <optional>
702
+ <attribute name="tertiary"/>
703
+ </optional>
704
+ </element>
705
+ </define>
706
+ <!-- bare ID element, used for referencing arbitrary spans of text -->
707
+ <define name="bookmark">
708
+ <element name="bookmark">
709
+ <attribute name="id">
710
+ <data type="ID"/>
711
+ </attribute>
712
+ <empty/>
713
+ </element>
714
+ </define>
715
+ <define name="ReferenceFormat">
716
+ <choice>
717
+ <value>external</value>
718
+ <value>inline</value>
719
+ <value>footnote</value>
720
+ <value>callout</value>
721
+ </choice>
722
+ </define>
723
+ <define name="eref">
724
+ <element name="eref">
725
+ <ref name="erefType"/>
726
+ </element>
727
+ </define>
728
+ <define name="erefType">
729
+ <optional>
730
+ <attribute name="normative">
731
+ <data type="boolean"/>
732
+ </attribute>
733
+ </optional>
734
+ <attribute name="citeas"/>
735
+ <attribute name="type">
736
+ <ref name="ReferenceFormat"/>
737
+ </attribute>
738
+ <optional>
739
+ <attribute name="alt"/>
740
+ </optional>
741
+ <ref name="CitationType"/>
742
+ <text/>
743
+ </define>
744
+ <define name="hyperlink">
745
+ <element name="link">
746
+ <attribute name="target">
747
+ <data type="anyURI"/>
748
+ </attribute>
749
+ <attribute name="type">
750
+ <ref name="ReferenceFormat"/>
751
+ </attribute>
752
+ <optional>
753
+ <attribute name="alt"/>
754
+ </optional>
755
+ <text/>
756
+ </element>
757
+ </define>
758
+ <define name="xref">
759
+ <element name="xref">
760
+ <attribute name="target">
761
+ <data type="IDREF"/>
762
+ </attribute>
763
+ <attribute name="type">
764
+ <ref name="ReferenceFormat"/>
765
+ </attribute>
766
+ <optional>
767
+ <attribute name="alt"/>
768
+ </optional>
769
+ <text/>
770
+ </element>
771
+ </define>
772
+ <define name="fn">
773
+ <element name="fn">
774
+ <attribute name="reference"/>
775
+ <oneOrMore>
776
+ <ref name="paragraph"/>
777
+ </oneOrMore>
778
+ </element>
779
+ </define>
780
+ <!--
781
+ This is xref with fixed @type="footnote", and @target built in as paragraph+
782
+ @reference replaces ReferenceElement/text
783
+ so <fn reference="2"><p>This is a footnote</p></fn>
784
+ corresponds to
785
+ <eref type="footnote" target="fn2">2</xref> <p id="fn2">This is a footnote</p>
786
+ -->
787
+ <define name="callout">
788
+ <element name="callout">
789
+ <attribute name="target">
790
+ <data type="IDREF"/>
791
+ </attribute>
792
+ <text/>
793
+ </element>
794
+ </define>
795
+ <!--
796
+ This is xref with fixed @type="callout"; the target by convention is in an annotation in the same source code snippet
797
+ so <callout target="xyz">1</callout>
798
+ corresponds to <xref type="callout" target="xyz">1</xref>
799
+ -->
800
+ <define name="image">
801
+ <element name="image">
802
+ <attribute name="id">
803
+ <data type="ID"/>
804
+ </attribute>
805
+ <attribute name="src">
806
+ <data type="anyURI"/>
807
+ </attribute>
808
+ <attribute name="mimetype"/>
809
+ <optional>
810
+ <attribute name="filename"/>
811
+ </optional>
812
+ <optional>
813
+ <attribute name="width">
814
+ <choice>
815
+ <data type="int"/>
816
+ <value>auto</value>
817
+ </choice>
818
+ </attribute>
819
+ </optional>
820
+ <optional>
821
+ <attribute name="height">
822
+ <choice>
823
+ <data type="int"/>
824
+ <value>auto</value>
825
+ </choice>
826
+ </attribute>
827
+ </optional>
828
+ <optional>
829
+ <attribute name="alt"/>
830
+ </optional>
831
+ <optional>
832
+ <attribute name="title"/>
833
+ </optional>
834
+ <optional>
835
+ <attribute name="longdesc">
836
+ <data type="anyURI"/>
837
+ </attribute>
838
+ </optional>
839
+ </element>
840
+ </define>
841
+ <define name="video">
842
+ <element name="video">
843
+ <attribute name="id">
844
+ <data type="ID"/>
845
+ </attribute>
846
+ <attribute name="src">
847
+ <data type="anyURI"/>
848
+ </attribute>
849
+ <attribute name="mimetype"/>
850
+ <optional>
851
+ <attribute name="filename"/>
852
+ </optional>
853
+ <optional>
854
+ <attribute name="width">
855
+ <choice>
856
+ <data type="int"/>
857
+ <value>auto</value>
858
+ </choice>
859
+ </attribute>
860
+ </optional>
861
+ <optional>
862
+ <attribute name="height">
863
+ <choice>
864
+ <data type="int"/>
865
+ <value>auto</value>
866
+ </choice>
867
+ </attribute>
868
+ </optional>
869
+ <optional>
870
+ <attribute name="alt"/>
871
+ </optional>
872
+ <optional>
873
+ <attribute name="title"/>
874
+ </optional>
875
+ <optional>
876
+ <attribute name="longdesc">
877
+ <data type="anyURI"/>
878
+ </attribute>
879
+ </optional>
880
+ <zeroOrMore>
881
+ <ref name="altsource"/>
882
+ </zeroOrMore>
883
+ </element>
884
+ </define>
885
+ <define name="audio">
886
+ <element name="audio">
887
+ <attribute name="id">
888
+ <data type="ID"/>
889
+ </attribute>
890
+ <attribute name="src">
891
+ <data type="anyURI"/>
892
+ </attribute>
893
+ <attribute name="mimetype"/>
894
+ <optional>
895
+ <attribute name="filename"/>
896
+ </optional>
897
+ <optional>
898
+ <attribute name="alt"/>
899
+ </optional>
900
+ <optional>
901
+ <attribute name="title"/>
902
+ </optional>
903
+ <optional>
904
+ <attribute name="longdesc">
905
+ <data type="anyURI"/>
906
+ </attribute>
907
+ </optional>
908
+ <zeroOrMore>
909
+ <ref name="altsource"/>
910
+ </zeroOrMore>
911
+ </element>
912
+ </define>
913
+ <define name="altsource">
914
+ <element name="altsource">
915
+ <attribute name="src">
916
+ <data type="anyURI"/>
917
+ </attribute>
918
+ <attribute name="mimetype"/>
919
+ <optional>
920
+ <attribute name="filename"/>
921
+ </optional>
922
+ </element>
923
+ </define>
924
+ <define name="stem">
925
+ <element name="stem">
926
+ <attribute name="type">
927
+ <choice>
928
+ <value>MathML</value>
929
+ <value>AsciiMath</value>
930
+ </choice>
931
+ </attribute>
932
+ <oneOrMore>
933
+ <choice>
934
+ <text/>
935
+ <ref name="AnyElement"/>
936
+ </choice>
937
+ </oneOrMore>
938
+ </element>
939
+ </define>
940
+ <define name="annotation">
941
+ <element name="annotation">
942
+ <attribute name="id">
943
+ <data type="ID"/>
944
+ </attribute>
945
+ <ref name="paragraph"/>
946
+ </element>
947
+ </define>
948
+ <define name="ul">
949
+ <element name="ul">
950
+ <attribute name="id">
951
+ <data type="ID"/>
952
+ </attribute>
953
+ <oneOrMore>
954
+ <ref name="li"/>
955
+ </oneOrMore>
956
+ <zeroOrMore>
957
+ <ref name="note"/>
958
+ </zeroOrMore>
959
+ </element>
960
+ </define>
961
+ <define name="li">
962
+ <element name="li">
963
+ <optional>
964
+ <attribute name="id">
965
+ <data type="ID"/>
966
+ </attribute>
967
+ </optional>
968
+ <oneOrMore>
969
+ <ref name="paragraph-with-footnote"/>
970
+ </oneOrMore>
971
+ </element>
972
+ </define>
973
+ <define name="ol">
974
+ <element name="ol">
975
+ <attribute name="id">
976
+ <data type="ID"/>
977
+ </attribute>
978
+ <attribute name="type">
979
+ <choice>
980
+ <value>roman</value>
981
+ <value>alphabet</value>
982
+ <value>arabic</value>
983
+ <value>roman_upper</value>
984
+ <value>alphabet_upper</value>
985
+ </choice>
986
+ </attribute>
987
+ <oneOrMore>
988
+ <ref name="li"/>
989
+ </oneOrMore>
990
+ <zeroOrMore>
991
+ <ref name="note"/>
992
+ </zeroOrMore>
993
+ </element>
994
+ </define>
995
+ <define name="dl">
996
+ <element name="dl">
997
+ <attribute name="id">
998
+ <data type="ID"/>
999
+ </attribute>
1000
+ <oneOrMore>
1001
+ <ref name="dt"/>
1002
+ <ref name="dd"/>
1003
+ </oneOrMore>
1004
+ <zeroOrMore>
1005
+ <ref name="note"/>
1006
+ </zeroOrMore>
1007
+ </element>
1008
+ </define>
1009
+ <define name="dt">
1010
+ <element name="dt">
1011
+ <zeroOrMore>
1012
+ <ref name="TextElement"/>
1013
+ </zeroOrMore>
1014
+ </element>
1015
+ </define>
1016
+ <define name="dd">
1017
+ <element name="dd">
1018
+ <zeroOrMore>
1019
+ <ref name="paragraph-with-footnote"/>
1020
+ </zeroOrMore>
1021
+ </element>
1022
+ </define>
1023
+ <define name="ext">
1024
+ <element name="ext">
1025
+ <ref name="BibDataExtensionType"/>
1026
+ </element>
1027
+ </define>
1028
+ <define name="BibDataExtensionType">
1029
+ <ref name="doctype"/>
1030
+ </define>
1031
+ <define name="doctype">
1032
+ <element name="doctype">
1033
+ <ref name="DocumentType"/>
1034
+ </element>
1035
+ </define>
1036
+ <define name="DocumentType">
1037
+ <value>document</value>
1038
+ </define>
1039
+ <define name="BibData">
1040
+ <ref name="BibliographicItem"/>
1041
+ <optional>
1042
+ <ref name="ext"/>
1043
+ </optional>
1044
+ </define>
1045
+ </grammar>