metanorma-taste 0.1.3 → 0.1.5

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/README.adoc +241 -64
  3. data/data/csa/config.yaml +25 -23
  4. data/data/csa/csa.standard.xsl +66 -76
  5. data/data/elf/config.yaml +10 -8
  6. data/data/enosema/config.yaml +10 -8
  7. data/data/icc/config.yaml +14 -12
  8. data/data/mbxif/config.yaml +26 -0
  9. data/data/mbxif/copyright.adoc +36 -0
  10. data/data/mbxif/i18n.yaml +4 -0
  11. data/data/mbxif/mbxif-back-cover.pdf +3504 -7
  12. data/data/mbxif/mbxif-front-cover.pdf +54968 -16
  13. data/data/mbxif/mbxif-logos.pdf +11330 -46
  14. data/data/mbxif/mbxif-logos_caeif.svg +1 -0
  15. data/data/mbxif/mbxif-logos_caxif.svg +1 -0
  16. data/data/mbxif/mbxif-logos_ewisif.svg +1 -0
  17. data/data/mbxif/mbxif-logos_jtif.svg +1 -0
  18. data/data/mbxif/mbxif-logos_lotar.svg +1 -0
  19. data/data/mbxif/mbxif-logos_mbxif.svg +1 -0
  20. data/data/mbxif/mbxif-logos_pdmif.svg +1 -0
  21. data/data/mbxif/mbxif.xsl +361 -0
  22. data/data/pdfa/config.yaml +16 -14
  23. data/data/pdfa/i18n.yaml +2 -4
  24. data/data/pdfa/pdfa-logo.emf +0 -0
  25. data/data/pdfa/pdfa-logo.svg +1 -1
  26. data/data/pdfa/pdfa.xsl +47 -10
  27. data/data/swf/config.yaml +14 -8
  28. data/data/swf/copyright.adoc +3 -4
  29. data/data/swf/swf-back-cover.pdf +3504 -7
  30. data/data/swf/swf-front-cover.pdf +3472 -3
  31. data/data/swf/swf-logo-with-graphic.svg +1 -0
  32. data/data/swf/swf-logo.svg +1 -0
  33. data/data/swf/swf.xsl +361 -0
  34. data/lib/metanorma/taste/base.rb +23 -19
  35. data/lib/metanorma/taste/base_override.rb +7 -47
  36. data/lib/metanorma/taste/filename_attributes.rb +53 -0
  37. data/lib/metanorma/taste/taste_config.rb +0 -34
  38. data/lib/metanorma/taste/value_attributes.rb +59 -0
  39. data/lib/metanorma/taste/version.rb +1 -1
  40. data/lib/metanorma/taste_register.rb +6 -6
  41. metadata +23 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93ec554922c0639b8d8145f5719df4b2bafdf898f97cefce58a8300a29637583
4
- data.tar.gz: 77ac6c4cae4af665e6100a4822d79b3b42fa67cd7f6b3ca0a4b203957013d303
3
+ metadata.gz: 8f4a74f3a7d05b348f0321f8b705f4ee3be169f70e3fed955dcb61c668bf4a6a
4
+ data.tar.gz: aab5942f506ae7ecf610db8ab24290e8867cb8ed889e6e4ea5357f1ff9130a78
5
5
  SHA512:
6
- metadata.gz: b0e0ef6772b27117b40bb0a65f3fc3221b1597dfba88720a9ec4148542d590771a6c52ed8020aef07784a7a930d7bae951bac9fd2b924aaad99c7a5b7d9d2e2d
7
- data.tar.gz: d7a246f2898f8ad2c0edbc77f27ebd5a03eb801d755102b7306d54e799abbfb86e817560023fa278ec81fa06f204f64aa0fe5398e480297539988f64694960ea
6
+ metadata.gz: 57a9509823af08dbabc4266a4c6a54d88c34f9e2b9f5bc4c0f99d47094ce96423e5dbdb7d469e4d5f054d13d37e40b1a3fb228d04fdc8cb6996e950897594b23
7
+ data.tar.gz: 9e1ac2f9d11c7917e9daa8af65fcb9478ee876b2ebcf25ffc4cbe9e07df45ff5dd1256b370b65068fc2b536150fca1d47389feafbb54583529539c70f202d5a8
data/README.adoc CHANGED
@@ -152,12 +152,12 @@ currently available:
152
152
  |`icc`
