metanorma-taste 0.1.10 → 0.1.11

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: 18ac26614f671d7065dc3e3fc682cfdb08f2dfe20fa7174d58b1358d1f169765
4
- data.tar.gz: af0d98286098d5e9f6e22f23c22defe58c897d230053dfc465d654c82eea391e
3
+ metadata.gz: 0f6367203e4ab6227afa6538f41a94603af082a79289cdef7d04ffc78a95175b
4
+ data.tar.gz: c407343cd4a5f3949e2e56ef65f837c9b35810ca926475a5fee5f19d205c6a62
5
5
  SHA512:
6
- metadata.gz: f4b6774c9ecc053ac10715983a00cea5eaff646556b51a89949ea2f48c31213b1f14c2b02f5ca7f0d9d92564e5ed3d20488c901ba25f6dbf40bf0c37dc79a2de
7
- data.tar.gz: 6bba048c009df61563863dfdf45b6d59d80096f7f5365c45ba48faf055be0725209f061923fc3caab53a0636d06a8863afdf994609d95e9e4b60db8b48d3de24
6
+ metadata.gz: d54ac54e4d23d70506e516a1ba173e472c8afd4eddefa5b4549154ea1158873c1123979034bbd020a6c9b534d732567b8e80c7fdfcc47654118995750fbbad27
7
+ data.tar.gz: 683283ddfb4c6b4587c3dbff64c569ca02adf1e60bb66d65cf1cb96a79ebdd7cacdf3cd15d71aaefdf55d29fc113df5be3ff86bdf4d69e7cb7862f45908e416b
data/Create-Taste.adoc ADDED
@@ -0,0 +1,200 @@
1
+ == Creating a Taste
2
+
3
+ Consult the link:README.adoc[README] on necessary background information on how tastes work and are configured.
4
+
5
+ === 1. Selecting a base flavor
6
+
7
+ Tastes are config-only modifications of a Metanorma flavor: all behaviour that needs to be coded for must be available
8
+ already in the base flavor. That makes it important to select an appropriate flavor, so that its necessary behaviour
9
+ can be carried across to the taste without any need for coding. The decision on which flavor to use is not in the first
10
+ instance a matter of document presentation: the taste will supply its own rendering styling, in the form of CSS stylesheets
11
+ and PDF stylesheets. But it does require consistent behaviour for document metadata, validation, XML processing,
12
+ and cross-referencing—all those aspects of document generation that cannot currently be left up to attribute configuration.
13
+ For example, if ISO is used as a base flavor, the taste will inherit ISO's styling of subclause cross-references (i.e. that ISO
14
+ does not prefix subclause numbers with "Clause"); ISO's validation rules around language and numbers; ISO's sequencing of
15
+ sections; and so on.
16
+
17
+ Of the eight tastes defined as of this writing, four are based on ISO. ISO is a familiar SDO, with broadly known and rigorous
18
+ rules around document structure, and SDOs often intend at least some of their documents to be also published through ISO. Another
19
+ three are based on Ribose, the house standard format for the developers of Metanorma: this takes advantage of the fact that
20
+ Ribose has full control over the document format for the Ribose flavor, and can adjust it to encompass the requirements of
21
+ tastes—but also the fact that, compared to ISO, Ribose is a relatively bare-bones document format. One taste, finally, CSA,
22
+ is based on metanorma-generic, a Metanorma flavor which allows for more extensive configuration through YAML
23
+ (the `customize` file attribute), but which also presupposes some degree of coding (unlike tastes).
24
+
25
+ === 2. Output formats
26
+
27
+ You will need to select which output formats should be generated for the taste; these must be a subset of the formats supported
28
+ by the flavor. Since the taste renders documents through code for the base flavor, the rendering of output formats will be
29
+ a modification of the styling of the base flavor, and will normally be undertaken on your behalf by Metanorma staff, who will
30
+ align your formatting needs to the structures of the base flavor. This is a relatively light-weight task for HTML output,
31
+ involving changes in the CSS stylesheet and the coverpage. It is a more involved task for DOC output, as the coverpage needs
32
+ to be created in Word HTML, which is more idiosyncratic. In the case of PDF, it involves custom development of XSLT stylesheets,
33
+ either supplementing or replacing the XSLT stylesheet for the base flavor.
34
+
35
+ === 3. Initial metadata
36
+
37
+ At the outset, a taste is defined through some base metadata, provided in the `data/{TASTE}/config.yaml` configuration file,
38
+ which needs to be created:
39
+
40
+ `flavor`:: the abbreviated name of the taste
41
+ `base-flavor`:: the pre-existing full flavor of Metanorma that the taste is derived from
42
+ `owner`:: the name of the SDO for the taste
43
+
44
+ === 4. Document attributes
45
+
46
+ The customisation of document behaviour under tastes is substantially done through document attributes, which are inserted
47
+ in the document header of a Metanorma document in preprocessing. The repertoire of document attributes is given on
48
+ metanorma.org, in https://www.metanorma.org/author/ref/document-attributes/[Document attributes], supplemented by
49
+ the Document attributes specific to the chosen flavor,
50
+ e.g. https://www.metanorma.org/author/iso/ref/document-attributes/[Document attributes for ISO]. Document attributes
51
+ can add or remove behaviour from the base flavor, but there are limits to what customisation of behaviour they make available,
52
+ and it may not be feasible for behaviour to be taken away from the base flavour for the sake of a taste. You will need
53
+ to negotiate your requirements with the Metanorma developers.
54
+
55
+ There are two types of attribute that can be added to a taste: value attributes, which involve strings (either single values, or
56
+ comma or semicolon-delimited lists of values), and filename attributes.
57
+
58
+ Because of the serialisation tool that Metanorma Taste uses, the document attributes available for use in Metanorma Taste
59
+ is preset, and need to be updated in code; the list defined currently is available in `/lib/metanorma/taste/value_attributes.rb`
60
+ and `/lib/metanorma/taste/filename_attributes.rb`, respectively. (This even includes the `presentation-metadata-*` document attributes,
61
+ which are open-ended in Asciidoc processing.) You will need to contact Metanorma developers to add an attribute for your taste.
62
+
63
+ ==== 4.1 Value attributes
64
+
65
+ Value attributes are given under `base-override: value-attributes` in the `config.yaml` configuration file. They relate
66
+ to document metadata, document structure, or document rendering:
67
+
68
+ ===== Document metadata
69
+
70
+ `publisher`:: (mandatory) the publisher name, overriding the publisher name in the base flavor; this is the full name of the SDO,
71
+ as it should appear in document metadata and boilerplate
72
+ `publisher_abbr`:: the canonical abbreviation of the SDO, as it should appear in document metadata and boilerplate
73
+ (cf. "ISO" for "International Organization for Standardization).
74
+
75
+ ===== Document structure
76
+ Table of contents::
77
+ `toclevels`::: Default number of clause levels to be included in all tables of contents
78
+ `toclevels-html`::: Number of clause levels to be included in HTML tables of contents
79
+ `toclevels-doc`::: Number of clause levels to be included in DOC tables of contents
80
+ `toclevels-pdf`::: Number of clause levels to be included in PDF tables of contents
81
+ `toc-figures`::: Directive to include a table of figures alongside the table of contents
82
+ `toc-tables`::: Directive to include a table of tables alongside the table of contents
83
+ `toc-recommendations`::: Directive to include a table of provisions (requirements, recommendations, permissions) alongside the table of contents
84
+
85
+ ===== Rendering
86
+
87
+ CSS base attributes (applied to HTML and DOC output)::
88
+ `body-font`::: The default font to use for HTML and DOC, passed as a parameter to CSS stylesheets (potentially the base flavor stylesheet,
89
+ if no distinct stylesheet is supplied)
90
+ `header-font`::: Header font to use in HTML and DOC
91
+ `monospace-font`::: Monospace font to use in HTML and DOC
92
+ Fonts (applied to PDF and DOC primarily: HTML uses web fonts)::
93
+ `fonts`::: Comma-delimited font names, as defined in the `Fontist` library. Exceptionally, this document attribute value is added to
94
+ any value of the attribute provided by the user in the document; normally a user-provided value overrides the taste default value.
95
+ Output formats::
96
+ `output-extensions`::: Comma-delimited list of formats to be output for the taste. This must be a subset of the formats defined for
97
+ the base flavor; the attribute allows it to be a proper subset, and to suppress formats supported by the base flavor.
98
+ Presentation Metadata::
99
+ Various idiosyncratic key/value pairs to be passed to the Presentation XML for processing, primarily by PDF. Includes directives
100
+ for colors, ordered list labels and unordered list bullets, delimiters between annex label and title, back cover text, and
101
+ middle title template. Custom requirements will need to be included through code.
102
+
103
+ ==== 4.2 Filename attributes
104
+ Filename attributes give the file location of various configuration and template files and images, which are used to generate the document.
105
+ These files are stored in `data/{TASTE}/*` along with the configuration YAML file; the preprocessing of the document attributes
106
+ invokes them from the directory where Metanorma Taste is installed on the computer.
107
+
108
+ As described above, these files will need to align to the requirements of the base flavor, and will be prepared by Metanorma
109
+ developers.
110
+
111
+ `copyright_notice`:: The boilerplate text for the taste, following the structure given in
112
+ https://www.metanorma.org/develop/topics/metadata-and-boilerplate/#boilerplate[Predefined text]. This file
113
+ supplies taste-specific copyright, legal, license and feedback text (the latter including contact information),
114
+ and it takes the form of a Liquid template for Metanorma Asciidoc, populated with template variables drawn
115
+ from the document attributes.
116
+ `i18n_dictionary`:: Internationalisation file for the taste, providing reusable snippets of text (e.g. terms and definitions front text,
117
+ normative references front text) and standardised renderings of words specific to the taste (e.g. custom name for formulas,
118
+ warnings, doctype labels -- for which its use is expected). This follows the structure given
119
+ in https://www.metanorma.org/develop/topics/localization/[Localization].
120
+ `customize`:: Customisation file for `metanorma-generic`, for tastes based on that flavor. This file follows the structure given
121
+ in https://www.metanorma.org/develop/topics/simple-adoption/[Creating your own Metanorma flavor].
122
+ CSS files::
123
+ `htmlstylesheet`::: HTML CSS stylesheet for taste, supplementing the stylesheet of the base flavor.
124
+ `htmlstylesheet_override`::: HTML CSS stylesheet for taste, replacing the stylesheet of the base flavor.
125
+ `wordstylesheet`::: DOC CSS stylesheet for taste, supplementing the stylesheet of the base flavor.
126
+ `wordstylesheet_override`::: DOC CSS stylesheet for taste, replacing the stylesheet of the base flavor.
127
+ `pdfstylesheet`::: PDF XSLT stylesheet for taste, supplementing the stylesheet of the base flavor.
128
+ `pdfstylesheet_override`::: PDF XSLT stylesheet for taste, replacing the stylesheet of the base flavor.
129
+ Cover pages::
130
+ `htmlcoverpage`::: Cover page for HTML output as Liquid Template in HTML, populated with variables from document metadata, following
131
+ the structure given in https://www.metanorma.org/develop/topics/metadata-and-boilerplate/#default-metadata[Default metadata values].
132
+ `htmlintropage`::: Introductory page for HTML, as above
133
+ `wordcoverpage`::: Cover page for DOC, as above
134
+ `wordintropage`::: Introductory page for DOC, as above
135
+ `header`::: Header and footer for DOC, as above, following Word HTML formatting for that information
136
+ PDF portfolio::
137
+ `coverpage_pdf_portfolio`::: The fallback PDF to be rendered for PDF portfolios, in PDF viewers that do not support that format.
138
+ Unlike other attributes, this is processed in Metanorma collections, not in the compilation of standalone Metanorma documents.
139
+ Images::
140
+ `publisher_logo`::: Logo for the SDO, to be included in cover pages for supported formats.
141
+ `coverpage_image`::: Image to be included alongside any SDO logo, for all documents under the taste.
142
+ `backpage_image`::: Image to be placed on the back page of all documents under the taste. Normally implemented only for PDF.
143
+
144
+ ==== 5. Metadata dictionaries
145
+
146
+ Metanorma flavors presuppose different lists of possible values for certain document metadata attributes, such as the legal document
147
+ types (doctype), or the allowed document stages of publication. An SDO may require different possible values for the taste, but the taste is
148
+ implemented as a configuration of the base flavor, so it necessarily uses the base flavor's document types and publication stages.
149
+
150
+ This discrepancy is addressed for tastes by including a dictionary in the taste configuration, mapping between taste values and base flavor
151
+ values. As far as Metanorma processing is concerned, the document is processed with the base flavor value, as that is what is recognised
152
+ on code. The document's Presentation XML also includes the taste's value for the category, and Metanorma renderers are instructed
153
+ to use that in preference to the base flavor's label, when displaying the information in rendering.
154
+
155
+ ===== 5.1 Doctype
156
+
157
+ The `doctypes` map provides a list of structs: a `taste` value, for the taste's label of the doctype, and a `base` value, for the
158
+ corresponding value in the base flavor to be used in processing.
159
+
160
+ Occasionally, a doctype may introduce document attributes specific to it, these are indicated with `override-attributes`. For
161
+ example, under ICC, the `specification` doctype (mapped to ISO `international-standard`) has its own value of
162
+ secondary color; this is indicated as:
163
+
164
+ [source,asciidoc]
165
+ ----
166
+ doctypes:
167
+ - taste: specification
168
+ base: international-standard
169
+ override-attributes:
170
+ - presentation-metadata-color-secondary: '#376795'
171
+ ----
172
+
173
+ ===== 5.2 Stage
174
+
175
+ A limited number of tastes (CSA, PDFA) also provide a dictionary of stage values. Unlike the doctype, this does not map to the base flavor,
176
+ but gives the listing of stages applicable to the taste. The dictionary is formatted as for `metanorma-generic`: it gives a hash
177
+ of stage names, mapping optionally to standard stage abbreviations. Each stage may optionally have a boolean value given for whether it
178
+ is the `default` stage applied to documents (legal for only one stage), and whether it constitutes a `published` stage (may apply to more
179
+ than one stage). So CSA has the following stage dictionary:
180
+
181
+ [source,asciidoc]
182
+ ----
183
+ stages:
184
+ proposal:
185
+ working-draft:
186
+ abbreviation: wd
187
+ committee-draft:
188
+ abbreviation: cd
189
+ draft-standard:
190
+ abbreviation: d
191
+ final-draft:
192
+ published:
193
+ default: true
194
+ published: true
195
+ withdrawn:
196
+ published: true
197
+ ----
198
+
199
+
200
+
data/README.adoc CHANGED
@@ -263,9 +263,11 @@ base-override: # Document attributes to override from base flavor
263
263
  header: string # Word output header and footer content
264
264
  pdf-stylesheet: string # PDF output XSLT stylesheet
265
265
  pdf-stylesheet-override: string # PDF output XSLT stylesheet, overriding base flavor stylesheet
266
+ coverpage-pdf-portfolio: string # Fallback PDF for PDF Portfolio if PDF Portfolio not supported
266
267
  customize: string # Path to custom metanorma configuration file
267
268
  coverpage-image: string # Path to coverpage image file
268
269
  backpage-image: string # Path to backpage image file
270
+ relaton-render-config: string # Path to Relaton Render configuration YAML
269
271
  value-attributes: # Metanorma document attributes that contain values
270
272
  publisher: string # Publisher name override
271
273
  publisher_abbr: string # Publisher abbreviation
@@ -274,11 +276,25 @@ base-override: # Document attributes to override from base flavor
274
276
  monospace-font: string # Monospace font to use in HTML and Word stylesheets
275
277
  fonts: string # Comma-delimited listing of fonts to retrieve for the taste from Fontist
276
278
  output-extensions: string # Comma-delimited listing of output formats to support (subset of base flavor's)
279
+ docidentifier # Template for document identifier, populated with document metadata
277
280
  presentation-metadata-*: # Template style attributes for presentation
278
281
  doctypes: # Array of doctypes built over base flavour doctypes
279
- - taste: # taste-specific machine-readable doctype name
280
- base: # Base Metanorma flavor corresponding machine-readable doctype name
282
+ - taste: string # Taste-specific machine-readable doctype name
283
+ base: string # Base Metanorma flavor machine-readable doctype name
284
+ abbrev: string # Taste-specific abbreviation of doctype
281
285
  override-attributes: # Hash of document attributes to override from base flavor for this doctype
286
+ stages: # Array of stages built over base flavour stages
287
+ - taste: string # Taste-specific machine-readable stage name
288
+ base: string # Base Metanorma flavor machine-readable stage name
289
+ abbreviation: string # Abbreviation of stage
290
+ default: boolean # Whether the stage is the default stage to be applied to a document
291
+ published: boolean # Whether the stage is to be considered published
292
+ committees: # Hash of predefined editorial groups for the SDO
293
+ - category: # Name of editorial group class (typically hierarchical, e.g. technical committee, subcommittee, workgroup)
294
+ - name: # Name of editorial group
295
+ - abbrev: # Abbreviation of editorial group
296
+ - number: # Untyped identifier of editorial group (the abbrev is assumed prefixed to it)
297
+ - logo: # Logo of editorial group
282
298
  ----
283
299
 
284
300
  .Taste configuration example from ICC
@@ -312,6 +328,45 @@ doctypes:
312
328
  ----
313
329
  ====
314
330
 
331
+ .Taste configuration example from MBxIF
332
+ [example]
333
+ ====
334
+ [source,yaml]
335
+ ----
336
+ flavor: mbxif
337
+ owner: MBx Interoperability Forum
338
+ base-flavor: ribose
339
+ base-override:
340
+ filename-attributes:
341
+ copyright-notice: copyright.adoc
342
+ i18n-dictionary: i18n.yaml
343
+ publisher-logo: mbxif-logos_mbxif.svg
344
+ pdf-stylesheet-override: mbxif.xsl
345
+ coverpage-image: mbxif-front-cover.pdf
346
+ backpage-image: mbxif-back-cover.pdf
347
+ value-attributes:
348
+ publisher: MBx Interoperability Forum
349
+ publisher_abbr: MBx-IF
350
+ presentation-metadata-color-secondary: '#007724'
351
+ presentation-metadata-backcover-text: https://www.mbx-if.org
352
+ fonts: Nacelle;Nacelle SemiBold;Nacelle Light
353
+ output-extensions: xml,html,pdf,doc
354
+ doctypes:
355
+ - taste: recommended-practices
356
+ base: standard
357
+ - taste: general-guidelines
358
+ base: report
359
+ committees:
360
+ interoperability-forum:
361
+ - name: Computer Aided "x" Interoperability Forum
362
+ abbrev: CAx-IF
363
+ logo: mbxif-logos_caxif.svg
364
+ - name: Product Data Management Interoperability Forum
365
+ abbrev: PDM-IF
366
+ logo: mbxif-logos_pdmif.svg
367
+ ----
368
+ ====
369
+
315
370
  ==== i18n.yaml
316
371
 
317
372
  Internationalization dictionary for custom text translations:
@@ -460,6 +515,9 @@ Path to custom metanorma configuration file
460
515
  `coverpage-image`, `backpage-image`::
461
516
  Cover and back page image files
462
517
 
518
+ `relaton-render-config`::
519
+ Configuration for Relaton Render (rendering of citations)
520
+
463
521
 
464
522
  ==== Value attributes (`value-attributes`)
465
523
 
@@ -480,6 +538,9 @@ Comma-delimited list of fonts to retrieve from Fontist
480
538
  `output-extensions`::
481
539
  Comma-delimited list of supported output formats
482
540
 
541
+ `docidentifier`::
542
+ Liquid template for document identifier, populated with document metadata values
543
+
483
544
  `presentation-metadata-*`::
484
545
  Visual styling attributes for presentation, including:
485
546
 
@@ -646,6 +707,8 @@ taste = Metanorma::TasteRegister.get(:acme)
646
707
  * Must be valid Ruby constant names when capitalized
647
708
  * Should reflect the owner organization's name
648
709
 
710
+ For more complete instructions, see link:Create-Taste.adoc[Creating a taste].
711
+
649
712
 
650
713
  == Copyright
651
714
 
data/data/csa/config.yaml CHANGED
@@ -47,17 +47,3 @@ doctypes:
47
47
  base: specification
48
48
  - taste: case-study
49
49
  base: report
50
- stages:
51
- proposal:
52
- working-draft:
53
- abbreviation: wd
54
- committee-draft:
55
- abbreviation: cd
56
- draft-standard:
57
- abbreviation: d
58
- final-draft:
59
- published:
60
- default: true
61
- published: true
62
- withdrawn:
63
- published: true