metanorma-taste 1.0.10 → 1.1.0
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/.rubocop.yml +9 -0
- data/README.adoc +24 -0
- data/data/csa/csa.standard.xsl +113 -66
- data/data/oiml/config.yaml +10 -0
- data/data/pdfa/config.yaml +5 -5
- data/data/pdfa/htmlcoverpage.html +1 -1
- data/data/pdfa/htmlstylesheet-override.scss +281 -104
- data/data/pdfa/i18n.yaml +16 -12
- data/data/pdfa/pdfa.xsl +34 -19
- data/lib/metanorma/taste/base.rb +14 -0
- data/lib/metanorma/taste/base_override.rb +3 -0
- data/lib/metanorma/taste/biblio_sort_item.rb +24 -0
- data/lib/metanorma/taste/stage.rb +37 -1
- data/lib/metanorma/taste/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eca330c6ecac8898e33460d368b0305ee83b2f44f08182a389231122d5970d7b
|
|
4
|
+
data.tar.gz: d775c3b890c30c6270f3e650a03324900a3b0fadcd4c01ee0fb50d2e5be78e46
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: db98365c339648ba8c6c36dd693f8d22b3b97a3370768d16677457bbd190462fdc6923813509ea4749d2b60a801a3b3328ee28ca476df1336a4f9e7c1eb52801
|
|
7
|
+
data.tar.gz: d51259cd69eefc681da4867d946fe075c27bd150201150003d673d5052245fc10bb7fb93d34c874444bd0788ac22cf8e5cbca9151f9c618a2a1fe508cde58b9f
|
data/.rubocop.yml
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
# See https://github.com/metanorma/cimas
|
|
3
3
|
inherit_from:
|
|
4
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
5
|
+
# .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
|
|
6
|
+
# if listed before oss-guides, the shared config's stricter Metrics/
|
|
7
|
+
# (MethodLength, BlockLength, etc.) rules override the todo's per-file
|
|
8
|
+
# grandfathering, and the todo becomes inert on those cops. Empirically
|
|
9
|
+
# verified on suma 2026-07-06: with todo listed first, 34 Metrics/* offenses
|
|
10
|
+
# remained; moved last, cleared. Every gem in the metanorma-org fleet
|
|
11
|
+
# already ships a `.rubocop_todo.yml` on its live tree (audited 2026-07-06,
|
|
12
|
+
# 54/54 have it), so this reference is safe to emit unconditionally.
|
|
13
|
+
- .rubocop_todo.yml
|
|
5
14
|
|
|
6
15
|
# Rubocop plugins enabled centrally so every metanorma-org gem picks them up
|
|
7
16
|
# on cimas sync — best practice belongs at the shared-template layer, not
|
data/README.adoc
CHANGED
|
@@ -604,6 +604,30 @@ These include:
|
|
|
604
604
|
* `doctype`: mapping of taste doctypes to native base flavor doctypes
|
|
605
605
|
* `stage`: mapping of taste stages to native base flavor stages
|
|
606
606
|
|
|
607
|
+
=== Stage repertoire contract
|
|
608
|
+
|
|
609
|
+
When a taste defines `stages:`, its stage repertoire supersedes the base
|
|
610
|
+
flavor's: input stages are validated against the taste's stage names, an
|
|
611
|
+
unrecognised stage is reported and replaced with the taste's default stage,
|
|
612
|
+
and the base stages the taste maps to are advertised to the flavor as valid
|
|
613
|
+
(through the `:docstage-valid:` document attribute), so the flavor does not
|
|
614
|
+
report them as unrecognised in turn.
|
|
615
|
+
|
|
616
|
+
The `base:` values of taste stages must respect the base flavor's native
|
|
617
|
+
stage semantics:
|
|
618
|
+
|
|
619
|
+
* For flavors with free-form stage names (Metanorma Generic and its
|
|
620
|
+
derivatives, such as Ribose), any string is acceptable as a `base:` stage;
|
|
621
|
+
draft-ness is controlled by the `published:` flag of the stage.
|
|
622
|
+
* For flavors whose machinery interprets stage values — above all ISO, where
|
|
623
|
+
document identifiers (pubid) and cover/boilerplate logic are keyed to the
|
|
624
|
+
numeric harmonized stage codes — `base:` values must be drawn from the
|
|
625
|
+
flavor's native repertoire (for ISO: numeric stage codes such as `30`,
|
|
626
|
+
`60`). A stage the flavor cannot interpret will degrade identifier
|
|
627
|
+
generation to a warning (the taste's own docidentifier template is used
|
|
628
|
+
instead), but stage-keyed rendering logic will treat the document as a
|
|
629
|
+
draft.
|
|
630
|
+
|
|
607
631
|
|
|
608
632
|
== Data model
|
|
609
633
|
|
data/data/csa/csa.standard.xsl
CHANGED
|
@@ -373,7 +373,11 @@
|
|
|
373
373
|
<xsl:call-template name="setAltText">
|
|
374
374
|
<xsl:with-param name="value" select="@alt-text"/>
|
|
375
375
|
</xsl:call-template>
|
|
376
|
-
<xsl:
|
|
376
|
+
<xsl:variable name="item">
|
|
377
|
+
<!-- mnx:table/mn:fmt-name, mnx:figure/mn:fmt-name, mnx:example/mn:fmt-name -->
|
|
378
|
+
<xsl:apply-templates select="mn:fmt-name" mode="contents_item"/>
|
|
379
|
+
</xsl:variable>
|
|
380
|
+
<xsl:apply-templates select="xalan:nodeset($item)/node()"/>
|
|
377
381
|
<fo:inline keep-together.within-line="always">
|
|
378
382
|
<fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
|
|
379
383
|
<fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
|
|
@@ -425,7 +429,7 @@
|
|
|
425
429
|
<!-- List of Tables -->
|
|
426
430
|
<xsl:if test="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
|
|
427
431
|
<xsl:call-template name="insertListOf_Title">
|
|
428
|
-
<xsl:with-param name="title" select="$title-list-tables"/>
|
|
432
|
+
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
|
|
429
433
|
</xsl:call-template>
|
|
430
434
|
<fo:block role="TOC">
|
|
431
435
|
<xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:tables/mnx:table">
|
|
@@ -437,7 +441,7 @@
|
|
|
437
441
|
<!-- List of Figures -->
|
|
438
442
|
<xsl:if test="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
|
|
439
443
|
<xsl:call-template name="insertListOf_Title">
|
|
440
|
-
<xsl:with-param name="title" select="$title-list-figures"/>
|
|
444
|
+
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
|
|
441
445
|
</xsl:call-template>
|
|
442
446
|
<fo:block role="TOC">
|
|
443
447
|
<xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:figures/mnx:figure">
|
|
@@ -449,7 +453,7 @@
|
|
|
449
453
|
<!-- List of Examples -->
|
|
450
454
|
<xsl:if test="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
|
|
451
455
|
<xsl:call-template name="insertListOf_Title">
|
|
452
|
-
<xsl:with-param name="title" select="$title-list-examples"/>
|
|
456
|
+
<xsl:with-param name="title" select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
|
|
453
457
|
</xsl:call-template>
|
|
454
458
|
<fo:block role="TOC">
|
|
455
459
|
<xsl:for-each select="$contents/mnx:doc[@num = $num]//mnx:examples/mnx:example">
|
|
@@ -887,45 +891,59 @@
|
|
|
887
891
|
|
|
888
892
|
<xsl:variable name="ace_tag">ace-tag_</xsl:variable>
|
|
889
893
|
|
|
890
|
-
<xsl:variable name="
|
|
891
|
-
<xsl:
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
<xsl:
|
|
895
|
-
<xsl:
|
|
896
|
-
</xsl:
|
|
897
|
-
|
|
898
|
-
|
|
894
|
+
<xsl:variable name="toc_title_lists_">
|
|
895
|
+
<xsl:for-each select="//mn:metanorma">
|
|
896
|
+
<xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
|
|
897
|
+
<xsl:variable name="docid"><xsl:call-template name="getDocumentId"/></xsl:variable>
|
|
898
|
+
<xsl:variable name="current_document">
|
|
899
|
+
<xsl:copy-of select="."/>
|
|
900
|
+
</xsl:variable>
|
|
901
|
+
<xsl:for-each select="xalan:nodeset($current_document)">
|
|
902
|
+
<mnx:doc id="{$docid}" num="{$num}">
|
|
903
|
+
<mnx:title-list-tables>
|
|
904
|
+
<xsl:variable name="toc_table_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title"/>
|
|
905
|
+
<xsl:value-of select="$toc_table_title"/>
|
|
906
|
+
<xsl:if test="normalize-space($toc_table_title) = ''">
|
|
907
|
+
<xsl:call-template name="getLocalizedString">
|
|
908
|
+
<xsl:with-param name="key">toc_tables</xsl:with-param>
|
|
909
|
+
</xsl:call-template>
|
|
910
|
+
</xsl:if>
|
|
911
|
+
</mnx:title-list-tables>
|
|
899
912
|
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
913
|
+
<mnx:title-list-figures>
|
|
914
|
+
<xsl:variable name="toc_figure_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title"/>
|
|
915
|
+
<xsl:value-of select="$toc_figure_title"/>
|
|
916
|
+
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
|
917
|
+
<xsl:call-template name="getLocalizedString">
|
|
918
|
+
<xsl:with-param name="key">toc_figures</xsl:with-param>
|
|
919
|
+
</xsl:call-template>
|
|
920
|
+
</xsl:if>
|
|
921
|
+
</mnx:title-list-figures>
|
|
909
922
|
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
923
|
+
<mnx:title-list-examples>
|
|
924
|
+
<xsl:variable name="toc_example_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title"/>
|
|
925
|
+
<xsl:value-of select="$toc_example_title"/>
|
|
926
|
+
<xsl:if test="normalize-space($toc_example_title) = ''">
|
|
927
|
+
<xsl:call-template name="getLocalizedString">
|
|
928
|
+
<xsl:with-param name="key">toc_examples</xsl:with-param>
|
|
929
|
+
</xsl:call-template>
|
|
930
|
+
</xsl:if>
|
|
931
|
+
</mnx:title-list-examples>
|
|
919
932
|
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
933
|
+
<mnx:title-list-recommendations>
|
|
934
|
+
<xsl:variable name="toc_requirement_title" select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='requirement']/mn:title"/>
|
|
935
|
+
<xsl:value-of select="$toc_requirement_title"/>
|
|
936
|
+
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
|
937
|
+
<xsl:call-template name="getLocalizedString">
|
|
938
|
+
<xsl:with-param name="key">toc_recommendations</xsl:with-param>
|
|
939
|
+
</xsl:call-template>
|
|
940
|
+
</xsl:if>
|
|
941
|
+
</mnx:title-list-recommendations>
|
|
942
|
+
</mnx:doc>
|
|
943
|
+
</xsl:for-each>
|
|
944
|
+
</xsl:for-each>
|
|
928
945
|
</xsl:variable>
|
|
946
|
+
<xsl:variable name="toc_title_lists" select="xalan:nodeset($toc_title_lists_)"/>
|
|
929
947
|
|
|
930
948
|
<xsl:variable name="bibdata">
|
|
931
949
|
<xsl:copy-of select="//mn:metanorma/mn:bibdata"/>
|
|
@@ -1709,7 +1727,7 @@
|
|
|
1709
1727
|
<xsl:apply-templates mode="update_xml_step1"/>
|
|
1710
1728
|
</xsl:template>
|
|
1711
1729
|
|
|
1712
|
-
<xsl:template match="mn:semx" mode="update_xml_step1">
|
|
1730
|
+
<xsl:template match="mn:semx[not(@element = 'name')]" mode="update_xml_step1">
|
|
1713
1731
|
<xsl:apply-templates mode="update_xml_step1"/>
|
|
1714
1732
|
</xsl:template>
|
|
1715
1733
|
|
|
@@ -1992,7 +2010,7 @@
|
|
|
1992
2010
|
<xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
|
|
1993
2011
|
<xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
|
|
1994
2012
|
|
|
1995
|
-
<xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() > 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
|
2013
|
+
<xsl:template match="text()[not( (ancestor::mn:bibdata and not(ancestor::mn:title)) or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() > 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or (ancestor::mn:fmt-name and not(ancestor::mn:semx[@element = 'name'])) or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
|
1996
2014
|
|
|
1997
2015
|
<xsl:variable name="parent" select="local-name(..)"/>
|
|
1998
2016
|
|
|
@@ -2037,7 +2055,7 @@
|
|
|
2037
2055
|
<xsl:variable name="text">
|
|
2038
2056
|
<xsl:element name="text" namespace="{$namespace_full}">
|
|
2039
2057
|
<xsl:choose>
|
|
2040
|
-
<xsl:when test="ancestor::mn:table"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
|
|
2058
|
+
<xsl:when test="ancestor::mn:table and not(ancestor::mn:fmt-name)"><xsl:value-of select="."/></xsl:when> <!-- no need enclose standard's number into tag 'keep-together_within-line' in table cells -->
|
|
2041
2059
|
<xsl:otherwise>
|
|
2042
2060
|
<xsl:variable name="text_" select="java:replaceAll(java:java.lang.String.new(.), $regex_standard_reference, concat($tag_keep-together_within-line_open,'$1',$tag_keep-together_within-line_close))"/>
|
|
2043
2061
|
<!-- <xsl:value-of select="$text__"/> -->
|
|
@@ -2115,6 +2133,10 @@
|
|
|
2115
2133
|
<xsl:copy-of select="."/>
|
|
2116
2134
|
</xsl:template>
|
|
2117
2135
|
|
|
2136
|
+
<xsl:template match="mn:semx" mode="update_xml_enclose_keep-together_within-line">
|
|
2137
|
+
<xsl:apply-templates mode="update_xml_enclose_keep-together_within-line"/>
|
|
2138
|
+
</xsl:template>
|
|
2139
|
+
|
|
2118
2140
|
<xsl:template name="replace_text_tags">
|
|
2119
2141
|
<xsl:param name="tag_open"/>
|
|
2120
2142
|
<xsl:param name="tag_close"/>
|
|
@@ -9356,6 +9378,7 @@
|
|
|
9356
9378
|
<xsl:variable name="svg_content">
|
|
9357
9379
|
<xsl:apply-templates select="." mode="svg_update"/>
|
|
9358
9380
|
</xsl:variable>
|
|
9381
|
+
<!-- <svg_content><xsl:copy-of select="$svg_content"/></svg_content> -->
|
|
9359
9382
|
|
|
9360
9383
|
<xsl:variable name="alt-text">
|
|
9361
9384
|
<xsl:choose>
|
|
@@ -9570,7 +9593,7 @@
|
|
|
9570
9593
|
</xsl:copy>
|
|
9571
9594
|
</xsl:template>
|
|
9572
9595
|
|
|
9573
|
-
<xsl:template match="
|
|
9596
|
+
<xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
|
9574
9597
|
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
|
9575
9598
|
<xsl:value-of select="."/>
|
|
9576
9599
|
</xsl:attribute>
|
|
@@ -12150,13 +12173,13 @@
|
|
|
12150
12173
|
|
|
12151
12174
|
<xsl:template name="processTablesFigures_Contents">
|
|
12152
12175
|
<xsl:param name="always"/>
|
|
12153
|
-
<xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
|
|
12176
|
+
<xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='table']/mn:title) or normalize-space($always) = 'true'">
|
|
12154
12177
|
<xsl:call-template name="processTables_Contents"/>
|
|
12155
12178
|
</xsl:if>
|
|
12156
|
-
<xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
|
|
12179
|
+
<xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='figure']/mn:title) or normalize-space($always) = 'true'">
|
|
12157
12180
|
<xsl:call-template name="processFigures_Contents"/>
|
|
12158
12181
|
</xsl:if>
|
|
12159
|
-
<xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:toc[@type='example']/mn:title)">
|
|
12182
|
+
<xsl:if test="(//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:toc[@type='example']/mn:title)">
|
|
12160
12183
|
<xsl:call-template name="processExamples_Contents"/>
|
|
12161
12184
|
</xsl:if>
|
|
12162
12185
|
</xsl:template>
|
|
@@ -12207,22 +12230,22 @@
|
|
|
12207
12230
|
|
|
12208
12231
|
<xsl:template name="processExamples_Contents">
|
|
12209
12232
|
<mnx:examples>
|
|
12210
|
-
<xsl:for-each select="//mn:example[@id and mn:fmt-name and
|
|
12211
|
-
|
|
12212
|
-
|
|
12213
|
-
|
|
12214
|
-
|
|
12215
|
-
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
12219
|
-
|
|
12220
|
-
|
|
12221
|
-
|
|
12222
|
-
<xsl:copy-of select="
|
|
12223
|
-
</
|
|
12224
|
-
</xsl:
|
|
12225
|
-
</
|
|
12233
|
+
<xsl:for-each select="//mn:example[@id and mn:fmt-name and normalize-space(@id) != '']">
|
|
12234
|
+
<!-- https://github.com/metanorma/metanorma-pdfa/issues/32#issuecomment-4929133938:
|
|
12235
|
+
//example/fmt-xref-label[@container] + //example/fmt-name/span[@class = 'fmt-caption-delim'] + //example/name,
|
|
12236
|
+
with the last two elements dropped if //example/name does not exist. -->
|
|
12237
|
+
<xsl:variable name="example_name">
|
|
12238
|
+
<xsl:apply-templates select="mn:name/node()" mode="update_xml_step1"/>
|
|
12239
|
+
</xsl:variable>
|
|
12240
|
+
<mnx:example id="{@id}" alt-text="{normalize-space($example_name)}">
|
|
12241
|
+
<xsl:element name="fmt-name" namespace="{$namespace_full}">
|
|
12242
|
+
<xsl:value-of select="mn:fmt-xref-label[@container]"/>
|
|
12243
|
+
<xsl:if test="normalize-space($example_name) != ''">
|
|
12244
|
+
<xsl:value-of select="mn:fmt-name/mn:span[@class = 'fmt-caption-delim']"/>
|
|
12245
|
+
<xsl:copy-of select="$example_name"/>
|
|
12246
|
+
</xsl:if>
|
|
12247
|
+
</xsl:element>
|
|
12248
|
+
</mnx:example>
|
|
12226
12249
|
</xsl:for-each>
|
|
12227
12250
|
</mnx:examples>
|
|
12228
12251
|
</xsl:template>
|
|
@@ -12495,15 +12518,18 @@
|
|
|
12495
12518
|
|
|
12496
12519
|
<xsl:call-template name="insertFigureBookmarks">
|
|
12497
12520
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
12521
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12498
12522
|
</xsl:call-template>
|
|
12499
12523
|
|
|
12500
12524
|
<xsl:call-template name="insertTableBookmarks">
|
|
12501
12525
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
12526
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12502
12527
|
<xsl:with-param name="lang" select="@lang"/>
|
|
12503
12528
|
</xsl:call-template>
|
|
12504
12529
|
|
|
12505
12530
|
<xsl:call-template name="insertExampleBookmarks">
|
|
12506
12531
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
12532
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12507
12533
|
<xsl:with-param name="lang" select="@lang"/>
|
|
12508
12534
|
</xsl:call-template>
|
|
12509
12535
|
|
|
@@ -12518,15 +12544,18 @@
|
|
|
12518
12544
|
|
|
12519
12545
|
<xsl:call-template name="insertFigureBookmarks">
|
|
12520
12546
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
12547
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12521
12548
|
</xsl:call-template>
|
|
12522
12549
|
|
|
12523
12550
|
<xsl:call-template name="insertTableBookmarks">
|
|
12524
12551
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
12552
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12525
12553
|
<xsl:with-param name="lang" select="@lang"/>
|
|
12526
12554
|
</xsl:call-template>
|
|
12527
12555
|
|
|
12528
12556
|
<xsl:call-template name="insertExampleBookmarks">
|
|
12529
12557
|
<xsl:with-param name="contents" select="mnx:contents"/>
|
|
12558
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12530
12559
|
<xsl:with-param name="lang" select="@lang"/>
|
|
12531
12560
|
</xsl:call-template>
|
|
12532
12561
|
|
|
@@ -12539,15 +12568,18 @@
|
|
|
12539
12568
|
|
|
12540
12569
|
<xsl:call-template name="insertFigureBookmarks">
|
|
12541
12570
|
<xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
|
|
12571
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12542
12572
|
</xsl:call-template>
|
|
12543
12573
|
|
|
12544
12574
|
<xsl:call-template name="insertTableBookmarks">
|
|
12545
12575
|
<xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
|
|
12576
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12546
12577
|
<xsl:with-param name="lang" select="@lang"/>
|
|
12547
12578
|
</xsl:call-template>
|
|
12548
12579
|
|
|
12549
12580
|
<xsl:call-template name="insertExampleBookmarks">
|
|
12550
12581
|
<xsl:with-param name="contents" select="$contents_nodes/mnx:contents"/>
|
|
12582
|
+
<xsl:with-param name="num" select="@num"/>
|
|
12551
12583
|
<xsl:with-param name="lang" select="@lang"/>
|
|
12552
12584
|
</xsl:call-template>
|
|
12553
12585
|
|
|
@@ -12563,6 +12595,7 @@
|
|
|
12563
12595
|
|
|
12564
12596
|
<xsl:template name="insertFigureBookmarks">
|
|
12565
12597
|
<xsl:param name="contents"/>
|
|
12598
|
+
<xsl:param name="num"/>
|
|
12566
12599
|
<xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
|
|
12567
12600
|
<xsl:if test="$contents_nodes/mnx:figure">
|
|
12568
12601
|
<fo:bookmark internal-destination="{$contents_nodes/mnx:figure[1]/@id}" starting-state="hide">
|
|
@@ -12580,7 +12613,7 @@
|
|
|
12580
12613
|
<fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
|
|
12581
12614
|
|
|
12582
12615
|
<xsl:variable name="bookmark-title">
|
|
12583
|
-
<xsl:value-of select="$title-list-figures"/>
|
|
12616
|
+
<xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-figures"/>
|
|
12584
12617
|
</xsl:variable>
|
|
12585
12618
|
<fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
|
|
12586
12619
|
<xsl:for-each select="$contents_nodes//mnx:figures/mnx:figure">
|
|
@@ -12594,6 +12627,7 @@
|
|
|
12594
12627
|
|
|
12595
12628
|
<xsl:template name="insertTableBookmarks">
|
|
12596
12629
|
<xsl:param name="contents"/>
|
|
12630
|
+
<xsl:param name="num"/>
|
|
12597
12631
|
<xsl:param name="lang"/>
|
|
12598
12632
|
<xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
|
|
12599
12633
|
<xsl:if test="$contents_nodes/mnx:table">
|
|
@@ -12617,7 +12651,7 @@
|
|
|
12617
12651
|
<fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
|
|
12618
12652
|
|
|
12619
12653
|
<xsl:variable name="bookmark-title">
|
|
12620
|
-
<xsl:value-of select="$title-list-tables"/>
|
|
12654
|
+
<xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-tables"/>
|
|
12621
12655
|
</xsl:variable>
|
|
12622
12656
|
|
|
12623
12657
|
<fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
|
|
@@ -12632,8 +12666,9 @@
|
|
|
12632
12666
|
</xsl:if>
|
|
12633
12667
|
</xsl:template> <!-- insertTableBookmarks -->
|
|
12634
12668
|
|
|
12635
|
-
|
|
12669
|
+
<xsl:template name="insertExampleBookmarks">
|
|
12636
12670
|
<xsl:param name="contents"/>
|
|
12671
|
+
<xsl:param name="num"/>
|
|
12637
12672
|
<xsl:param name="lang"/>
|
|
12638
12673
|
<xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
|
|
12639
12674
|
<xsl:if test="$contents_nodes/mnx:example">
|
|
@@ -12657,7 +12692,7 @@
|
|
|
12657
12692
|
<fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
|
|
12658
12693
|
|
|
12659
12694
|
<xsl:variable name="bookmark-title">
|
|
12660
|
-
<xsl:value-of select="$title-list-examples"/>
|
|
12695
|
+
<xsl:value-of select="$toc_title_lists/mnx:doc[@num = $num]/mnx:title-list-examples"/>
|
|
12661
12696
|
</xsl:variable>
|
|
12662
12697
|
|
|
12663
12698
|
<fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
|
|
@@ -12818,6 +12853,18 @@
|
|
|
12818
12853
|
</xsl:copy>
|
|
12819
12854
|
</xsl:template>
|
|
12820
12855
|
|
|
12856
|
+
<xsl:template match="mn:tt" mode="contents_item">
|
|
12857
|
+
<xsl:copy>
|
|
12858
|
+
<xsl:apply-templates mode="contents_item"/>
|
|
12859
|
+
</xsl:copy>
|
|
12860
|
+
</xsl:template>
|
|
12861
|
+
|
|
12862
|
+
<xsl:template match="*[local-name() = 'keep-together_within-line']" mode="contents_item">
|
|
12863
|
+
<xsl:copy>
|
|
12864
|
+
<xsl:apply-templates mode="contents_item"/>
|
|
12865
|
+
</xsl:copy>
|
|
12866
|
+
</xsl:template>
|
|
12867
|
+
|
|
12821
12868
|
<xsl:template match="mn:stem" mode="contents_item"/>
|
|
12822
12869
|
<xsl:template match="mn:fmt-stem" mode="contents_item">
|
|
12823
12870
|
<xsl:copy-of select="."/>
|
data/data/oiml/config.yaml
CHANGED
|
@@ -16,6 +16,16 @@ base-override:
|
|
|
16
16
|
#presentation-metadata-backcover-text: expresslang.org
|
|
17
17
|
output-extensions: xml,html,pdf,doc
|
|
18
18
|
fonts: Futura PT Book;Futura PT Demi;Futura PT Light
|
|
19
|
+
bibliography-sort:
|
|
20
|
+
- abbrev: OIML
|
|
21
|
+
rank: 1
|
|
22
|
+
name: International Organization of Legal Metrology
|
|
23
|
+
- abbrev: ISO
|
|
24
|
+
rank: 2
|
|
25
|
+
name: International Organization for Standardization
|
|
26
|
+
- abbrev: IEC
|
|
27
|
+
rank: 3
|
|
28
|
+
name: International Electrotechnical Commission
|
|
19
29
|
doctypes:
|
|
20
30
|
# OIML G
|
|
21
31
|
- taste: international-guide
|
data/data/pdfa/config.yaml
CHANGED
|
@@ -16,13 +16,13 @@ base-override:
|
|
|
16
16
|
publisher_abbr: PDF Association
|
|
17
17
|
presentation-metadata-color-secondary: '#d03f4e' # PDFa logo red - good contrast for WCAG Level AA
|
|
18
18
|
presentation-metadata-backcover-text: https://pdfa.org
|
|
19
|
-
body-font: "'Source Sans 3',
|
|
20
|
-
header-font: "'Source Sans 3',
|
|
21
|
-
monospace-font: "'
|
|
22
|
-
fonts: Source Sans 3;Source Sans 3 SemiBold;Source Sans Pro
|
|
19
|
+
body-font: "'Source Sans 3', sans-serif"
|
|
20
|
+
header-font: "'Source Sans 3', sans-serif"
|
|
21
|
+
monospace-font: "'Source Code Pro', monospace"
|
|
22
|
+
fonts: "Source Sans 3 ExtraLight;Source Sans 3 Light;Source Sans 3;Source Sans 3 Medium;Source Sans 3 SemiBold;Source Sans 3 ExtraBold;Source Sans 3 Black;Source Code Pro ExtraLight;Source Code Pro Light;Source Code Pro;Source Code Pro Medium;Source Code Pro SemiBold;Source Code Pro ExtraBold;Source Code Pro Black;STIX Two Math;Arial;Courier New"
|
|
23
23
|
output-extensions: xml,html,pdf
|
|
24
24
|
toclevels-html: 6
|
|
25
|
-
docidentifier: '{{ doctype_abbr }}-{{ docnumeric | prepend: "000" | slice: -3,3 }} {% if draft %}v{{ draft }}{% endif %} {% if edition %}ed. {{ edition }}{% endif %}'
|
|
25
|
+
docidentifier: '{{ doctype_abbr }}-{{ docnumeric | prepend: "000" | slice: -3,3 }}{% if bibdata.status.stage.abbreviation %}-{{ bibdata.status.stage.abbreviation }}{% endif %} {% if draft %}v{{ draft }}{% endif %} {% if edition %}ed. {{ edition }}{% endif %}'
|
|
26
26
|
doctypes:
|
|
27
27
|
- taste: specification # Specification # The name goes into i18n.yaml
|
|
28
28
|
base: standard
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
<div class="docidentifier">
|
|
41
41
|
<p><b>
|
|
42
|
-
{{doctype_display}} : {{ docnumber }} {%if stage_display %} - <span style="color:red">{{stage_display}}</span>{% endif %}
|
|
42
|
+
{{doctype_display}} : {{ docnumber }} {%if stage_display %} - <span style="color:red">{{stage_display}}{% if bibdata.status.stage.abbreviation %} ({{ bibdata.status.stage.abbreviation }}){% endif %}</span>{% endif %}
|
|
43
43
|
</b></p>
|
|
44
44
|
</div>
|
|
45
45
|
<hr/>
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
:root {
|
|
2
|
-
--
|
|
2
|
+
--color_blue: rgb(22, 97, 173); /* copied from ribose.standard.xsl */
|
|
3
|
+
--logo_yellow: rgb(202,152,49);
|
|
4
|
+
--logo_green: rgb(139,152,91);
|
|
5
|
+
--logo_red: rgb(208,63,78); /* only logo color with sufficient contrast for WCAG Level AA */
|
|
6
|
+
--logo_blue: rgb(72,145,175);
|
|
7
|
+
--proportional_font: 'Source Sans 3', sans-serif;
|
|
8
|
+
--small-text-reduction: 85%;
|
|
9
|
+
--monospaced_font: 'Source Code Pro', monospace;
|
|
10
|
+
--mono_font-reduction: 90%;
|
|
11
|
+
--ribose-primary-color: var(--logo_red); /* used by base flavor styling */
|
|
3
12
|
}
|
|
4
13
|
|
|
5
14
|
a {
|
|
6
15
|
text-decoration: underline; /* WCAG - all links must be clearly visible */
|
|
7
|
-
color:
|
|
16
|
+
color: var(--logo_red)
|
|
8
17
|
}
|
|
9
18
|
|
|
10
19
|
img { /* Make images more responsive */
|
|
@@ -16,52 +25,121 @@ body {
|
|
|
16
25
|
line-height: 1.5; /* WCAG level AA requires minimum line height of 1.5 */
|
|
17
26
|
}
|
|
18
27
|
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
p { /* Compress whitespace but equally top and bottom */
|
|
29
|
+
margin-top: 1mm;
|
|
30
|
+
margin-bottom: 1mm;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
tt, td tt, p tt, li tt { /* override 0.8em formatting elsewhere */
|
|
34
|
+
font-size: 1em;
|
|
21
35
|
}
|
|
22
36
|
|
|
23
|
-
|
|
37
|
+
/* FIGURES, EXAMPLES, SOURCE CODE, ETC. */
|
|
38
|
+
|
|
39
|
+
figure { /* incl. source code */
|
|
40
|
+
display: block;
|
|
24
41
|
line-height: 1.5; /* WCAG level AA requires minimum line height of 1.5 */
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
padding-
|
|
42
|
+
font-size: 100%;
|
|
43
|
+
margin-top: 0;
|
|
44
|
+
padding: 0;
|
|
45
|
+
padding-left: 2mm;
|
|
46
|
+
margin-bottom: 0;
|
|
29
47
|
}
|
|
30
48
|
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
figure svg { /* avoid excessive up-scaling of SVGs */
|
|
50
|
+
width: auto;
|
|
51
|
+
height: auto;
|
|
52
|
+
max-width: 800px; /* hard ceiling - never too wide for wide figures */
|
|
53
|
+
max-height: 500px; /* hard ceiling - never too tall for tall figures */
|
|
33
54
|
}
|
|
34
55
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
56
|
+
figure picture { /* images */
|
|
57
|
+
display: block; /* picture must be block for margin: auto to work */
|
|
58
|
+
width: fit-content; /* shrink-wrap to the img's natural size */
|
|
38
59
|
}
|
|
39
60
|
|
|
40
|
-
|
|
41
|
-
|
|
61
|
+
.figdl dt {
|
|
62
|
+
color: var(--color_blue);
|
|
63
|
+
font-weight: bolder; /* may slightly hide some PDF notation */
|
|
42
64
|
}
|
|
43
65
|
|
|
44
|
-
/*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
color: #d03f4e; /* PDFa logo red */
|
|
48
|
-
font-size: 90%;
|
|
66
|
+
/* Collapsible examples - title */
|
|
67
|
+
summary {
|
|
68
|
+
color: var(--color_blue);
|
|
49
69
|
}
|
|
50
70
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
.example {
|
|
72
|
+
margin-left: 3mm;
|
|
73
|
+
padding: 2mm;
|
|
74
|
+
margin-top: 2mm;
|
|
75
|
+
border-left: 2pt solid var(--color_blue);
|
|
76
|
+
text-transform: none; /* PDF is case-sensitive! Never force uppercase! */
|
|
77
|
+
background-color: #D6FFFE; /* Very pale blue */
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.example .example-title {
|
|
81
|
+
color: var(--color_blue);
|
|
82
|
+
margin-left: 0;
|
|
83
|
+
font-weight: normal;
|
|
84
|
+
text-transform: none; /* PDF is case-sensitive! Never force uppercase! */
|
|
56
85
|
}
|
|
57
86
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
87
|
+
.sourcecode {
|
|
88
|
+
background-color: rgb(230, 230, 230);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
figcaption.SourceTitle { /* Revert the title back from smaller monospaced font */
|
|
92
|
+
font-family: var(--proportional_font) !important;
|
|
62
93
|
font-size: 110%;
|
|
94
|
+
font-weight: normal;
|
|
95
|
+
text-align: left !important;
|
|
96
|
+
margin-top: 2mm;
|
|
97
|
+
margin-bottom: 2mm;
|
|
98
|
+
color: var(--color_blue);
|
|
99
|
+
order: -1; /* move to top */
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
pre { /* Rouge source code blocks */
|
|
103
|
+
font-size: var(--mono_font-reduction);
|
|
104
|
+
line-height: 1.5; /* required by WCAG Level AA minimum, override from elsewhere */
|
|
105
|
+
margin: 0;
|
|
106
|
+
margin-left: 2mm;
|
|
107
|
+
margin-right: 2mm;
|
|
108
|
+
padding: 1mm;
|
|
109
|
+
padding-left: 2mm;
|
|
63
110
|
}
|
|
64
111
|
|
|
112
|
+
/* TABLES - need to hard override some explicit style formatting on the HTML tags */
|
|
113
|
+
/* Can also use DataTables.js classes - https://datatables.net/manual/styling/classes */
|
|
114
|
+
|
|
115
|
+
table {
|
|
116
|
+
border: 2pt solid var(--color_blue) !important; /* thick */
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
table th { /* Table headers */
|
|
120
|
+
border: 2pt solid var(--color_blue) !important; /* thick */
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
table > caption {
|
|
124
|
+
font-weight: normal; /* Retain PDF notation formatting */
|
|
125
|
+
margin-top: 2mm; /* Close spacing at top */
|
|
126
|
+
padding: 2mm;
|
|
127
|
+
color: var(--color_blue);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
table td {
|
|
131
|
+
padding: 0;
|
|
132
|
+
padding-left: 1mm;
|
|
133
|
+
border: 0.75pt solid var(--color_blue) !important; /* thin */
|
|
134
|
+
margin-top: 1mm; /* Close up spacing */
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
table.layout { /* class="layout" implies an invisible table used to influence layout */
|
|
138
|
+
border: none !important;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/* COVER MATERIAL */
|
|
142
|
+
|
|
65
143
|
.logo { /* cover page logo */
|
|
66
144
|
text-align: center;
|
|
67
145
|
}
|
|
@@ -77,30 +155,107 @@ ul ul ul > li::before {
|
|
|
77
155
|
font-size: 32pt;
|
|
78
156
|
}
|
|
79
157
|
|
|
80
|
-
|
|
158
|
+
/* NAVIGATION MENU */
|
|
159
|
+
|
|
160
|
+
/* Avoid bullets on ToC items */
|
|
161
|
+
#toc li::before, #toc li::marker {
|
|
162
|
+
content: none;
|
|
163
|
+
display: inside;
|
|
164
|
+
}
|
|
165
|
+
#toc li a, #toc > ul :is(.h1) li a {
|
|
166
|
+
text-transform: none; /* PDF is case-sensitive! Never force nav bookmark text uppercase! */
|
|
167
|
+
padding: 1pt;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
#toc li a, #toc > ul :is(.h2, .h3, .h4, .h5, .h6) li a {
|
|
81
171
|
text-transform: none; /* PDF is case-sensitive! Never force nav bookmark text uppercase! */
|
|
172
|
+
padding-top: 0.25pt;
|
|
173
|
+
padding-bottom: 0.25pt;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
#toc > ul :is(.h1) { /* H1's in bookmarks are bolder blue (not outright bold!) */
|
|
177
|
+
color: var(--color_blue);
|
|
178
|
+
font-weight: bolder; /* may slightly hide some PDF notation */
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/* HEADINGS */
|
|
182
|
+
|
|
183
|
+
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
|
184
|
+
text-transform: none; /* PDF is case-sensitive! Never force headings uppercase! */
|
|
185
|
+
font-weight: bolder; /* may slightly hide some PDF notation */
|
|
82
186
|
}
|
|
83
187
|
|
|
84
188
|
h1, .h1 {
|
|
85
|
-
|
|
189
|
+
margin-top: 3mm; /* tighten up spacing */
|
|
86
190
|
}
|
|
87
191
|
|
|
88
|
-
|
|
89
|
-
|
|
192
|
+
/* UNORDERED LIST BULLETS */
|
|
193
|
+
|
|
194
|
+
/* Null out other CSS that uses legacy ::before */
|
|
195
|
+
ul > li::before {
|
|
196
|
+
content: none;
|
|
197
|
+
display: outside;
|
|
198
|
+
width: auto;
|
|
199
|
+
margin: 0;
|
|
200
|
+
padding: 0;
|
|
90
201
|
}
|
|
91
202
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
203
|
+
/* Level 1: Square bullet, logo red followed by EM space (U+2003) */
|
|
204
|
+
ul > li::marker {
|
|
205
|
+
content: "■\2003";
|
|
206
|
+
color: var(--logo_red);
|
|
96
207
|
}
|
|
97
208
|
|
|
98
|
-
|
|
99
|
-
|
|
209
|
+
/* Level 2: Diamond bullet, logo blue followed by EM space (U+2003) */
|
|
210
|
+
ul ul > li::marker {
|
|
211
|
+
content: "◆\2003";
|
|
212
|
+
color: var(--logo_blue);
|
|
100
213
|
}
|
|
101
214
|
|
|
102
|
-
|
|
103
|
-
|
|
215
|
+
/* Level 3: Circle bullet, logo green followed by EM space (U+2003) */
|
|
216
|
+
ul ul ul > li::marker {
|
|
217
|
+
content: "●\2003";
|
|
218
|
+
color: var(--logo_green);
|
|
219
|
+
font-size: 120%;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/* Level 4: Square bullet, logo red followed by EM space (U+2003) */
|
|
223
|
+
ul ul ul ul > li::marker {
|
|
224
|
+
content: "■\2003";
|
|
225
|
+
color: var(--logo_yellow);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Level 5: Diamond bullet, logo blue followed by EM space (U+2003) */
|
|
229
|
+
ul ul ul ul ul > li::marker {
|
|
230
|
+
content: "◆\2003";
|
|
231
|
+
color: var(--logo_blue);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* Level 6: Circle bullet, logo green followed by EM space (U+2003) */
|
|
235
|
+
ul ul ul ul ul ul > li::marker {
|
|
236
|
+
content: "●\2003";
|
|
237
|
+
color: var(--logo_green);
|
|
238
|
+
font-size: 120%;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/* Space out unordered list items */
|
|
242
|
+
div.ul_wrap:has(> ul > li) {
|
|
243
|
+
margin-top: 2mm;
|
|
244
|
+
margin-bottom: 2mm;
|
|
245
|
+
margin-left: 4mm;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/* Block quotes */
|
|
249
|
+
.Quote {
|
|
250
|
+
width: 95%;
|
|
251
|
+
margin-left: 15mm;
|
|
252
|
+
margin-right: 5mm;
|
|
253
|
+
margin-top: 0;
|
|
254
|
+
padding: 2mm;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.QuoteAttribution {
|
|
258
|
+
text-align: right;
|
|
104
259
|
}
|
|
105
260
|
|
|
106
261
|
span.TermNum {
|
|
@@ -108,135 +263,157 @@ span.TermNum {
|
|
|
108
263
|
}
|
|
109
264
|
|
|
110
265
|
.requirement {
|
|
111
|
-
color:
|
|
266
|
+
color: rgb(255, 0, 0);
|
|
112
267
|
font-weight: bold;
|
|
113
268
|
text-transform: uppercase; /* Uppercase "SHALL" a-la RFCs */
|
|
114
269
|
}
|
|
115
270
|
|
|
116
271
|
.recommendation {
|
|
117
|
-
color:
|
|
272
|
+
color: rgb(255, 140, 0);
|
|
118
273
|
font-weight: bold;
|
|
119
274
|
text-transform: uppercase; /* Uppercase "SHOULD" a-la RFCs */
|
|
120
275
|
}
|
|
121
276
|
|
|
122
|
-
.pdf-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
font-weight: bold;
|
|
277
|
+
.pdf-version {
|
|
278
|
+
color: rgb(0, 0, 255);
|
|
279
|
+
font-style: italic;
|
|
280
|
+
font-weight: lighter;
|
|
127
281
|
}
|
|
282
|
+
.pdf-version::before { content: "(PDF "; }
|
|
283
|
+
.pdf-version::after { content: ")"; }
|
|
128
284
|
|
|
129
285
|
.pdf-operator {
|
|
130
|
-
font-family:
|
|
131
|
-
|
|
132
|
-
|
|
286
|
+
font-family: var(--monospaced_font);
|
|
287
|
+
font-size: var(--mono_font-reduction);
|
|
288
|
+
padding: 1pt;
|
|
289
|
+
background-color: rgb(224, 224, 175);
|
|
290
|
+
color: rgb(255, 0, 0);
|
|
133
291
|
font-weight: bold;
|
|
134
292
|
}
|
|
135
293
|
|
|
136
|
-
.pdf-
|
|
137
|
-
font-
|
|
138
|
-
font-
|
|
139
|
-
|
|
294
|
+
.pdf-keyword {
|
|
295
|
+
font-family: var(--monospaced_font);
|
|
296
|
+
font-size: var(--mono_font-reduction);
|
|
297
|
+
padding: 1pt;
|
|
298
|
+
background-color: rgb(224, 224, 175);
|
|
299
|
+
color: rgb(0, 0, 255);
|
|
300
|
+
font-weight: bold;
|
|
140
301
|
}
|
|
141
|
-
.pdf-version::before { content: "(PDF "; }
|
|
142
|
-
.pdf-version::after { content: ")"; }
|
|
143
302
|
|
|
144
303
|
/* Base admonition styling */
|
|
145
|
-
.Note, .
|
|
146
|
-
font-size:
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
margin
|
|
150
|
-
margin-
|
|
151
|
-
padding:
|
|
152
|
-
padding-left: 1.5mm;
|
|
153
|
-
padding-right: 1.5mm;
|
|
154
|
-
border-left: 4pt solid;
|
|
304
|
+
.Note, .Admonition {
|
|
305
|
+
font-size: var(--small-text-reduction);
|
|
306
|
+
background-color: rgb(252, 251, 212);
|
|
307
|
+
border-left: 4pt solid rgb(255, 200, 36);
|
|
308
|
+
margin: 2mm;
|
|
309
|
+
margin-left: 3mm;
|
|
310
|
+
padding: 1.5mm;
|
|
155
311
|
}
|
|
156
312
|
|
|
157
|
-
.note_label {
|
|
158
|
-
font-weight: bold; /* the "NOTE 1" text before the body of a note
|
|
313
|
+
.note_label, .termnote_label {
|
|
314
|
+
font-weight: bold; /* the "NOTE 1" or "Note to entry" text before the body of a note*/
|
|
159
315
|
}
|
|
160
316
|
|
|
161
317
|
.AdmonitionTitle { /* titles of all admonitions */
|
|
162
318
|
text-align: left;
|
|
163
319
|
text-transform: none; /* PDF is case sensitive! */
|
|
164
|
-
font-weight: bold;
|
|
320
|
+
font-weight: bold; /* may hide some PDF notation */
|
|
165
321
|
}
|
|
166
322
|
|
|
167
323
|
/* Tip admonition */
|
|
168
324
|
.AdmonitionTip {
|
|
169
|
-
background-color:
|
|
170
|
-
border-left-
|
|
171
|
-
border-left-color: #d03f4e; /* rgb(208,63,78) - PDFa red */
|
|
325
|
+
background-color: rgb(245,235,206);
|
|
326
|
+
border-left-color: rgb(208,63,78);
|
|
172
327
|
}
|
|
173
328
|
|
|
174
|
-
.AdmonitionTip
|
|
175
|
-
color:
|
|
329
|
+
.AdmonitionTip.AdmonitionTitle {
|
|
330
|
+
color: rgb(208,63,78);
|
|
331
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
176
332
|
}
|
|
177
333
|
|
|
178
334
|
/* Warning admonition */
|
|
179
335
|
.AdmonitionWarning {
|
|
180
|
-
background-color:
|
|
181
|
-
border-left-
|
|
182
|
-
border-left-color: #ff8c00; /* rgb(255,140,0) - dark orange */
|
|
336
|
+
background-color: rgb(255,245,230);
|
|
337
|
+
border-left-color: rgb(255,140,0);
|
|
183
338
|
}
|
|
184
339
|
|
|
185
|
-
.AdmonitionWarning
|
|
186
|
-
color:
|
|
340
|
+
.AdmonitionWarning.AdmonitionTitle {
|
|
341
|
+
color: rgb(255,140,0);
|
|
342
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
187
343
|
}
|
|
188
344
|
|
|
189
345
|
/* Caution admonition */
|
|
190
346
|
.AdmonitionCaution {
|
|
191
|
-
background-color:
|
|
192
|
-
border-left-
|
|
193
|
-
border-left-color: #b8860b; /* rgb(184,134,11) - dark goldenrod */
|
|
347
|
+
background-color: rgb(255,250,205);
|
|
348
|
+
border-left-color: rgb(184,134,11);
|
|
194
349
|
}
|
|
195
350
|
|
|
196
|
-
.AdmonitionCaution
|
|
197
|
-
color:
|
|
351
|
+
.AdmonitionCaution.AdmonitionTitle {
|
|
352
|
+
color: rgb(184,134,11);
|
|
353
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
198
354
|
}
|
|
199
355
|
|
|
200
356
|
/* Important admonition */
|
|
201
357
|
.AdmonitionImportant {
|
|
202
|
-
background-color:
|
|
203
|
-
border-left-
|
|
204
|
-
border-left-color: #ff0000; /* rgb(255,0,0) - red */
|
|
358
|
+
background-color: rgb(255,230,230);
|
|
359
|
+
border-left-color: rgb(255,0,0);
|
|
205
360
|
}
|
|
206
361
|
|
|
207
|
-
.AdmonitionImportant
|
|
208
|
-
color:
|
|
362
|
+
.AdmonitionImportant.AdmonitionTitle {
|
|
363
|
+
color: rgb(255,0,0);
|
|
364
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
209
365
|
}
|
|
210
366
|
|
|
211
367
|
/* Safety-precaution admonition */
|
|
212
368
|
.AdmonitionSafetyPrecaution {
|
|
213
|
-
background-color:
|
|
214
|
-
border-left-
|
|
215
|
-
border-left-color: #008000; /* rgb(0,128,0) - green */
|
|
369
|
+
background-color:rgb(230,245,230);
|
|
370
|
+
border-left-color: rgb(0,128,0);
|
|
216
371
|
}
|
|
217
372
|
|
|
218
|
-
.AdmonitionSafetyPrecaution
|
|
219
|
-
color:
|
|
373
|
+
.AdmonitionSafetyPrecaution.AdmonitionTitle {
|
|
374
|
+
color: rgb(0,128,0);
|
|
375
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
220
376
|
}
|
|
221
377
|
|
|
222
378
|
/* Editorial admonition */
|
|
223
379
|
.AdmonitionEditorial {
|
|
224
|
-
background-color:
|
|
225
|
-
border-left-
|
|
226
|
-
border-left-color: #808080; /* rgb(128,128,128) - gray */
|
|
380
|
+
background-color: rgb(240,240,240);
|
|
381
|
+
border-left-color: rgb(128,128,128);
|
|
227
382
|
}
|
|
228
383
|
|
|
229
|
-
.AdmonitionEditorial
|
|
230
|
-
color:
|
|
384
|
+
.AdmonitionEditorial.AdmonitionTitle {
|
|
385
|
+
color: rgb(128,128,128);
|
|
386
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
231
387
|
}
|
|
232
388
|
|
|
233
389
|
/* Box admonition */
|
|
234
390
|
.AdmonitionBox {
|
|
235
|
-
background-color:
|
|
391
|
+
background-color: rgb(154, 221, 218);
|
|
236
392
|
border: 2pt solid black;
|
|
237
|
-
border-left: none;
|
|
238
393
|
}
|
|
239
394
|
|
|
240
395
|
.AdmonitionBox.AdmonitionTitle {
|
|
241
|
-
border: none;
|
|
396
|
+
border: none; /* do not additionally border the box admonition title */
|
|
397
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
242
398
|
}
|
|
399
|
+
|
|
400
|
+
/* Other admonition */
|
|
401
|
+
.AdmonitionOther {
|
|
402
|
+
background-color: rgb(240,240,240);
|
|
403
|
+
border-left-color: rgb(80, 80, 80);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.AdmonitionOther.AdmonitionTitle {
|
|
407
|
+
color: rgb(80, 80, 80);
|
|
408
|
+
text-align: left !important; /* HTML has hard-coded style to center */
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
p.Biblio { /* hanging indent for bibliographic entries */
|
|
412
|
+
margin-left: 8.5mm;
|
|
413
|
+
text-indent: -5mm;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.Biblio.note_label {
|
|
417
|
+
margin-top: 0;
|
|
418
|
+
margin-left: 5mm;
|
|
419
|
+
}
|
data/data/pdfa/i18n.yaml
CHANGED
|
@@ -15,10 +15,11 @@ term_def_boilerplate: |
|
|
|
15
15
|
* Glossary of general PDF terms: available at https://pdfa.org/glossary-of-pdf-terms/[]
|
|
16
16
|
* Glossary of PDF accessibility terminology: available at https://pdfa.org/resource/glossary-of-accessibility-terminology-in-pdf/[]
|
|
17
17
|
|
|
18
|
+
# Not used by pdfa.xsl "getLocalizedString"!
|
|
18
19
|
stage_dict:
|
|
19
20
|
draft: Draft
|
|
20
21
|
release-candidate: Release Candidate
|
|
21
|
-
published:
|
|
22
|
+
published:
|
|
22
23
|
|
|
23
24
|
admonition: # see https://github.com/metanorma/isodoc/issues/760
|
|
24
25
|
tip: Tip
|
|
@@ -27,18 +28,21 @@ admonition: # see https://github.com/metanorma/isodoc/issues/760
|
|
|
27
28
|
caution: Caution
|
|
28
29
|
important: IMPORTANT!
|
|
29
30
|
safety precautions: SECURITY!
|
|
30
|
-
editorial: Editor Note
|
|
31
|
+
editorial: Editor's Note
|
|
31
32
|
|
|
32
33
|
abstract: Summary
|
|
33
|
-
foreword:
|
|
34
|
-
clause:
|
|
35
|
-
formula:
|
|
34
|
+
foreword: preface
|
|
35
|
+
clause: section # not capitalized
|
|
36
|
+
formula: equation
|
|
36
37
|
subclause: sub-section
|
|
37
|
-
section:
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
section: section
|
|
39
|
+
edition: edition # cover page word
|
|
40
|
+
annex: Appendix # not capitalized, used in citations
|
|
41
|
+
table_of_contents: Table of Contents # not capitalized by MN
|
|
40
42
|
annex_subclause: sub-section
|
|
41
|
-
termsdef: Definitions
|
|
42
|
-
termsdefsymbolsabbrev: Definitions, acronyms and abbreviations
|
|
43
|
-
termsdefsymbols: Definitions, acronyms and
|
|
44
|
-
termsdefabbrev: Definitions, acronyms and abbreviations
|
|
43
|
+
termsdef: Definitions # not capitalized by MN
|
|
44
|
+
termsdefsymbolsabbrev: Definitions, acronyms, symbols, and abbreviations
|
|
45
|
+
termsdefsymbols: Definitions, acronyms, and symbols
|
|
46
|
+
termsdefabbrev: Definitions, acronyms, and abbreviations
|
|
47
|
+
draft: Draft
|
|
48
|
+
release-candidate: Release Candidate
|
data/data/pdfa/pdfa.xsl
CHANGED
|
@@ -301,15 +301,15 @@
|
|
|
301
301
|
<fo:block role="P/Title">
|
|
302
302
|
<!-- Main title of doc -->
|
|
303
303
|
<fo:block font-size="{$font_size}pt" font-weight="bold" font-style="{$font_style}" role="SKIP">
|
|
304
|
-
<fo:block role="SKIP"><xsl:apply-templates select="
|
|
304
|
+
<fo:block role="SKIP"><xsl:apply-templates select="mn:metanorma/mn:bibdata/mn:title[@type = 'intro' and @language = $curr_lang]/node()"/></fo:block>
|
|
305
305
|
</fo:block>
|
|
306
306
|
<!-- Subtitle of doc -->
|
|
307
307
|
<fo:block font-size="{$font_size - 2}pt" font-style="{$font_style}" role="SKIP">
|
|
308
|
-
<fo:block role="SKIP"><xsl:apply-templates select="
|
|
308
|
+
<fo:block role="SKIP"><xsl:apply-templates select="mn:metanorma/mn:bibdata/mn:title[@type = 'main' and @language = $curr_lang][last()]/node()"/></fo:block>
|
|
309
309
|
</fo:block>
|
|
310
310
|
<!-- Part title -->
|
|
311
311
|
<fo:block font-size="{$font_size - 8}pt" font-style="{$font_style}" role="SKIP">
|
|
312
|
-
<fo:block role="SKIP"><xsl:apply-templates select="
|
|
312
|
+
<fo:block role="SKIP"><xsl:apply-templates select="mn:metanorma/mn:bibdata/mn:title[@type = 'part' and @language = $curr_lang]/node()"/></fo:block>
|
|
313
313
|
</fo:block>
|
|
314
314
|
</fo:block>
|
|
315
315
|
</xsl:template>
|
|
@@ -386,7 +386,10 @@
|
|
|
386
386
|
<xsl:variable name="current_document"><xsl:copy-of select="."/></xsl:variable>
|
|
387
387
|
<xsl:for-each select="xalan:nodeset($current_document)">
|
|
388
388
|
<mnx:doc num="{$num}">
|
|
389
|
-
<
|
|
389
|
+
<xsl:variable name="bibdata">
|
|
390
|
+
<xsl:apply-templates select="mn:metanorma/mn:bibdata" mode="update_xml_enclose_keep-together_within-line"/>
|
|
391
|
+
</xsl:variable>
|
|
392
|
+
<title><xsl:apply-templates select="xalan:nodeset($bibdata)/mn:bibdata/mn:title[@type = 'main'][last()]/node()"/></title>
|
|
390
393
|
</mnx:doc>
|
|
391
394
|
</xsl:for-each>
|
|
392
395
|
</xsl:for-each>
|
|
@@ -506,11 +509,6 @@
|
|
|
506
509
|
<xsl:attribute-set name="refine_term-kind-style"><?extend?>
|
|
507
510
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
|
508
511
|
</xsl:attribute-set>
|
|
509
|
-
|
|
510
|
-
<xsl:template name="refine_title-style"><?extend?>
|
|
511
|
-
<xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
|
|
512
|
-
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
|
513
|
-
</xsl:attribute-set>
|
|
514
512
|
|
|
515
513
|
<!-- Suppress the boxes with text that appear to the right of preferred / admitted terms -->
|
|
516
514
|
<xsl:template name="display_term_kind">
|
|
@@ -574,15 +572,7 @@
|
|
|
574
572
|
<xsl:template name="refine_tt-style"><?extend?>
|
|
575
573
|
<xsl:attribute name="font-size"><xsl:value-of select="$mono_font-reduction"/></xsl:attribute>
|
|
576
574
|
</xsl:template>
|
|
577
|
-
|
|
578
|
-
<xsl:template name="refine_list-item-label-style"><?extend?>
|
|
579
|
-
<xsl:if test="parent::mn:ul">
|
|
580
|
-
<xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
|
|
581
|
-
<xsl:copy-of select="@color"/>
|
|
582
|
-
<xsl:copy-of select="@font-size"/>
|
|
583
|
-
</xsl:if>
|
|
584
|
-
</xsl:template>
|
|
585
|
-
|
|
575
|
+
|
|
586
576
|
<xsl:template name="refine_sourcecode-style"><?extend?>
|
|
587
577
|
<xsl:attribute name="font-size">85%</xsl:attribute>
|
|
588
578
|
</xsl:template>
|
|
@@ -658,7 +648,7 @@
|
|
|
658
648
|
<xsl:apply-templates/>
|
|
659
649
|
</xsl:template>
|
|
660
650
|
|
|
661
|
-
<xsl:template match="mn:admonition[@type = 'warning']/*/mn:fmt-name
|
|
651
|
+
<xsl:template match="mn:admonition[@type = 'warning']/*/mn:fmt-name">
|
|
662
652
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
663
653
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
664
654
|
<xsl:attribute name="color">rgb(255,140,0)</xsl:attribute>
|
|
@@ -916,4 +906,29 @@
|
|
|
916
906
|
</xsl:choose>
|
|
917
907
|
</xsl:template>
|
|
918
908
|
|
|
909
|
+
<xsl:template name="refine_list-item-label-style"><?extend?>
|
|
910
|
+
<xsl:if test="parent::mn:ul">
|
|
911
|
+
<xsl:if test="count(ancestor::mn:ul) mod 4 = 1">
|
|
912
|
+
<xsl:attribute name="font-size">90%</xsl:attribute>
|
|
913
|
+
<xsl:attribute name="color"><xsl:value-of select="$logo_red"/></xsl:attribute>
|
|
914
|
+
<xsl:copy-of select="@font-size"/>
|
|
915
|
+
<xsl:copy-of select="@color"/>
|
|
916
|
+
</xsl:if>
|
|
917
|
+
<xsl:if test="count(ancestor::mn:ul) mod 4 = 2">
|
|
918
|
+
<xsl:attribute name="color"><xsl:value-of select="$logo_blue"/></xsl:attribute>
|
|
919
|
+
<xsl:copy-of select="@color"/>
|
|
920
|
+
</xsl:if>
|
|
921
|
+
<xsl:if test="count(ancestor::mn:ul) mod 4 = 3">
|
|
922
|
+
<xsl:attribute name="font-size">110%</xsl:attribute>
|
|
923
|
+
<xsl:attribute name="color"><xsl:value-of select="$logo_green"/></xsl:attribute>
|
|
924
|
+
<xsl:copy-of select="@font-size"/>
|
|
925
|
+
<xsl:copy-of select="@color"/>
|
|
926
|
+
</xsl:if>
|
|
927
|
+
<xsl:if test="count(ancestor::mn:ul) mod 4 = 0">
|
|
928
|
+
<xsl:attribute name="color"><xsl:value-of select="$logo_yellow"/></xsl:attribute>
|
|
929
|
+
<xsl:copy-of select="@color"/>
|
|
930
|
+
</xsl:if>
|
|
931
|
+
</xsl:if>
|
|
932
|
+
</xsl:template>
|
|
933
|
+
|
|
919
934
|
</xsl:stylesheet>
|
data/lib/metanorma/taste/base.rb
CHANGED
|
@@ -145,6 +145,7 @@ module Metanorma
|
|
|
145
145
|
# Add attributes from different sources
|
|
146
146
|
add_file_based_overrides(override_attrs)
|
|
147
147
|
add_base_configuration_overrides(override_attrs, attrs)
|
|
148
|
+
add_bibliography_sort_overrides(override_attrs)
|
|
148
149
|
apply_doctype_overrides(attrs, override_attrs)
|
|
149
150
|
apply_stage_overrides(attrs, override_attrs)
|
|
150
151
|
apply_committee_overrides(attrs, override_attrs)
|
|
@@ -254,6 +255,19 @@ module Metanorma
|
|
|
254
255
|
end
|
|
255
256
|
end
|
|
256
257
|
|
|
258
|
+
# Emit the publisher bibliography sort order as
|
|
259
|
+
# :sort-biblio-<abbrev>: <rank>: <name> document attributes, one per
|
|
260
|
+
# configured publisher. The shared Metanorma::Standoc::Ref sort helpers
|
|
261
|
+
# read these to override the base flavour's built-in publisher ranking.
|
|
262
|
+
def add_bibliography_sort_overrides(override_attrs)
|
|
263
|
+
items = @config.base_override&.bibliography_sort or return
|
|
264
|
+
items.each do |item|
|
|
265
|
+
item.abbrev.to_s.empty? and next
|
|
266
|
+
override_attrs <<
|
|
267
|
+
":sort-biblio-#{item.abbrev}: #{item.rank}: #{item.name}"
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
257
271
|
# If config base attribute already appears as a document attribute,
|
|
258
272
|
# and expect it to be additive, add the old value before the config value
|
|
259
273
|
def add_base_configuration_additive(config_key, attr_key, attrs)
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
require "lutaml/model"
|
|
4
4
|
require_relative "filename_attributes"
|
|
5
5
|
require_relative "value_attributes"
|
|
6
|
+
require_relative "biblio_sort_item"
|
|
6
7
|
|
|
7
8
|
module Metanorma
|
|
8
9
|
module Taste
|
|
@@ -11,10 +12,12 @@ module Metanorma
|
|
|
11
12
|
class BaseOverride < Lutaml::Model::Serializable
|
|
12
13
|
attribute :filename_attributes, FilenameAttributes
|
|
13
14
|
attribute :value_attributes, ValueAttributes
|
|
15
|
+
attribute :bibliography_sort, BiblioSortItem, collection: true
|
|
14
16
|
|
|
15
17
|
key_value do
|
|
16
18
|
map "filename-attributes", to: :filename_attributes
|
|
17
19
|
map "value-attributes", to: :value_attributes
|
|
20
|
+
map "bibliography-sort", to: :bibliography_sort
|
|
18
21
|
end
|
|
19
22
|
end
|
|
20
23
|
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "lutaml/model"
|
|
4
|
+
|
|
5
|
+
module Metanorma
|
|
6
|
+
module Taste
|
|
7
|
+
# Model for a single publisher bibliography sort-rank entry. A taste lists
|
|
8
|
+
# these to override the base flavour's built-in publisher sort order for the
|
|
9
|
+
# bibliography (e.g. OIML ranks OIML ahead of ISO/IEC). Each entry compiles
|
|
10
|
+
# to a :sort-biblio-<abbrev>: <rank>: <name> document attribute, consumed by
|
|
11
|
+
# the shared Metanorma::Standoc::Ref sort helpers.
|
|
12
|
+
class BiblioSortItem < Lutaml::Model::Serializable
|
|
13
|
+
attribute :abbrev, :string
|
|
14
|
+
attribute :name, :string
|
|
15
|
+
attribute :rank, :integer
|
|
16
|
+
|
|
17
|
+
key_value do
|
|
18
|
+
map "abbrev", to: :abbrev
|
|
19
|
+
map "name", to: :name
|
|
20
|
+
map "rank", to: :rank
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -15,12 +15,14 @@ module Metanorma
|
|
|
15
15
|
# @param attrs [Array<String>] The attributes array (modified in place)
|
|
16
16
|
# @param override_attrs [Array<String>] Array to append override attributes to
|
|
17
17
|
def apply_stage_overrides(attrs, override_attrs)
|
|
18
|
+
add_valid_stages_attribute(override_attrs)
|
|
18
19
|
stage_index = find_stage_attribute_index(attrs)
|
|
19
20
|
stage_index ||= insert_default_stage(attrs)
|
|
20
21
|
return unless stage_index
|
|
21
22
|
|
|
22
23
|
current_stage = extract_stage_value(attrs[stage_index])
|
|
23
|
-
stage_config = find_stage_configuration(current_stage)
|
|
24
|
+
stage_config = find_stage_configuration(current_stage) ||
|
|
25
|
+
fallback_stage_configuration(current_stage)
|
|
24
26
|
return unless stage_config
|
|
25
27
|
|
|
26
28
|
# Transform the stage attribute
|
|
@@ -30,6 +32,40 @@ module Metanorma
|
|
|
30
32
|
add_stage_specific_overrides(override_attrs, stage_config)
|
|
31
33
|
end
|
|
32
34
|
|
|
35
|
+
# Advertise the base stages this taste can emit, as the
|
|
36
|
+
# :docstage-valid: document attribute: when a taste defines
|
|
37
|
+
# stages, its repertoire supersedes the base flavour's for stage
|
|
38
|
+
# validation (the flavour would otherwise warn about the mapped
|
|
39
|
+
# base stages as unrecognised).
|
|
40
|
+
#
|
|
41
|
+
# @param override_attrs [Array<String>] Array to append override attributes to
|
|
42
|
+
def add_valid_stages_attribute(override_attrs)
|
|
43
|
+
bases = @config.stages&.map(&:base)&.compact&.uniq
|
|
44
|
+
bases.nil? || bases.empty? and return
|
|
45
|
+
override_attrs << ":docstage-valid: #{bases.join(',')}"
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# A stage not in the taste's repertoire: the taste's stages
|
|
49
|
+
# supersede the base flavour's, so warn and fall back to the
|
|
50
|
+
# taste's default stage (nil if none is flagged default, in which
|
|
51
|
+
# case the unknown stage passes through unchanged).
|
|
52
|
+
#
|
|
53
|
+
# @param current_stage [String] The unrecognised input stage
|
|
54
|
+
# @return [StageConfig, nil] The default stage configuration
|
|
55
|
+
def fallback_stage_configuration(current_stage)
|
|
56
|
+
@config.stages.nil? || @config.stages.empty? and return nil
|
|
57
|
+
warn_unrecognised_stage(current_stage)
|
|
58
|
+
@config.stages.detect { |dt| dt.default == "true" }
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Kernel#warn, not Metanorma::Util.log: the latter goes to stdout
|
|
62
|
+
# and only when Metanorma.configuration.logs opts into :warning,
|
|
63
|
+
# which would silently swallow a validation warning.
|
|
64
|
+
def warn_unrecognised_stage(stage)
|
|
65
|
+
warn "[metanorma-taste] WARNING: #{stage} is not a recognised " \
|
|
66
|
+
"status for taste #{@flavor}; reverting to default stage"
|
|
67
|
+
end
|
|
68
|
+
|
|
33
69
|
# Find the index of the stage attribute in the attributes array
|
|
34
70
|
#
|
|
35
71
|
# @param attrs [Array<String>] The attributes array
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-taste
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -128,6 +128,7 @@ files:
|
|
|
128
128
|
- lib/metanorma/taste.rb
|
|
129
129
|
- lib/metanorma/taste/base.rb
|
|
130
130
|
- lib/metanorma/taste/base_override.rb
|
|
131
|
+
- lib/metanorma/taste/biblio_sort_item.rb
|
|
131
132
|
- lib/metanorma/taste/committee.rb
|
|
132
133
|
- lib/metanorma/taste/committee_config.rb
|
|
133
134
|
- lib/metanorma/taste/doctype.rb
|