153
153
  |International Color Consortium
154
154
  |`iso`
155
- |ICC specifications and standards with ICC branding and copyright
155
+ |International Color Consortium specifications and standards with ICC branding and copyright
156
156
 
157
157
  |`elf`
158
158
  |Express Language Foundation
159
159
  |`iso`
160
- |ELF specifications and standards with ELF branding and copyright
160
+ |Express Language Foundation specifications and standards with ELF branding and copyright
161
161
 
162
162
  |`enosema`
163
163
  |Enosema Foundation
@@ -166,8 +166,24 @@ currently available:
166
166
 
167
167
  |`csa`
168
168
  |Cloud Security Alliance
169
- |`cc`
169
+ |`generic`
170
170
  |Cloud Security Alliance specifications and standards with CSA branding and copyright
171
+
172
+ |`pdfa`
173
+ |PDF Association
174
+ |`ribose`
175
+ |PDF Association specifications and standards with PDFA branding and copyright
176
+
177
+ |`swf`
178
+ |Spatial Web Foundation
179
+ |`ribose`
180
+ |Spatial Web Foundation specifications and standards with SWF branding and copyright
181
+
182
+ |`mbxif`
183
+ |MBx Interoperability Forum
184
+ |`ribose`
185
+ |MBx Interoperability Forum specifications and standards with MBx-IF branding and copyright
186
+
171
187
  |===
172
188
 
173
189
 
@@ -193,7 +209,10 @@ taste.
193
209
  === General
194
210
 
195
211
  A taste package is a directory structure that contains all the necessary files
196
- to define a Metanorma taste. It includes configuration files, copyright notices, internationalization dictionaries, and stylesheets if any.
212
+ to define a Metanorma taste.
213
+
214
+ It includes configuration files, copyright notices, internationalization
215
+ dictionaries, and stylesheets if any.
197
216
 
198
217
  === Directory structure
199
218
 
@@ -220,32 +239,36 @@ The main configuration file for each taste:
220
239
  flavor: string # The name of the custom flavor (e.g., "icc")
221
240
  owner: string # Organization name (e.g., "International Color Consortium")
222
241
  base-flavor: string # Base Metanorma flavor to extend (e.g., "iso")
