metanorma-taste 0.1.4 → 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.
- checksums.yaml +4 -4
- data/README.adoc +178 -61
- data/data/csa/csa.standard.xsl +8 -0
- data/data/mbxif/config.yaml +1 -1
- data/data/pdfa/config.yaml +1 -1
- data/data/swf/config.yaml +1 -1
- data/lib/metanorma/taste/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f4a74f3a7d05b348f0321f8b705f4ee3be169f70e3fed955dcb61c668bf4a6a
|
4
|
+
data.tar.gz: aab5942f506ae7ecf610db8ab24290e8867cb8ed889e6e4ea5357f1ff9130a78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57a9509823af08dbabc4266a4c6a54d88c34f9e2b9f5bc4c0f99d47094ce96423e5dbdb7d469e4d5f054d13d37e40b1a3fb228d04fdc8cb6996e950897594b23
|
7
|
+
data.tar.gz: 9e1ac2f9d11c7917e9daa8af65fcb9478ee876b2ebcf25ffc4cbe9e07df45ff5dd1256b370b65068fc2b536150fca1d47389feafbb54583529539c70f202d5a8
|
data/README.adoc
CHANGED
@@ -183,6 +183,7 @@ currently available:
|
|
183
183
|
|MBx Interoperability Forum
|
184
184
|
|`ribose`
|
185
185
|
|MBx Interoperability Forum specifications and standards with MBx-IF branding and copyright
|
186
|
+
|
186
187
|
|===
|
187
188
|
|
188
189
|
|
@@ -208,7 +209,10 @@ taste.
|
|
208
209
|
=== General
|
209
210
|
|
210
211
|
A taste package is a directory structure that contains all the necessary files
|
211
|
-
to define a Metanorma taste.
|
212
|
+
to define a Metanorma taste.
|
213
|
+
|
214
|
+
It includes configuration files, copyright notices, internationalization
|
215
|
+
dictionaries, and stylesheets if any.
|
212
216
|
|
213
217
|
=== Directory structure
|
214
218
|
|
@@ -313,8 +317,11 @@ doctype_dict: # Document type translations
|
|
313
317
|
# Add more document type mappings as needed
|
314
318
|
----
|
315
319
|
|
316
|
-
|
317
|
-
`doctype_dict`.
|
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.
|
318
325
|
|
319
326
|
.i18n.yaml example from ICC
|
320
327
|
[example]
|
@@ -329,7 +336,10 @@ doctype_dict:
|
|
329
336
|
|
330
337
|
==== copyright.adoc
|
331
338
|
|
332
|
-
|
339
|
+
This file supplies taste-specific copyright, legal, license and feedback
|
340
|
+
text.
|
341
|
+
|
342
|
+
This file can contain:
|
333
343
|
|
334
344
|
* Copyright statements with template variables (e.g., `{{ docyear }}`)
|
335
345
|
* License information
|
@@ -354,62 +364,151 @@ The file is in the Metanorma AsciiDoc format, with the following syntax:
|
|
354
364
|
|
355
365
|
Copyright (c) {{ docyear }} Your Organization Name
|
356
366
|
|
357
|
-
[
|
367
|
+
[legal text here...]
|
358
368
|
|
359
369
|
== feedback-statement
|
360
|
-
=== Contact
|
370
|
+
=== Contact information
|
361
371
|
|
362
|
-
[
|
372
|
+
[organization contact details...]
|
363
373
|
----
|
364
374
|
====
|
365
375
|
|
366
|
-
The same file format is used internally for Metanorma flavors, and is documented
|
367
|
-
|
368
|
-
|
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
|
369
381
|
|
370
|
-
|
382
|
+
==== General
|
371
383
|
|
372
384
|
The `base-override` section allows customization of document attributes
|
373
|
-
supported by the base flavor through two
|
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
|
-
|
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
|
441
|
+
|
442
|
+
`standardstylesheet`, `standardstylesheet-override`::
|
443
|
+
Secondary Word CSS stylesheets
|
444
|
+
|
445
|
+
`header`::
|
446
|
+
Word output header and footer content
|
447
|
+
|
448
|
+
`pdf-stylesheet`, `pdf-stylesheet-override`::
|
449
|
+
PDF XSLT stylesheets
|
450
|
+
|
451
|
+
`customize`::
|
452
|
+
Path to custom metanorma configuration file
|
453
|
+
|
454
|
+
`coverpage-image`, `backpage-image`::
|
455
|
+
Cover and back page image files
|
456
|
+
|
457
|
+
|
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.
|
413
512
|
|
414
513
|
The availability of these attributes depends on the base flavor's supported
|
415
514
|
document attributes and template system.
|
@@ -421,14 +520,19 @@ flavor documentation for available attributes.
|
|
421
520
|
|
422
521
|
== Mappings of structures from taste to base flavours
|
423
522
|
|
424
|
-
The taste configuration includes various document classifications which need to
|
425
|
-
mapped between values specific to the taste, and corresponding values in the
|
426
|
-
|
427
|
-
|
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:
|
428
531
|
|
429
532
|
* `doctype`: mapping of taste doctypes to native base flavor doctypes
|
430
533
|
* `stage`: mapping of taste stages to native base flavor stages
|
431
534
|
|
535
|
+
|
432
536
|
== Data model
|
433
537
|
|
434
538
|
The metanorma-taste system follows this architecture:
|
@@ -474,11 +578,19 @@ content for each taste.
|
|
474
578
|
|
475
579
|
=== Workflow
|
476
580
|
|
477
|
-
. Discovery: On gem load, `TasteRegister` scans `data/` directory for taste
|
581
|
+
. Discovery: On gem load, `TasteRegister` scans `data/` directory for taste
|
582
|
+
configurations
|
583
|
+
|
478
584
|
. Registration: Each valid taste directory is registered with its configuration
|
479
|
-
|
480
|
-
.
|
481
|
-
|
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
|
482
594
|
|
483
595
|
|
484
596
|
[[creating-a-taste]]
|
@@ -493,10 +605,15 @@ configuration directory with the necessary files.
|
|
493
605
|
|
494
606
|
To create a new taste:
|
495
607
|
|
496
|
-
. Create directory: Add a new directory under `data/` with your unique taste
|
608
|
+
. Create directory: Add a new directory under `data/` with your unique taste
|
609
|
+
code
|
610
|
+
|
497
611
|
. Add configuration: Create `config.yaml` with your taste settings
|
612
|
+
|
498
613
|
. Add content: Optionally add `copyright.adoc` and `i18n.yaml` files
|
499
|
-
|
614
|
+
|
615
|
+
. Test: The taste will be automatically discovered and available via the
|
616
|
+
TasteRegister
|
500
617
|
|
501
618
|
Example for a new `acme` taste:
|
502
619
|
|
data/data/csa/csa.standard.xsl
CHANGED
@@ -608,11 +608,19 @@
|
|
608
608
|
</xsl:template>
|
609
609
|
|
610
610
|
<xsl:template name="insertHeaderFooter">
|
611
|
+
<xsl:call-template name="insertHeader"/>
|
612
|
+
<xsl:call-template name="insertFooter"/>
|
613
|
+
</xsl:template>
|
614
|
+
|
615
|
+
<xsl:template name="insertHeader">
|
611
616
|
<fo:static-content flow-name="header" role="artifact">
|
612
617
|
<fo:block-container height="2.5mm" background-color="{$color-header-document}">
|
613
618
|
<fo:block font-size="1pt"> </fo:block>
|
614
619
|
</fo:block-container>
|
615
620
|
</fo:static-content>
|
621
|
+
</xsl:template>
|
622
|
+
|
623
|
+
<xsl:template name="insertFooter">
|
616
624
|
<fo:static-content flow-name="footer" role="artifact">
|
617
625
|
<fo:block-container font-family="Azo Sans Lt" font-size="10.1pt" height="100%" display-align="after"> <!-- 11.5pt -->
|
618
626
|
<fo:block padding-bottom="13mm" text-align="right" color="rgb(144, 144, 144)">
|
data/data/mbxif/config.yaml
CHANGED
@@ -7,7 +7,7 @@ base-override:
|
|
7
7
|
copyright-notice: copyright.adoc
|
8
8
|
i18n-dictionary: i18n.yaml
|
9
9
|
publisher-logo: mbxif-logos_mbxif.svg
|
10
|
-
|
10
|
+
pdf-stylesheet-override: mbxif.xsl
|
11
11
|
coverpage-image: mbxif-front-cover.pdf
|
12
12
|
backpage-image: mbxif-back-cover.pdf
|
13
13
|
value-attributes:
|
data/data/pdfa/config.yaml
CHANGED
@@ -9,7 +9,7 @@ base-override:
|
|
9
9
|
publisher-logo: pdfa-logo.svg
|
10
10
|
htmlcoverpage: htmlcoverpage.html
|
11
11
|
htmlstylesheet-override: htmlstylesheet-override.scss
|
12
|
-
|
12
|
+
pdf-stylesheet-override: pdfa.xsl
|
13
13
|
value-attributes:
|
14
14
|
publisher: PDF Association
|
15
15
|
publisher_abbr: PDF Association
|
data/data/swf/config.yaml
CHANGED
@@ -7,7 +7,7 @@ base-override:
|
|
7
7
|
copyright-notice: copyright.adoc
|
8
8
|
i18n-dictionary: i18n.yaml
|
9
9
|
publisher-logo: swf-logo.svg
|
10
|
-
|
10
|
+
pdf-stylesheet-override: swf.xsl
|
11
11
|
coverpage-image: swf-front-cover.pdf
|
12
12
|
backpage-image: swf-back-cover.pdf
|
13
13
|
value-attributes:
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-taste
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-09-
|
11
|
+
date: 2025-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|