metanorma-standoc 1.11.3 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -31
- data/.gitignore +23 -0
- data/Gemfile +0 -1
- data/lib/asciidoctor/standoc/base.rb +2 -145
- data/lib/asciidoctor/standoc/blocks.rb +2 -238
- data/lib/asciidoctor/standoc/blocks_notes.rb +2 -100
- data/lib/asciidoctor/standoc/cleanup.rb +2 -208
- data/lib/asciidoctor/standoc/cleanup_amend.rb +2 -53
- data/lib/asciidoctor/standoc/cleanup_block.rb +2 -172
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +2 -212
- data/lib/asciidoctor/standoc/cleanup_footnotes.rb +2 -108
- data/lib/asciidoctor/standoc/cleanup_image.rb +2 -69
- data/lib/asciidoctor/standoc/cleanup_inline.rb +2 -189
- data/lib/asciidoctor/standoc/cleanup_maths.rb +2 -221
- data/lib/asciidoctor/standoc/cleanup_ref.rb +2 -169
- data/lib/asciidoctor/standoc/cleanup_ref_dl.rb +2 -103
- data/lib/asciidoctor/standoc/cleanup_reqt.rb +2 -110
- data/lib/asciidoctor/standoc/cleanup_section.rb +2 -184
- data/lib/asciidoctor/standoc/cleanup_section_names.rb +2 -91
- data/lib/asciidoctor/standoc/cleanup_symbols.rb +2 -47
- data/lib/asciidoctor/standoc/cleanup_table.rb +2 -67
- data/lib/asciidoctor/standoc/cleanup_terms.rb +2 -139
- data/lib/asciidoctor/standoc/cleanup_terms_designations.rb +2 -192
- data/lib/asciidoctor/standoc/cleanup_text.rb +2 -95
- data/lib/asciidoctor/standoc/cleanup_toc.rb +3 -0
- data/lib/asciidoctor/standoc/cleanup_xref.rb +2 -106
- data/lib/asciidoctor/standoc/converter.rb +2 -123
- data/lib/asciidoctor/standoc/datamodel/attributes_table_preprocessor.rb +2 -56
- data/lib/asciidoctor/standoc/datamodel/diagram_preprocessor.rb +2 -102
- data/lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb +3 -404
- data/lib/asciidoctor/standoc/deprecated.rb +5 -0
- data/lib/asciidoctor/standoc/front.rb +2 -219
- data/lib/asciidoctor/standoc/front_contributor.rb +2 -191
- data/lib/asciidoctor/standoc/inline.rb +2 -231
- data/lib/asciidoctor/standoc/lists.rb +2 -119
- data/lib/asciidoctor/standoc/macros.rb +2 -203
- data/lib/asciidoctor/standoc/macros_form.rb +2 -62
- data/lib/asciidoctor/standoc/macros_note.rb +2 -44
- data/lib/asciidoctor/standoc/macros_plantuml.rb +2 -112
- data/lib/asciidoctor/standoc/macros_terms.rb +2 -180
- data/lib/asciidoctor/standoc/ref.rb +2 -251
- data/lib/asciidoctor/standoc/ref_sect.rb +2 -153
- data/lib/asciidoctor/standoc/ref_utility.rb +2 -0
- data/lib/asciidoctor/standoc/render.rb +2 -116
- data/lib/asciidoctor/standoc/reqt.rb +2 -89
- data/lib/asciidoctor/standoc/section.rb +2 -194
- data/lib/asciidoctor/standoc/table.rb +2 -84
- data/lib/asciidoctor/standoc/term_lookup_cleanup.rb +2 -178
- data/lib/asciidoctor/standoc/terms.rb +2 -153
- data/lib/asciidoctor/standoc/utils.rb +2 -100
- data/lib/asciidoctor/standoc/validate.rb +2 -157
- data/lib/asciidoctor/standoc/validate_section.rb +2 -54
- data/lib/isodoc/html/htmlstyle.css +44 -29
- data/lib/isodoc/html/htmlstyle.scss +17 -12
- data/lib/metanorma/standoc/base.rb +163 -0
- data/lib/{asciidoctor → metanorma}/standoc/basicdoc.rng +0 -0
- data/lib/{asciidoctor → metanorma}/standoc/biblio.rng +2 -2
- data/lib/metanorma/standoc/blocks.rb +239 -0
- data/lib/metanorma/standoc/blocks_notes.rb +101 -0
- data/lib/metanorma/standoc/cleanup.rb +157 -0
- data/lib/metanorma/standoc/cleanup_amend.rb +54 -0
- data/lib/metanorma/standoc/cleanup_block.rb +173 -0
- data/lib/metanorma/standoc/cleanup_boilerplate.rb +213 -0
- data/lib/metanorma/standoc/cleanup_footnotes.rb +109 -0
- data/lib/metanorma/standoc/cleanup_image.rb +70 -0
- data/lib/metanorma/standoc/cleanup_inline.rb +190 -0
- data/lib/metanorma/standoc/cleanup_maths.rb +222 -0
- data/lib/metanorma/standoc/cleanup_ref.rb +170 -0
- data/lib/metanorma/standoc/cleanup_ref_dl.rb +104 -0
- data/lib/metanorma/standoc/cleanup_reqt.rb +111 -0
- data/lib/metanorma/standoc/cleanup_section.rb +212 -0
- data/lib/metanorma/standoc/cleanup_section_names.rb +92 -0
- data/lib/metanorma/standoc/cleanup_symbols.rb +48 -0
- data/lib/metanorma/standoc/cleanup_table.rb +68 -0
- data/lib/metanorma/standoc/cleanup_terms.rb +140 -0
- data/lib/metanorma/standoc/cleanup_terms_designations.rb +199 -0
- data/lib/metanorma/standoc/cleanup_text.rb +74 -0
- data/lib/metanorma/standoc/cleanup_toc.rb +98 -0
- data/lib/metanorma/standoc/cleanup_xref.rb +107 -0
- data/lib/metanorma/standoc/converter.rb +126 -0
- data/lib/metanorma/standoc/datamodel/attributes_table_preprocessor.rb +57 -0
- data/lib/metanorma/standoc/datamodel/diagram_preprocessor.rb +103 -0
- data/lib/metanorma/standoc/datamodel/plantuml_renderer.rb +409 -0
- data/lib/metanorma/standoc/front.rb +224 -0
- data/lib/metanorma/standoc/front_contributor.rb +192 -0
- data/lib/metanorma/standoc/inline.rb +232 -0
- data/lib/{asciidoctor → metanorma}/standoc/isodoc.rng +104 -3
- data/lib/metanorma/standoc/lists.rb +120 -0
- data/lib/metanorma/standoc/macros.rb +205 -0
- data/lib/metanorma/standoc/macros_embed.rb +72 -0
- data/lib/metanorma/standoc/macros_form.rb +63 -0
- data/lib/metanorma/standoc/macros_note.rb +45 -0
- data/lib/metanorma/standoc/macros_plantuml.rb +113 -0
- data/lib/metanorma/standoc/macros_terms.rb +194 -0
- data/lib/metanorma/standoc/ref.rb +243 -0
- data/lib/metanorma/standoc/ref_sect.rb +153 -0
- data/lib/{asciidoctor/standoc/ref_date_id.rb → metanorma/standoc/ref_utility.rb} +43 -5
- data/lib/metanorma/standoc/render.rb +115 -0
- data/lib/metanorma/standoc/reqt.rb +90 -0
- data/lib/{asciidoctor → metanorma}/standoc/reqt.rng +0 -0
- data/lib/metanorma/standoc/section.rb +209 -0
- data/lib/metanorma/standoc/table.rb +85 -0
- data/lib/metanorma/standoc/term_lookup_cleanup.rb +179 -0
- data/lib/metanorma/standoc/terms.rb +160 -0
- data/lib/metanorma/standoc/utils.rb +101 -0
- data/lib/metanorma/standoc/validate.rb +158 -0
- data/lib/metanorma/standoc/validate_section.rb +55 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/model_representation.adoc.erb +0 -0
- data/lib/{asciidoctor → metanorma}/standoc/views/datamodel/plantuml_representation.adoc.erb +0 -0
- data/lib/metanorma-standoc.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/assets/a1.adoc +8 -0
- data/spec/assets/a2.adoc +8 -0
- data/spec/assets/a3.adoc +9 -0
- data/spec/assets/a4.adoc +4 -0
- data/spec/{asciidoctor → metanorma}/base_spec.rb +499 -407
- data/spec/{asciidoctor → metanorma}/blank_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/blocks_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_blocks_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_sections_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/cleanup_spec.rb +5 -5
- data/spec/{asciidoctor → metanorma}/cleanup_terms_spec.rb +227 -119
- data/spec/{asciidoctor → metanorma}/datamodel/attributes_table_preprocessor_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/datamodel/diagram_preprocessor_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/inline_spec.rb +170 -1
- data/spec/{asciidoctor → metanorma}/isobib_cache_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/lists_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/macros_json2text_spec.rb +0 -0
- data/spec/{asciidoctor → metanorma}/macros_plantuml_spec.rb +3 -3
- data/spec/{asciidoctor → metanorma}/macros_spec.rb +97 -6
- data/spec/{asciidoctor → metanorma}/macros_yaml2text_spec.rb +0 -0
- data/spec/metanorma/refs_dl_spec.rb +863 -0
- data/spec/{asciidoctor → metanorma}/refs_spec.rb +522 -15
- data/spec/{asciidoctor → metanorma}/section_spec.rb +59 -1
- data/spec/{asciidoctor → metanorma}/table_spec.rb +1 -1
- data/spec/{asciidoctor → metanorma}/validate_spec.rb +2 -2
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml +46 -46
- data/spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml +12 -12
- data/spec/vcr_cassettes/hide_refs.yml +599 -0
- data/spec/vcr_cassettes/isobib_get_123.yml +12 -12
- data/spec/vcr_cassettes/isobib_get_123_1.yml +24 -24
- data/spec/vcr_cassettes/isobib_get_123_1_fr.yml +35 -35
- data/spec/vcr_cassettes/isobib_get_123_2001.yml +13 -13
- data/spec/vcr_cassettes/isobib_get_124.yml +10 -10
- data/spec/vcr_cassettes/rfcbib_get_rfc8341.yml +18 -18
- data/spec/vcr_cassettes/separates_iev_citations_by_top_level_clause.yml +46 -46
- metadata +88 -32
- data/spec/asciidoctor/refs_dl_spec.rb +0 -864
@@ -1,7 +1,7 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
require "fileutils"
|
3
3
|
|
4
|
-
RSpec.describe
|
4
|
+
RSpec.describe Metanorma::Standoc do
|
5
5
|
it "has a version number" do
|
6
6
|
expect(Metanorma::Standoc::VERSION).not_to be nil
|
7
7
|
end
|
@@ -26,7 +26,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
26
26
|
<stage>published</stage>
|
27
27
|
</status>
|
28
28
|
<copyright>
|
29
|
-
<from
|
29
|
+
<from>#{Time.now.year}</from>
|
30
30
|
</copyright>
|
31
31
|
<ext>
|
32
32
|
<doctype>article</doctype>
|
@@ -222,267 +222,284 @@ RSpec.describe Asciidoctor::Standoc do
|
|
222
222
|
:isbn: ISBN-13
|
223
223
|
:isbn10: ISBN-10
|
224
224
|
:classification: a:b, c
|
225
|
+
:toclevels: 2
|
226
|
+
:doctoclevels: 3
|
227
|
+
:htmltoclevels: 4
|
225
228
|
INPUT
|
226
229
|
output = <<~OUTPUT
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
230
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
231
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
232
|
+
<bibdata type="standard">
|
233
|
+
<title language="en" format="text/plain">Main Title — Title</title>
|
234
|
+
<docidentifier>1000-1</docidentifier>
|
235
|
+
<docidentifier type='ISBN'>ISBN-13</docidentifier>
|
236
|
+
<docidentifier type='ISBN10'>ISBN-10</docidentifier>
|
237
|
+
<docnumber>1000</docnumber>
|
238
|
+
<date type="published">
|
239
|
+
<on>1000-01-01</on>
|
240
|
+
</date>
|
241
|
+
<date type="accessed">
|
242
|
+
<on>1001-01-01</on>
|
243
|
+
</date>
|
244
|
+
<date type="created">
|
245
|
+
<on>1002-01-01</on>
|
246
|
+
</date>
|
247
|
+
<date type="implemented">
|
248
|
+
<on>1003-01-01</on>
|
249
|
+
</date>
|
250
|
+
<date type="obsoleted">
|
251
|
+
<on>1004-01-01</on>
|
252
|
+
</date>
|
253
|
+
<date type="confirmed">
|
254
|
+
<on>1005-01-01</on>
|
255
|
+
</date>
|
256
|
+
<date type="updated">
|
257
|
+
<on>1006-01-01</on>
|
258
|
+
</date>
|
259
|
+
<date type="issued">
|
260
|
+
<on>1007-01-01</on>
|
261
|
+
</date>
|
262
|
+
<date type="circulated">
|
263
|
+
<on>1008-01-01</on>
|
264
|
+
</date>
|
265
|
+
<date type="unchanged">
|
266
|
+
<on>1009-01-01</on>
|
267
|
+
</date>
|
268
|
+
<date type='vote-started'>
|
269
|
+
<on>1011-01-01</on>
|
270
|
+
</date>
|
271
|
+
<date type='vote-ended'>
|
272
|
+
<on>1012-01-01</on>
|
273
|
+
</date>
|
274
|
+
<date type="Fred">
|
275
|
+
<on>1010-01-01</on>
|
276
|
+
</date>
|
277
|
+
<date type="Jack">
|
278
|
+
<on>1010-01-01</on>
|
279
|
+
</date>
|
280
|
+
<contributor>
|
281
|
+
<role type="author"/>
|
282
|
+
<organization>
|
283
|
+
<name>Hanna Barbera</name>
|
284
|
+
</organization>
|
285
|
+
</contributor>
|
286
|
+
<contributor>
|
287
|
+
<role type="author"/>
|
288
|
+
<organization>
|
289
|
+
<name>Cartoon Network</name>
|
290
|
+
</organization>
|
291
|
+
</contributor>
|
292
|
+
<contributor>
|
293
|
+
<role type="author"/>
|
294
|
+
<organization>
|
295
|
+
<name>Ribose, Inc.</name>
|
296
|
+
</organization>
|
297
|
+
</contributor>
|
298
|
+
<contributor>
|
299
|
+
<role type="author"/>
|
300
|
+
<person>
|
301
|
+
<name>
|
302
|
+
<completename>Fred Flintstone</completename>
|
303
|
+
</name>
|
304
|
+
<affiliation>
|
305
|
+
<organization>
|
306
|
+
<name>Slate Rock and Gravel Company</name>
|
307
|
+
<abbreviation>SRG</abbreviation>
|
308
|
+
<subdivision>Hermeneutics Unit</subdivision>
|
309
|
+
<subdivision>Exegetical Subunit</subdivision>
|
310
|
+
<address>
|
311
|
+
<formattedAddress>
|
312
|
+
6 Rubble Way, Bedrock
|
313
|
+
</formattedAddress>
|
314
|
+
</address>
|
315
|
+
</organization>
|
316
|
+
</affiliation>
|
317
|
+
<phone>123</phone>
|
318
|
+
<phone type='fax'>456</phone>
|
319
|
+
<uri>http://slate.example.com</uri>
|
320
|
+
</person>
|
321
|
+
</contributor>
|
322
|
+
<contributor>
|
323
|
+
<role type="editor"/>
|
324
|
+
<person>
|
325
|
+
<name>
|
326
|
+
<forename>Barney</forename>
|
327
|
+
<initial>B. X.</initial>
|
328
|
+
<surname>Rubble</surname>
|
329
|
+
</name>
|
301
330
|
<affiliation>
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
<code>1</code>
|
475
|
-
</ics>
|
476
|
-
<ics>
|
477
|
-
<code>2</code>
|
478
|
-
</ics>
|
479
|
-
<ics>
|
480
|
-
<code>3</code>
|
481
|
-
</ics>
|
482
|
-
</ext>
|
483
|
-
</bibdata>
|
484
|
-
<sections/>
|
485
|
-
</standard-document>
|
331
|
+
<organization>
|
332
|
+
<name>Rockhead and Quarry Cave Construction Company</name>
|
333
|
+
<abbreviation>RQCCC</abbreviation>
|
334
|
+
<subdivision>Hermeneutics Unit</subdivision>
|
335
|
+
<subdivision>Exegetical Subunit</subdivision>
|
336
|
+
<address>
|
337
|
+
<formattedAddress>6A Rubble Way, <br/>Bedrock</formattedAddress>
|
338
|
+
</address>
|
339
|
+
</organization>
|
340
|
+
</affiliation>
|
341
|
+
<phone>789</phone>
|
342
|
+
<phone type='fax'>012</phone>
|
343
|
+
<email>barney@rockhead.example.com</email>
|
344
|
+
</person>
|
345
|
+
</contributor>
|
346
|
+
<contributor>
|
347
|
+
<role type="publisher"/>
|
348
|
+
<organization>
|
349
|
+
<name>Hanna Barbera</name>
|
350
|
+
<address>
|
351
|
+
<formattedAddress>
|
352
|
+
1 Infinity Loop
|
353
|
+
<br/>
|
354
|
+
California
|
355
|
+
</formattedAddress>
|
356
|
+
</address>
|
357
|
+
<phone>3333333</phone>
|
358
|
+
<phone type='fax'>4444444</phone>
|
359
|
+
<email>x@example.com</email>
|
360
|
+
<uri>http://www.example.com</uri>
|
361
|
+
</organization>
|
362
|
+
</contributor>
|
363
|
+
<contributor>
|
364
|
+
<role type="publisher"/>
|
365
|
+
<organization>
|
366
|
+
<name>Cartoon Network</name>
|
367
|
+
<address>
|
368
|
+
<formattedAddress>
|
369
|
+
1 Infinity Loop
|
370
|
+
<br/>
|
371
|
+
California
|
372
|
+
</formattedAddress>
|
373
|
+
</address>
|
374
|
+
<phone>3333333</phone>
|
375
|
+
<phone type='fax'>4444444</phone>
|
376
|
+
<email>x@example.com</email>
|
377
|
+
<uri>http://www.example.com</uri>
|
378
|
+
</organization>
|
379
|
+
</contributor>
|
380
|
+
<contributor>
|
381
|
+
<role type="publisher"/>
|
382
|
+
<organization>
|
383
|
+
<name>Ribose, Inc.</name>
|
384
|
+
<address>
|
385
|
+
<formattedAddress>
|
386
|
+
1 Infinity Loop
|
387
|
+
<br/>
|
388
|
+
California
|
389
|
+
</formattedAddress>
|
390
|
+
</address>
|
391
|
+
<phone>3333333</phone>
|
392
|
+
<phone type='fax'>4444444</phone>
|
393
|
+
<email>x@example.com</email>
|
394
|
+
<uri>http://www.example.com</uri>
|
395
|
+
</organization>
|
396
|
+
</contributor>
|
397
|
+
<edition>2</edition>
|
398
|
+
<version>
|
399
|
+
<revision-date>2000-01-01</revision-date>
|
400
|
+
<draft>3.4</draft>
|
401
|
+
</version>
|
402
|
+
<language>en</language>
|
403
|
+
<script>Latn</script>
|
404
|
+
<status>
|
405
|
+
<stage>10</stage>
|
406
|
+
<substage>20</substage>
|
407
|
+
<iteration>3</iteration>
|
408
|
+
</status>
|
409
|
+
<copyright>
|
410
|
+
<from>2001</from>
|
411
|
+
<owner>
|
412
|
+
<organization>
|
413
|
+
<name>Ribose, Inc.</name>
|
414
|
+
<address>
|
415
|
+
<formattedAddress>
|
416
|
+
1 Infinity Loop
|
417
|
+
<br/>
|
418
|
+
California
|
419
|
+
</formattedAddress>
|
420
|
+
</address>
|
421
|
+
<phone>3333333</phone>
|
422
|
+
<phone type='fax'>4444444</phone>
|
423
|
+
<email>x@example.com</email>
|
424
|
+
<uri>http://www.example.com</uri>
|
425
|
+
</organization>
|
426
|
+
</owner>
|
427
|
+
</copyright>
|
428
|
+
<copyright>
|
429
|
+
<from>2001</from>
|
430
|
+
<owner>
|
431
|
+
<organization>
|
432
|
+
<name>Hanna Barbera</name>
|
433
|
+
<address>
|
434
|
+
<formattedAddress>
|
435
|
+
1 Infinity Loop
|
436
|
+
<br/>
|
437
|
+
California
|
438
|
+
</formattedAddress>
|
439
|
+
</address>
|
440
|
+
<phone>3333333</phone>
|
441
|
+
<phone type='fax'>4444444</phone>
|
442
|
+
<email>x@example.com</email>
|
443
|
+
<uri>http://www.example.com</uri>
|
444
|
+
</organization>
|
445
|
+
</owner>
|
446
|
+
</copyright>
|
447
|
+
<relation type="partOf">
|
448
|
+
<bibitem>
|
449
|
+
<title>--</title>
|
450
|
+
<docidentifier>ABC</docidentifier>
|
451
|
+
</bibitem>
|
452
|
+
</relation>
|
453
|
+
<relation type="translatedFrom">
|
454
|
+
<bibitem>
|
455
|
+
<title>GHI</title>
|
456
|
+
<docidentifier>DEF</docidentifier>
|
457
|
+
</bibitem>
|
458
|
+
</relation>
|
459
|
+
<relation type="translatedFrom">
|
460
|
+
<bibitem>
|
461
|
+
<title>PQR</title>
|
462
|
+
<docidentifier>JKL MNO</docidentifier>
|
463
|
+
</bibitem>
|
464
|
+
</relation>
|
465
|
+
<classification type='a'>b</classification>
|
466
|
+
<classification type='default'>c</classification>
|
467
|
+
<keyword>a</keyword>
|
468
|
+
<keyword>b</keyword>
|
469
|
+
<keyword>c</keyword>
|
470
|
+
<ext>
|
471
|
+
<doctype>article</doctype>
|
472
|
+
<editorialgroup>
|
473
|
+
<technical-committee number="1" type="A">TC</technical-committee>
|
474
|
+
<technical-committee number="11" type="A1">TC1</technical-committee>
|
475
|
+
</editorialgroup>
|
476
|
+
<ics>
|
477
|
+
<code>1</code>
|
478
|
+
</ics>
|
479
|
+
<ics>
|
480
|
+
<code>2</code>
|
481
|
+
</ics>
|
482
|
+
<ics>
|
483
|
+
<code>3</code>
|
484
|
+
</ics>
|
485
|
+
</ext>
|
486
|
+
</bibdata>
|
487
|
+
<misc-container>
|
488
|
+
<presentation-metadata>
|
489
|
+
<name>TOC Heading Levels</name>
|
490
|
+
<value>2</value>
|
491
|
+
</presentation-metadata>
|
492
|
+
<presentation-metadata>
|
493
|
+
<name>TOC Heading Levels</name>
|
494
|
+
<value>2</value>
|
495
|
+
</presentation-metadata>
|
496
|
+
<presentation-metadata>
|
497
|
+
<name>TOC Heading Levels</name>
|
498
|
+
<value>2</value>
|
499
|
+
</presentation-metadata>
|
500
|
+
</misc-container>
|
501
|
+
<sections/>
|
502
|
+
</standard-document>
|
486
503
|
OUTPUT
|
487
504
|
expect(xmlpp(Asciidoctor.convert(input, *OPTIONS)))
|
488
505
|
.to be_equivalent_to xmlpp(output)
|
@@ -527,6 +544,10 @@ RSpec.describe Asciidoctor::Standoc do
|
|
527
544
|
:city_2: Sèvres CEDEX
|
528
545
|
:country_2: France
|
529
546
|
:postcode_2: F-92312
|
547
|
+
:semantic-metadata-hello-world: A, B, "C, D"
|
548
|
+
:semantic-metadata-hello: what-not
|
549
|
+
:presentation-metadata-hello: Hello?
|
550
|
+
:presentation-metadata-Manifold: "hello, world","yes"
|
530
551
|
|
531
552
|
[abstract]
|
532
553
|
== Abstract
|
@@ -538,147 +559,170 @@ RSpec.describe Asciidoctor::Standoc do
|
|
538
559
|
== Clause 1
|
539
560
|
INPUT
|
540
561
|
output = <<~OUTPUT
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
<
|
672
|
-
|
673
|
-
|
674
|
-
</
|
675
|
-
</
|
676
|
-
<
|
677
|
-
<
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
562
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
563
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
564
|
+
<bibdata type="standard">
|
565
|
+
<title language="en" format="text/plain">Document title</title>
|
566
|
+
<title language="eo" format="text/plain">Dokumenttitolo</title>
|
567
|
+
<uri>A</uri>
|
568
|
+
<uri type="xml">B</uri>
|
569
|
+
<uri type="html">C</uri>
|
570
|
+
<uri type="pdf">D</uri>
|
571
|
+
<uri type="doc">E</uri>
|
572
|
+
<uri type="relaton">F</uri>
|
573
|
+
<docidentifier>1000-1-1</docidentifier>
|
574
|
+
<docnumber>1000</docnumber>
|
575
|
+
<date type='published'>
|
576
|
+
<on>1000-01</on>
|
577
|
+
</date>
|
578
|
+
<contributor>
|
579
|
+
<role type="author"/>
|
580
|
+
<organization>
|
581
|
+
<name>IEC</name>
|
582
|
+
</organization>
|
583
|
+
</contributor>
|
584
|
+
<contributor>
|
585
|
+
<role type="author"/>
|
586
|
+
<organization>
|
587
|
+
<name>IETF</name>
|
588
|
+
</organization>
|
589
|
+
</contributor>
|
590
|
+
<contributor>
|
591
|
+
<role type="author"/>
|
592
|
+
<organization>
|
593
|
+
<name>ISO</name>
|
594
|
+
</organization>
|
595
|
+
</contributor>
|
596
|
+
<contributor>
|
597
|
+
<role type='author'/>
|
598
|
+
<person>
|
599
|
+
<name>
|
600
|
+
<completename>Fred Flintstone</completename>
|
601
|
+
</name>
|
602
|
+
<affiliation>
|
603
|
+
<organization>
|
604
|
+
<name>Slate Rock and Gravel Company</name>
|
605
|
+
<address>
|
606
|
+
<street>1 Infinity Loop</street>
|
607
|
+
<city>Cupertino</city>
|
608
|
+
<state>CA</state>
|
609
|
+
<country>USA</country>
|
610
|
+
<postcode>95014</postcode>
|
611
|
+
</address>
|
612
|
+
</organization>
|
613
|
+
</affiliation>
|
614
|
+
</person>
|
615
|
+
</contributor>
|
616
|
+
<contributor>
|
617
|
+
<role type='author'/>
|
618
|
+
<person>
|
619
|
+
<name>
|
620
|
+
<completename>Barney Rubble</completename>
|
621
|
+
</name>
|
622
|
+
<affiliation>
|
623
|
+
<organization>
|
624
|
+
<name>Slate Rock and Gravel Company</name>
|
625
|
+
<address>
|
626
|
+
<street>Pavillon de Breteuil</street>
|
627
|
+
<city>Sèvres CEDEX</city>
|
628
|
+
<country>France</country>
|
629
|
+
<postcode>F-92312</postcode>
|
630
|
+
</address>
|
631
|
+
</organization>
|
632
|
+
</affiliation>
|
633
|
+
</person>
|
634
|
+
</contributor>
|
635
|
+
<contributor>
|
636
|
+
<role type="publisher"/>
|
637
|
+
<organization>
|
638
|
+
<name>IEC</name>
|
639
|
+
</organization>
|
640
|
+
</contributor>
|
641
|
+
<contributor>
|
642
|
+
<role type="publisher"/>
|
643
|
+
<organization>
|
644
|
+
<name>IETF</name>
|
645
|
+
</organization>
|
646
|
+
</contributor>
|
647
|
+
<contributor>
|
648
|
+
<role type="publisher"/>
|
649
|
+
<organization>
|
650
|
+
<name>ISO</name>
|
651
|
+
</organization>
|
652
|
+
</contributor>
|
653
|
+
<version>
|
654
|
+
<revision-date>2000-01</revision-date>
|
655
|
+
</version>
|
656
|
+
<language>el</language>
|
657
|
+
<script>Grek</script>
|
658
|
+
<abstract><p>This is the abstract of the document</p>
|
659
|
+
<p>This is the second paragraph of the abstract of the document.</p></abstract>
|
660
|
+
<status><stage>published</stage></status>
|
661
|
+
<copyright>
|
662
|
+
<from>#{Date.today.year}</from>
|
663
|
+
<owner>
|
664
|
+
<organization>
|
665
|
+
<name>IEC</name>
|
666
|
+
</organization>
|
667
|
+
</owner>
|
668
|
+
</copyright>
|
669
|
+
<copyright>
|
670
|
+
<from>#{Date.today.year}</from>
|
671
|
+
<owner>
|
672
|
+
<organization>
|
673
|
+
<name>IETF</name>
|
674
|
+
</organization>
|
675
|
+
</owner>
|
676
|
+
</copyright>
|
677
|
+
<copyright>
|
678
|
+
<from>#{Date.today.year}</from>
|
679
|
+
<owner>
|
680
|
+
<organization>
|
681
|
+
<name>ISO</name>
|
682
|
+
</organization>
|
683
|
+
</owner>
|
684
|
+
</copyright>
|
685
|
+
<ext>
|
686
|
+
<doctype>this-is-a-doctype</doctype>
|
687
|
+
<subdoctype>This is a DocSubType</subdoctype>
|
688
|
+
</ext>
|
689
|
+
</bibdata>
|
690
|
+
<misc-container>
|
691
|
+
<semantic-metadata>
|
692
|
+
<hello-world>A</hello-world>
|
693
|
+
</semantic-metadata>
|
694
|
+
<semantic-metadata>
|
695
|
+
<hello-world>B</hello-world>
|
696
|
+
</semantic-metadata>
|
697
|
+
<semantic-metadata>
|
698
|
+
<hello-world>C, D</hello-world>
|
699
|
+
</semantic-metadata>
|
700
|
+
<semantic-metadata>
|
701
|
+
<hello>what-not</hello>
|
702
|
+
</semantic-metadata>
|
703
|
+
<presentation-metadata>
|
704
|
+
<hello>Hello?</hello>
|
705
|
+
</presentation-metadata>
|
706
|
+
<presentation-metadata>
|
707
|
+
<manifold>hello, world</manifold>
|
708
|
+
</presentation-metadata>
|
709
|
+
<presentation-metadata>
|
710
|
+
<manifold>yes</manifold>
|
711
|
+
</presentation-metadata>
|
712
|
+
</misc-container>
|
713
|
+
<preface>
|
714
|
+
<abstract id='_'>
|
715
|
+
<title>Abstract</title>
|
716
|
+
<p id='_'>This is the abstract of the document</p>
|
717
|
+
<p id='_'>This is the second paragraph of the abstract of the document.</p>
|
718
|
+
</abstract>
|
719
|
+
</preface>
|
720
|
+
<sections>
|
721
|
+
<clause id='_' language='en' inline-header='false' obligation='normative'>
|
722
|
+
<title>Clause 1</title>
|
723
|
+
</clause>
|
724
|
+
</sections>
|
725
|
+
</standard-document>
|
682
726
|
OUTPUT
|
683
727
|
expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
|
684
728
|
.to be_equivalent_to xmlpp(output)
|
@@ -742,7 +786,7 @@ RSpec.describe Asciidoctor::Standoc do
|
|
742
786
|
<stage>published</stage>
|
743
787
|
</status>
|
744
788
|
<copyright>
|
745
|
-
<from
|
789
|
+
<from>#{Time.now.year}</from>
|
746
790
|
</copyright>
|
747
791
|
<ext>
|
748
792
|
<doctype>article</doctype>
|
@@ -849,6 +893,47 @@ RSpec.describe Asciidoctor::Standoc do
|
|
849
893
|
.to be_equivalent_to xmlpp(output)
|
850
894
|
end
|
851
895
|
|
896
|
+
it "processes document relations by description" do
|
897
|
+
mock_relaton_relation_descriptions
|
898
|
+
input = <<~INPUT
|
899
|
+
= Document title
|
900
|
+
Author
|
901
|
+
:docfile: test.adoc
|
902
|
+
:nodoc:
|
903
|
+
:novalid:
|
904
|
+
:normatively-cited-in: ABC
|
905
|
+
|
906
|
+
INPUT
|
907
|
+
output = <<~OUTPUT
|
908
|
+
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="#{Metanorma::Standoc::VERSION}">
|
909
|
+
<bibdata type='standard'>
|
910
|
+
<title language='en' format='text/plain'>Document title</title>
|
911
|
+
<language>en</language>
|
912
|
+
<script>Latn</script>
|
913
|
+
<status>
|
914
|
+
<stage>published</stage>
|
915
|
+
</status>
|
916
|
+
<copyright>
|
917
|
+
<from>#{Time.now.year}</from>
|
918
|
+
</copyright>
|
919
|
+
<relation type='isCitedIn'>
|
920
|
+
<description>normatively cited in</description>
|
921
|
+
<bibitem>
|
922
|
+
<title>--</title>
|
923
|
+
<docidentifier>ABC</docidentifier>
|
924
|
+
</bibitem>
|
925
|
+
</relation>
|
926
|
+
<ext>
|
927
|
+
<doctype>article</doctype>
|
928
|
+
</ext>
|
929
|
+
</bibdata>
|
930
|
+
<sections> </sections>
|
931
|
+
</standard-document>
|
932
|
+
OUTPUT
|
933
|
+
expect(xmlpp(Asciidoctor.convert(input, *OPTIONS)))
|
934
|
+
.to be_equivalent_to xmlpp(output)
|
935
|
+
end
|
936
|
+
|
852
937
|
it "reads scripts into blank HTML document" do
|
853
938
|
FileUtils.rm_f "test.html"
|
854
939
|
Asciidoctor.convert(<<~"INPUT", *OPTIONS)
|
@@ -959,21 +1044,21 @@ QU1FOiB0ZXN0Cgo=
|
|
959
1044
|
|
960
1045
|
it "process mn2pdf attributes" do
|
961
1046
|
node = Nokogiri::XML("<fake/>").at("fake")
|
962
|
-
node[
|
1047
|
+
node[Metanorma::Standoc::Base::FONTS_MANIFEST] =
|
963
1048
|
"passed/as/font/manifest/to/mn2pdf.jar"
|
964
1049
|
|
965
|
-
options =
|
1050
|
+
options = Metanorma::Standoc::Converter
|
966
1051
|
.new(:standoc, header_footer: true)
|
967
1052
|
.doc_extract_attributes(node)
|
968
1053
|
|
969
1054
|
expect(options.dig(:mn2pdf, :font_manifest))
|
970
|
-
.to eq(node[
|
1055
|
+
.to eq(node[Metanorma::Standoc::Base::FONTS_MANIFEST])
|
971
1056
|
end
|
972
1057
|
|
973
1058
|
private
|
974
1059
|
|
975
1060
|
def mock_org_abbrevs
|
976
|
-
allow_any_instance_of(::
|
1061
|
+
allow_any_instance_of(::Metanorma::Standoc::Front)
|
977
1062
|
.to receive(:org_abbrev).and_return(
|
978
1063
|
{ "International Standards Organization" => "ISO",
|
979
1064
|
"International Electrotechnical Commission" => "IEC" },
|
@@ -981,9 +1066,16 @@ QU1FOiB0ZXN0Cgo=
|
|
981
1066
|
end
|
982
1067
|
|
983
1068
|
def mock_default_publisher
|
984
|
-
allow_any_instance_of(::
|
1069
|
+
allow_any_instance_of(::Metanorma::Standoc::Front)
|
985
1070
|
.to receive(:default_publisher).and_return(
|
986
1071
|
"International Standards Organization",
|
987
1072
|
)
|
988
1073
|
end
|
1074
|
+
|
1075
|
+
def mock_relaton_relation_descriptions
|
1076
|
+
allow_any_instance_of(::Metanorma::Standoc::Front)
|
1077
|
+
.to receive(:relaton_relation_descriptions).and_return(
|
1078
|
+
"normatively-cited-in" => "isCitedIn",
|
1079
|
+
)
|
1080
|
+
end
|
989
1081
|
end
|