223
- copyright-notice: string # Path to boilerplate file (e.g., "copyright.adoc"), which includes
224
- # copyright, license, legal, and feedback notices
225
- i18n-dictionary: string # Path to internationalization dictionary (e.g., "i18n.yaml")
226
- publisher-logo: string # Path to publisher logo (e.g., "icc.png")
227
- htmlcoverpage: string # HTML output cover page
228
- htmlintropage: string # HTML output introductory page
229
- htmlstylesheet: string # HTML output CSS stylesheet
230
- htmlstylesheet-override: string # HTML output CSS stylesheet, overriding base flavor stylesheet
231
- wordcoverpage: string # Word output cover page
232
- wordintropage: string # Word output introductory page
233
- wordstylesheet: string # Word output CSS stylesheet
234
- wordstylesheet-override: string # Word output CSS stylesheet, overriding base flavor stylesheet
235
- standardstylesheet: string # Word output secondary CSS stylesheet
236
- standardstylesheet-override: string # Word output secondary CSS stylesheet, overriding base flavor stylesheet
237
- header: string # Word output header and footer content
238
- pdf-stylesheet: string # PDF output XSLT stylesheet
239
- pdf-stylesheet-override: string # PDF output XSLT stylesheet, overriding base flavor stylesheet
240
- base-override: # Hash of document attributes to override from base flavor
241
- publisher: string # Publisher name override
242
- publisher_abbr: string # Publisher abbreviation
243
- body_font: string # Default font to use in HTML and Word stylesheets
244
- header_font: string # Header font to use in HTML and Word stylesheets
245
- monospace_font: string # Monospace font to use in HTML and Word stylesheets
246
- fonts: string # Comma-delimited listing of fonts to retrieve for the taste from Fontist
247
- output-extensions: string # Comma-delimited listing of output formats to support (subset of base flavor's)
248
- presentation-metadata-*: # Template style attributes for presentation
242
+ base-override: # Document attributes to override from base flavor
243
+ filename-attributes: # Metanorma document attributes that contain filenames
244
+ copyright-notice: string # Path to boilerplate file (e.g., "copyright.adoc")
245
+ i18n-dictionary: string # Path to internationalization dictionary (e.g., "i18n.yaml")
246
+ publisher-logo: string # Path to publisher logo (e.g., "icc.png")
247
+ htmlcoverpage: string # HTML output cover page
248
+ htmlintropage: string # HTML output introductory page
249
+ htmlstylesheet: string # HTML output CSS stylesheet
250
+ htmlstylesheet-override: string # HTML output CSS stylesheet, overriding base flavor stylesheet
251
+ wordcoverpage: string # Word output cover page
252
+ wordintropage: string # Word output introductory page
253
+ wordstylesheet: string # Word output CSS stylesheet
254
+ wordstylesheet-override: string # Word output CSS stylesheet, overriding base flavor stylesheet
255
+ standardstylesheet: string # Word output secondary CSS stylesheet
256
+ standardstylesheet-override: string # Word output secondary CSS stylesheet, overriding base flavor stylesheet
257
+ header: string # Word output header and footer content
258
+ pdf-stylesheet: string # PDF output XSLT stylesheet
259
+ pdf-stylesheet-override: string # PDF output XSLT stylesheet, overriding base flavor stylesheet
260
+ customize: string # Path to custom metanorma configuration file
261
+ coverpage-image: string # Path to coverpage image file
262
+ backpage-image: string # Path to backpage image file
263
+ value-attributes: # Metanorma document attributes that contain values
264
+ publisher: string # Publisher name override
265
+ publisher_abbr: string # Publisher abbreviation
266
+ body-font: string # Default font to use in HTML and Word stylesheets
267
+ header-font: string # Header font to use in HTML and Word stylesheets
268
+ monospace-font: string # Monospace font to use in HTML and Word stylesheets
269
+ fonts: string # Comma-delimited listing of fonts to retrieve for the taste from Fontist
270
+ output-extensions: string # Comma-delimited listing of output formats to support (subset of base flavor's)
271
+ presentation-metadata-*: # Template style attributes for presentation
249
272
  doctypes: # Array of doctypes built over base flavour doctypes
250
273
  - taste: # taste-specific machine-readable doctype name
251
274
  base: # Base Metanorma flavor corresponding machine-readable doctype name
@@ -260,13 +283,21 @@ doctypes: # Array of doctypes built over base flavour doctypes
260
283
  flavor: icc
261
284
  owner: International Color Consortium
262
285
  base-flavor: iso
263
- copyright-notice: copyright.adoc
264
- i18n-dictionary: i18n.yaml
265
286
  base-override:
266
- publisher: International Color Consortium
267
- publisher_abbr: ICC
268
- presentation-metadata-color-secondary: '#376795'
269
- presentation-metadata-backcover-text: color.org
287
+ filename-attributes:
288
+ copyright-notice: copyright.adoc
289
+ i18n-dictionary: i18n.yaml
290
+ publisher-logo: icc-full.svg
291
+ htmlcoverpage: htmlcoverpage.html
292
+ htmlstylesheet-override: htmlstylesheet-override.scss
293
+ value-attributes:
294
+ publisher: International Color Consortium
295
+ publisher_abbr: ICC
296
+ presentation-metadata-color-secondary: '#376795'
297
+ presentation-metadata-backcover-text: color.org
298
+ body-font: Arial, 'Helvetica Neue', Helvetica, sans-serif
299
+ header-font: Arial, 'Helvetica Neue', Helvetica, sans-serif
300
+ output-extensions: xml,html,pdf,doc
270
301
  doctypes:
271
302
  - taste: specification # Specification # The name goes into i18n.yaml
272
303
  base: international-standard
@@ -286,8 +317,11 @@ doctype_dict: # Document type translations
286
317
  # Add more document type mappings as needed
287
318
  ----
288
319
 
289
- Note that any taste-specific doctypes need to have a renderable corresponding entry under
290
- `doctype_dict`. The same is the case for the native doctypes in the base flavor's i18n.yaml files.
320
+ Every taste-specific doctype is required to have a renderable corresponding
321
+ entry under `doctype_dict`.
322
+
323
+ The same is the case for the native doctypes in the base flavor's `i18n.yaml`
324
+ files.
291
325
 
292
326
  .i18n.yaml example from ICC
293
327
  [example]
@@ -302,7 +336,10 @@ doctype_dict:
302
336
 
303
337
  ==== copyright.adoc
304
338
 
305
- Organization-specific copyright, legal, license and feedback text. This file can contain:
339
+ This file supplies taste-specific copyright, legal, license and feedback
340
+ text.
341
+
342
+ This file can contain:
306
343
 
307
344
  * Copyright statements with template variables (e.g., `{{ docyear }}`)
308
345
  * License information
@@ -327,38 +364,151 @@ The file is in the Metanorma AsciiDoc format, with the following syntax:
327
364
 
328
365
  Copyright (c) {{ docyear }} Your Organization Name
329
366
 
330
- [Legal text here...]
367
+ [legal text here...]
331
368
 
332
369
  == feedback-statement
333
- === Contact Information
370
+ === Contact information
334
371
 
335
- [Organization contact details...]
372
+ [organization contact details...]
336
373
  ----
337
374
  ====
338
375
 
339
- The same file format is used internally for Metanorma flavors, and is documented in
340
- https://www.metanorma.org/develop/topics/metadata-and-boilerplate/[Metadata and predefined text]
341
- on the metaorma.org site.
376
+ The same file format is used internally for Metanorma flavors, and is documented
377
+ in
378
+ https://www.metanorma.org/develop/topics/metadata-and-boilerplate/[Metadata and predefined text].
379
+
380
+ === Base-override configuration
381
+
382
+ ==== General
383
+
384
+ The `base-override` section allows customization of document attributes
385
+ supported by the base flavor through two categories.
386
+
387
+ The reason for this division is that some attributes contain file paths relative
388
+ to the taste definition, while others contain simple values that are not
389
+ relevant to path resolution.
390
+
391
+ * Filename attributes are used to point to custom files provided by the taste,
392
+ under the `data/{taste}/` directory.
393
+ +
394
+ [example]
395
+ ====
396
+ When `:publisher-logo: {logo-file-path}` is defined in the taste's
397
+ `config.yaml`, the actual logo file is expected to be located at
398
+ `data/{taste}/{logo-file-path}`.
399
+
400
+ When `:publisher-logo: {logo-file-path}` is defined as a document
401
+ attribute in the input document, the logo file is expected to be located
402
+ relative to the input document's location at
403
+ `{input-document-directory}/{logo-file-path}`.
404
+ ====
405
+
406
+ * Value attributes are simple values (strings, numbers, lists) that do not
407
+ involve file paths. These attributes are identical whether defined in the
408
+ taste's `config.yaml` or as document attributes in the input document.
409
+ +
410
+ [example]
411
+ ====
412
+ `:publisher_abbr: {abbreviation}` is a simple string value and does not
413
+ involve any file path resolution.
414
+ ====
415
+
416
+
417
+ ==== Filename attributes (`filename-attributes`)
418
+
419
+ These are Metanorma document attributes that take file paths as values.
420
+
421
+ `copyright-notice`::
422
+ Path to boilerplate file containing copyright, license, and legal notices
423
+
424
+ `i18n-dictionary`::
425
+ Path to internationalization dictionary
426
+
427
+ `publisher-logo`::
428
+ Path to organization logo file
429
+
430
+ `htmlcoverpage`, `htmlintropage`::
431
+ HTML output page templates
432
+
433
+ `htmlstylesheet`, `htmlstylesheet-override`::
434
+ HTML CSS stylesheets
435
+
436
+ `wordcoverpage`, `wordintropage`::
437
+ Word output page templates
438
+
439
+ `wordstylesheet`, `wordstylesheet-override`::
440
+ Word CSS stylesheets
342
441
 
343
- === Base-Override configuration
442
+ `standardstylesheet`, `standardstylesheet-override`::
443
+ Secondary Word CSS stylesheets
344
444
 
345
- The `base-override` section allows customization of any document attribute
346
- supported by the base flavor.
445
+ `header`::
446
+ Word output header and footer content
347
447
 
348
- This includes:
448
+ `pdf-stylesheet`, `pdf-stylesheet-override`::
449
+ PDF XSLT stylesheets
349
450
 
350
- Document attributes:
451
+ `customize`::
452
+ Path to custom metanorma configuration file
351
453
 
352
- * `publisher`: Organization name
353
- * `publisher_abbr`: Organization abbreviation
354
- * `doctype`: Document type mappings
355
- * Custom organization-specific attributes
454
+ `coverpage-image`, `backpage-image`::
455
+ Cover and back page image files
356
456
 
357
- Template style attributes:
358
457
 
359
- * `presentation-metadata-*`: Visual styling attributes
360
- * Color schemes, logos, layout preferences
361
- * Typography and formatting options
458
+ ==== Value attributes (`value-attributes`)
459
+
460
+ These are Metanorma document attributes that contain path-independent values.
461
+
462
+ `publisher`::
463
+ Organization name
464
+
465
+ `publisher_abbr`::
466
+ Organization abbreviation
467
+
468
+ `body-font`, `header-font`, `monospace-font`::
469
+ Typography settings
470
+
471
+ `fonts`::
472
+ Comma-delimited list of fonts to retrieve from Fontist
473
+
474
+ `output-extensions`::
475
+ Comma-delimited list of supported output formats
476
+
477
+ `presentation-metadata-*`::
478
+ Visual styling attributes for presentation, including:
479
+
480
+ `presentation-metadata-color-secondary`:::
481
+ Secondary color for styling
482
+
483
+ `presentation-metadata-backcover-text`:::
484
+ Text for document back cover
485
+
486
+ `presentation-metadata-ul-label-list`:::
487
+ Unordered list label formatting
488
+
489
+ `presentation-metadata-annex-delim`:::
490
+ Annex delimiter formatting
491
+
492
+ `presentation-metadata-middle-title`:::
493
+ Middle title formatting
494
+
495
+ `presentation-metadata-ol-label-template-alphabet`:::
496
+ Ordered list alphabet template
497
+
498
+ `presentation-metadata-ol-label-template-alphabet_upper`:::
499
+ Ordered list uppercase alphabet template
500
+
501
+ `presentation-metadata-ol-label-template-roman`:::
502
+ Ordered list roman numeral template
503
+
504
+ `presentation-metadata-ol-label-template-roman_upper`:::
505
+ Ordered list uppercase roman numeral template
506
+
507
+ `presentation-metadata-ol-label-template-arabic`:::
508
+ Ordered list arabic numeral template
509
+
510
+ Custom organization-specific attributes::
511
+ These are any additional attributes supported by the base flavor or taste.
362
512
 
363
513
  The availability of these attributes depends on the base flavor's supported
364
514
  document attributes and template system.
@@ -368,6 +518,20 @@ For example, the ISO flavor supports specific presentation metadata attributes.
368
518
  Other flavors may have different customization options. Please check the base
369
519
  flavor documentation for available attributes.
370
520
 
521
+ == Mappings of structures from taste to base flavours
522
+
523
+ The taste configuration includes various document classifications which need to
524
+ be mapped between values specific to the taste, and corresponding values in the
525
+ base flavor.
526
+
527
+ The document will actually be compiled with the base flavor settings, but it
528
+ will be rendered using the taste's corresponding values.
529
+
530
+ These include:
531
+
532
+ * `doctype`: mapping of taste doctypes to native base flavor doctypes
533
+ * `stage`: mapping of taste stages to native base flavor stages
534
+
371
535
 
372
536
  == Data model
373
537
 
@@ -414,11 +578,19 @@ content for each taste.
414
578
 
415
579
  === Workflow
416
580
 
417
- . Discovery: On gem load, `TasteRegister` scans `data/` directory for taste configurations
581
+ . Discovery: On gem load, `TasteRegister` scans `data/` directory for taste
582
+ configurations
583
+
418
584
  . Registration: Each valid taste directory is registered with its configuration
419
- . Access: Users call `TasteRegister.get(:flavor)` to obtain a configured taste instance
420
- . Processing: The taste instance applies overrides and customizations to document attributes
421
- . Integration: The customized attributes are used by Metanorma for document processing
585
+
586
+ . Access: Users call `TasteRegister.get(:flavor)` to obtain a configured taste
587
+ instance
588
+
589
+ . Processing: The taste instance applies overrides and customizations to
590
+ document attributes
591
+
592
+ . Integration: The customized attributes are used by Metanorma for document
593
+ processing
422
594
 
423
595
 
424
596
  [[creating-a-taste]]
@@ -433,10 +605,15 @@ configuration directory with the necessary files.
433
605
 
434
606
  To create a new taste:
435
607
 
436
- . Create directory: Add a new directory under `data/` with your unique taste code
608
+ . Create directory: Add a new directory under `data/` with your unique taste
609
+ code
610
+
437
611
  . Add configuration: Create `config.yaml` with your taste settings
612
+
438
613
  . Add content: Optionally add `copyright.adoc` and `i18n.yaml` files
439
- . Test: The taste will be automatically discovered and available via the TasteRegister
614
+
615
+ . Test: The taste will be automatically discovered and available via the
616
+ TasteRegister
440
617
 
441
618
  Example for a new `acme` taste:
442
619
 
data/data/csa/config.yaml CHANGED
@@ -2,30 +2,32 @@
2
2
  flavor: csa
3
3
  owner: Cloud Security Alliance
4
4
  base-flavor: generic
5
- customize: metanorma.yml
6
- copyright-notice: boilerplate.adoc
7
- i18n-dictionary: i18n.yaml
8
- publisher-logo: logo.svg
9
- htmlcoverpage: html_csa_titlepage.html
10
- htmlstylesheet: htmlstyle.scss
11
- htmlintropage: html_csa_intro.html
12
- wordcoverpage: word_csa_titlepage.html
13
- standardstylesheet: csa.scss
14
- wordstylesheet: wordstyle.scss
15
- wordintropage: word_csa_intro.html
16
- header: header.html
17
- pdf-stylesheet: csa.standard.xsl
18
5
  base-override:
19
- publisher: Cloud Security Alliance
20
- publisher_abbr: CSA
21
- body-font: Lato,"Source Sans Pro",sans-serif
22
- header-font: Lato,"Source Sans Pro",sans-serif
23
- monospace-font: '"Source Code Pro",monospace'
24
- presentation-metadata-ul-label-list: "•, -, o"
25
- presentation_metadata_annex_delim: "<br/>"
26
- presentation_metadata_middle_title: ""
27
- presentation_metadata_ol_label_template_alphabet_upper: "%<span class='fmt-label-delim'>)</span>"
28
- output-extensions: xml,html,pdf,doc
6
+ filename-attributes:
7
+ customize: metanorma.yml
8
+ copyright-notice: boilerplate.adoc
9
+ i18n-dictionary: i18n.yaml
10
+ publisher-logo: logo.svg
11
+ htmlcoverpage: html_csa_titlepage.html
12
+ htmlstylesheet: htmlstyle.scss
13
+ htmlintropage: html_csa_intro.html
14
+ wordcoverpage: word_csa_titlepage.html
15
+ standardstylesheet: csa.scss
16
+ wordstylesheet: wordstyle.scss
17
+ wordintropage: word_csa_intro.html
18
+ header: header.html
19
+ pdf-stylesheet: csa.standard.xsl
20
+ value-attributes:
21
+ publisher: Cloud Security Alliance
22
+ publisher_abbr: CSA
23
+ body-font: Lato,"Source Sans Pro",sans-serif
24
+ header-font: Lato,"Source Sans Pro",sans-serif
25
+ monospace-font: '"Source Code Pro",monospace'
26
+ presentation-metadata-ul-label-list: "&#x2022;, &#x2d;, &#x6f;"
27
+ presentation_metadata_annex_delim: "<br/>"
28
+ presentation_metadata_middle_title: ""
29
+ presentation_metadata_ol_label_template_alphabet_upper: "%<span class='fmt-label-delim'>)</span>"
30
+ output-extensions: xml,html,pdf,doc
29
31
  doctypes:
30
32
  - taste: standard
31
33
  base: standard