relaton-render 0.4.2 → 3.0.0.pre.alpha.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +6 -1
  3. data/.github/workflows/release.yml +24 -0
  4. data/.gitignore +14 -0
  5. data/.rubocop.yml +2 -2
  6. data/Gemfile +17 -1
  7. data/README.adoc +13 -258
  8. data/docs/citation-style-pack.adoc +370 -0
  9. data/lib/relaton/render/general.rb +305 -0
  10. data/lib/relaton/render/iso690/element.rb +153 -0
  11. data/lib/relaton/render/iso690/elements/access.rb +44 -0
  12. data/lib/relaton/render/iso690/elements/authorizer.rb +30 -0
  13. data/lib/relaton/render/iso690/elements/citeid.rb +39 -0
  14. data/lib/relaton/render/iso690/elements/component_part.rb +99 -0
  15. data/lib/relaton/render/iso690/elements/creator.rb +258 -0
  16. data/lib/relaton/render/iso690/elements/edition.rb +92 -0
  17. data/lib/relaton/render/iso690/elements/extent.rb +71 -0
  18. data/lib/relaton/render/iso690/elements/identifier.rb +46 -0
  19. data/lib/relaton/render/iso690/elements/location.rb +73 -0
  20. data/lib/relaton/render/iso690/elements/medium.rb +32 -0
  21. data/lib/relaton/render/iso690/elements/numeration.rb +26 -0
  22. data/lib/relaton/render/iso690/elements/production.rb +92 -0
  23. data/lib/relaton/render/iso690/elements/pub_date.rb +56 -0
  24. data/lib/relaton/render/iso690/elements/series.rb +66 -0
  25. data/lib/relaton/render/iso690/elements/size.rb +41 -0
  26. data/lib/relaton/render/iso690/elements/status.rb +30 -0
  27. data/lib/relaton/render/iso690/elements/stddoc.rb +40 -0
  28. data/lib/relaton/render/iso690/elements/title.rb +56 -0
  29. data/lib/relaton/render/iso690/elements/updated.rb +38 -0
  30. data/lib/relaton/render/iso690/elements.rb +67 -0
  31. data/lib/relaton/render/iso690/fields.rb +142 -0
  32. data/lib/relaton/render/iso690/i18n/en.yml +47 -0
  33. data/lib/relaton/render/iso690/i18n/fr.yml +14 -0
  34. data/lib/relaton/render/iso690/i18n/ja.yml +38 -0
  35. data/lib/relaton/render/iso690/i18n.rb +83 -0
  36. data/lib/relaton/render/iso690/identifier_kinds.rb +29 -0
  37. data/lib/relaton/render/iso690/index_renderer.rb +57 -0
  38. data/lib/relaton/render/iso690/kinds.rb +53 -0
  39. data/lib/relaton/render/iso690/renderer.rb +148 -0
  40. data/lib/relaton/render/iso690/rules.rb +36 -0
  41. data/lib/relaton/render/iso690/style/locale.rb +53 -0
  42. data/lib/relaton/render/iso690/style/name_form.rb +87 -0
  43. data/lib/relaton/render/iso690/style/scheme.rb +33 -0
  44. data/lib/relaton/render/iso690/style/sort_rule.rb +25 -0
  45. data/lib/relaton/render/iso690/style/template_map.rb +40 -0
  46. data/lib/relaton/render/iso690/style/type_template.rb +37 -0
  47. data/lib/relaton/render/iso690/style.rb +222 -0
  48. data/lib/relaton/render/iso690/styles/apa.yml +45 -0
  49. data/lib/relaton/render/iso690/styles/author-date.yml +31 -0
  50. data/lib/relaton/render/iso690/styles/chicago.yml +48 -0
  51. data/lib/relaton/render/iso690/styles/ieee-sa.yml +45 -0
  52. data/lib/relaton/render/iso690/styles/lncs.yml +54 -0
  53. data/lib/relaton/render/iso690/template.rb +248 -0
  54. data/lib/relaton/render/iso690.rb +27 -0
  55. data/lib/relaton/render/version.rb +1 -1
  56. data/lib/relaton-render.rb +11 -5
  57. data/relaton-render.gemspec +6 -13
  58. metadata +61 -116
  59. data/lib/isodoc/i18n.rb +0 -33
  60. data/lib/isodoc-yaml/i18n-ar.yaml +0 -44
  61. data/lib/isodoc-yaml/i18n-de.yaml +0 -43
  62. data/lib/isodoc-yaml/i18n-en.yaml +0 -40
  63. data/lib/isodoc-yaml/i18n-es.yaml +0 -47
  64. data/lib/isodoc-yaml/i18n-fr.yaml +0 -48
  65. data/lib/isodoc-yaml/i18n-ru.yaml +0 -51
  66. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +0 -40
  67. data/lib/relaton/render/fields/date.rb +0 -45
  68. data/lib/relaton/render/fields/fields.rb +0 -245
  69. data/lib/relaton/render/general/citations.rb +0 -96
  70. data/lib/relaton/render/general/config.yml +0 -79
  71. data/lib/relaton/render/general/render.rb +0 -185
  72. data/lib/relaton/render/general/render_classes.rb +0 -129
  73. data/lib/relaton/render/parse/parse.rb +0 -64
  74. data/lib/relaton/render/parse/parse_contributors.rb +0 -132
  75. data/lib/relaton/render/parse/parse_extract.rb +0 -180
  76. data/lib/relaton/render/template/liquid.rb +0 -15
  77. data/lib/relaton/render/template/template.rb +0 -188
  78. data/lib/relaton/render/utils/utils.rb +0 -27
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c21e6af4c8c19084d12c883fcc12ec4828965563d84eefa9ad3776fbd4997bf6
4
- data.tar.gz: df7f7dbbc98ac5de46e904cc572d9ed131921ec7b6418e3080e5115a69ab0647
3
+ metadata.gz: e2d52f05f42c17071799e1cc19e71d0b84f84a0550430d287e4d8cf4dee389a6
4
+ data.tar.gz: 4170319d650b7d3de48553d5fcddb15857b24939e9a6e008d7f74c095f849f60
5
5
  SHA512:
6
- metadata.gz: 2d0a91b6196e46b51e2aa88dd923608b885ecc369e63e56bc16fd90d5458f3300c8017d73f0524ecb32b7d811d391be0da4778649559df8a0f540b85150baf4e
7
- data.tar.gz: aa14c96d47a1b354c26dd4b99df07c334dd9404f8faf04bd7686d3071b85cc0d0769a81976d8ae83846d5334a4c36fa02a3ef0e5d66f152a80dc6ba66d5b960f
6
+ metadata.gz: 021e4859ac3ba1f2dda762db881d1322677578359dc0f9a7c319435d7692a36fb6dcc1b96b9b068ca3ed65f9a621648da698962e49d2d2b132adbf5ea2ee66ff
7
+ data.tar.gz: ad7e119b111cac93e1c70fd0af76431a33dc9e95a5508ca866ab556c7b7e3484e7ae31c1981778f2a86ad6c35ba5ecfdfee9799b2a8c1e21480184f81915bc98
@@ -8,6 +8,11 @@ on:
8
8
  tags: [ v* ]
9
9
  pull_request:
10
10
 
11
+ permissions:
12
+ contents: write
13
+
11
14
  jobs:
12
15
  rake:
13
- uses: relaton/support/.github/workflows/rake.yml@master
16
+ uses: metanorma/ci/.github/workflows/generic-rake.yml@main
17
+ secrets:
18
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -0,0 +1,24 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch (or pre|rc|etc).
11
+ Also, you can pass 'skip' to skip 'git tag' and do 'gem push' for the current version
12
+ required: true
13
+ default: 'skip'
14
+ repository_dispatch:
15
+ types: [ do-release ]
16
+
17
+ jobs:
18
+ release:
19
+ uses: relaton/support/.github/workflows/release.yml@main
20
+ with:
21
+ next_version: ${{ github.event.inputs.next_version }}
22
+ secrets:
23
+ rubygems-api-key: ${{ secrets.RELATON_CI_RUBYGEMS_API_KEY }}
24
+
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ Gemfile.lock
13
+ .vscode/
14
+ bin/rspec
data/.rubocop.yml CHANGED
@@ -1,10 +1,10 @@
1
1
  # Auto-generated by Cimas: Do not edit it manually!
2
2
  # See https://github.com/metanorma/cimas
3
3
  inherit_from:
4
- - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
4
+ - https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
5
5
 
6
6
  # local repo-specific modifications
7
7
  # ...
8
8
 
9
9
  AllCops:
10
- TargetRubyVersion: 2.5
10
+ TargetRubyVersion: 3.4
data/Gemfile CHANGED
@@ -3,6 +3,22 @@ Encoding.default_internal = Encoding::UTF_8
3
3
 
4
4
  source "https://rubygems.org"
5
5
 
6
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
7
7
 
8
8
  gemspec
9
+
10
+ group :development, :test do
11
+ gem "canon"
12
+ gem "relaton", ">= 3.0.0.pre.alpha", "< 4" # the model fixtures; the engine itself is model-agnostic
13
+ gem "debug"
14
+ gem "iso-690-test-suite", github: "relaton/iso-690-test-suite"
15
+ gem "rake", ">= 12.3.3"
16
+ gem "rspec", "~> 3.0"
17
+ gem "simplecov"
18
+ end
19
+
20
+ begin
21
+ eval_gemfile("Gemfile.devel")
22
+ rescue StandardError
23
+ nil
24
+ end
data/README.adoc CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  image:https://img.shields.io/gem/v/relaton-render.svg["Gem Version", link="https://rubygems.org/gems/relaton-render"]
4
4
  image:https://github.com/metanorma/relaton-render/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/relaton-render/actions?workflow=rake"]
5
- image:https://codeclimate.com/github/metanorma/relaton-render/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-render"]
5
+ // image:https://codeclimate.com/github/metanorma/relaton-render/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/relaton-render"]
6
6
 
7
7
  Gem that takes a https://github.com/relaton/relaton[Relaton] bibliographic description and
8
8
  a configuration, and generates a https://www.metanorma.org[Metanorma] XML rendering of that description.
@@ -35,9 +35,9 @@ The gem processes either Relaton XML, or native Relaton classes.
35
35
  The gem is intended to be inherited from by Metanorma flavours, which may specialise it with their own
36
36
  code. The templates are however intended to determine much of the rendering.
37
37
 
38
- Gems can provide their configurations in YAML files, and parse them before passing them to the call to Iso690Render.
39
- The built-in values for Iso690Render are given in `/lib/iso690render/config.yml`, and can be overridden by
40
- the parameters of initialising Iso690Render.
38
+ Gems can provide their configurations in YAML files, and parse them before passing them to the call to Relaton::Render.
39
+ The built-in values for Relaton::Render are given in `/lib/relaton/render/general/config.yml`, and can be overridden by
40
+ the parameters of initialising Relaton::Render.
41
41
 
42
42
  The parameters are:
43
43
 
@@ -70,7 +70,8 @@ author and date. It should not be used for rendering of references aligned to th
70
70
  Given a collection of Relaton bibitem objects (or equivalent Relaton XML, wrapped in `<references>`),
71
71
  `render_all(bibliography, type: type)`
72
72
  will output a hash of objects, with information to be used both for rendering references, and for generating citations.
73
- This method addresses the disambiguation of citiations, and changes to rendering of references reflecting that disambiguation.
73
+ This method addresses the disambiguation of citations, and changes to rendering of references reflecting that disambiguation
74
+ (e.g. differentiating two works with the same wuthor surname and year: _Jones 1996a_ and _Jones 1996b_).
74
75
  For that reason, this method should be used for references using the author-date citation system.
75
76
 
76
77
  The `type` argument of `render_all` reflects the citation system to be used.
@@ -90,261 +91,15 @@ if called with `type: "author-date"`.
90
91
  The author and date are differentiated so that consumers can separate them in citations -- e.g. "Jones (1996) claims",
91
92
  "(Jones 1996, 1997)".
92
93
 
93
- == Configuration
94
-
95
- === Templates
96
-
97
- There is one template provided for each of the bibliographic types recognised by Relaton (`/bibitem/@type`), and a default template:
98
-
99
- Currently supported:
100
-
101
- * article
102
- * book
103
- * booklet
104
- * manual
105
- * proceedings
106
- * presentation
107
- * thesis
108
- * techreport
109
- * standard
110
- * unpublished
111
- * electronic resource
112
- * inbook
113
- * incollection
114
- * inproceedings
115
- * journal
116
- * website
117
- * webresource
118
- * dataset
119
-
120
- Not currently supported:
121
-
122
- * map
123
- * audiovisual
124
- * film
125
- * video
126
- * broadcast
127
- * software
128
- * graphic_work
129
- * music
130
- * performance
131
- * patent
132
- * archival
133
- * social_media
134
- * alert
135
- * message
136
- * conversation
137
- * misc (default)
138
-
139
-
140
- In Metanorma, not all types are used, but there are exemplars for all of these given on this site, following
141
- the human-readable style used in ISO 690. These can be overridden by supplying corresponding paramerers in the call
142
- to initialise Iso690Render.
143
-
144
- Each `template` is a string marked up with https://shopify.github.io/liquid/[Liquid Markup], with the following fields
145
- drawn from the bibliographic item:
146
-
147
- |===
148
- | Field | Relaton XPath | Multiple | Can come from host | Note
149
-
150
- | title | ./title | | |
151
- | edition | ./edition | | Y | If numeric value, is given internationalised rendering of "nth edition", as set in edition_numbering. Otherwise, the textual content of the tag is given.
152
- | edition_raw | ./edition | | Y | The strict textual content of the tag is given.
153
- | edition_num | ./edition[@number] | | Y |
154
- | medium | ./medium | | Y |
155
- | place | ./place | | Y |
156
- | publisher | ./contributor[role/@type = 'publisher']/organization/name | | Y |
157
- | distributor | ./contributor[role/@type = 'distributor']/organization/name | | Y |
158
- | standardidentifier | ./docidentifier[not(@type = 'metanorma' or @type = 'ordinal')] | Y | |
159
- | status | ./status | | | Rendering varies by flavour
160
- | uri | ./uri[@type = 'doi' or @type = 'uri' or @type = 'src' or true] | | |
161
- | access_location | ./accessLocation | | Y |
162
- | extent | ./extent | Y | | Render with standard abbreviations for pp, vols, with n-dash, with delimiting of multiple locations
163
- | creatornames | ./contributor[role/@type = 'author'] \| ./contributor[role/@type = 'performer'] \| ./contributor[role/@type = 'adapter'] \| ./contributor[role/@type = 'translator'] \| ./contributor[role/@type = 'editor'] \| ./contributor[role/@type = 'publisher'] \| ./contributor[role/@type = 'distributor'] \| ./contributor | Y | | <<nametemplate,`nametemplate`>> applied to each name; joining template from internationalisation applied to multiple names
164
- | authorcite | ./contributor[role/@type = 'author'] \| ./contributor[role/@type = 'performer'] \| ./contributor[role/@type = 'adapter'] \| ./contributor[role/@type = 'translator'] \| ./contributor[role/@type = 'editor'] \| ./contributor[role/@type = 'publisher'] \| ./contributor[role/@type = 'distributor'] \| ./contributor | Y | | <<authorcitetemplate,`authorcitetemplate`>> applied to each name; joining template from internationalisation applied to multiple names
165
- | role | ./contributor[role/description] \| ./contributor[role/@type] | | |
166
- | date | ./date[@type = 'issued'] \| ./date[@type = 'circulated'] \| ./date | | Y |
167
- | date_updated | ./date[@type = 'updated'] | | Y |
168
- | date_accessed | ./date[@type = 'accessed'] | | Y |
169
- | series | ./series[@type = 'main' or not(@type) or true] | | Y | <<seriestemplate,`seriestemplate`>> applies to series
170
- | host_creatornames | ./relation[@type = 'includedIn']/ bibitem/contributor[role/@type = 'author'] | | Y | Follows options for `creatornames`
171
- | host_title | ./relation[@type = 'includedIn']/ bibitem/title | Y | Y | Follows options for `creatornames`
172
- | host_role | ./relation[@type = 'includedIn']/ bibitem/contributor[role/description] \| ./relation[@type = 'includedIn']/ bibitem/contributor[role/@type] | | Y |
173
- | type | ./@type | |
174
- | labels | | | text to be looked up in internationalisation configuration files: "edition", "In", "At", "Vol", "Vols", "p.", "pp"
175
- |===
176
-
177
- Missing dates and places of publication are rendered as "n.d." and "n.p." or the equivalent internationalisation (`no_date`, `no_place` in the internationalisation YAML files.) However, missing dates are left as nil in standards, as undated standards indicate that the citation applies to the latest version of the standard, and not that the date is unknown.
178
-
179
- Many fields are populated either by the description of the bibliographic item itself, or by the description of the item containing it (the _host_ item: `./relation[@type = 'includedIn']/bibitem`). For example, in a paper included in an edited volume, the edition will typically be given for the editor volume, rather than for the paper. Those fields are indicated by "Can come from host" in the table.
180
-
181
- The Liquid templates use the filters defined in Liquid, such as `upcase`. We have defined some custom filters:
182
-
183
- * `capitalize_first` capitalises only the first word in a string, and does not lowercase other words in the string. So "third edition" becomes "Third edition", but "3. Aufl." does not become "3. aufl."
184
-
185
- The Liquid template surrounds each field by preceding and following punctuation.
186
-
187
- * Fields are space-delimited. So `<em>{{ title }}</em> [{{medium}}]` are two separate fields.
188
- * If fields are not space-delimited, this is indicated by inserting `|`. So `{{ title }}|{{ medium}}` is two fields, rendered with no space separation.
189
- * If the field is empty, its surrounding markup is also removed. So if there is no medium, then `[{{medium}}]` is not rendered, and the brackets will be stripped.
190
- * Underscore is treated as space, attaching to the preceding or following field. So `,_{{ edition }}_{{ labels['edition'] }}` is treated as the one field.
191
- * Underscore is escaped by \. So `<span_class="std\_note">` maps to `<span class="std_note">`.
192
- * If punctuation is space delimited, it is inserted regardless of preceding content. So `{{ creatornames }} ({{date}}) .` will insert the full stop whether or not the date is present.
193
- * Space between punctuation and before punctuation is automatically removed.
194
-
195
- For example:
196
-
197
- ....
198
- "{{ creatornames }} ({{date}}) . <em>{{ title }}</em> [{{medium}}] ,_{{ edition }}_{{ labels['edition'] }} ."
199
- ....
200
-
201
- If a type uses another type's template, the type is mapped to the other type's name; e.g.
202
-
203
- ....
204
- template:
205
- book: ...
206
- booklet: book
207
- ....
208
-
209
- [[nametemplate]]
210
- === Name templates
211
-
212
- The `nametemplate` is a hash of Liquid templates for the formatting of contributor names in particular positions. It
213
- draws on the following fields drawn from the bibliographic item:
214
-
215
- |===
216
- | Field | Relaton XPath | Multiple | Note
217
-
218
- | surname[0] | ./contributor[1]/person/name/surname \| ./contributor[1]/person/name/completename | | i.e. surname is the name default
219
- | surname[1] | ./contributor[2]/name/surname | |
220
- | surname[2] | ./contributor[3]/name/surname | |
221
- | initials[0] | ./contributor[1]/name/initial | | If not supplied, the first letter of each given name is used instead
222
- | initials[1] | ./contributor[2]/name/initial | |
223
- | given[0] | ./contributor[1]/name/forename[1] | | If not supplied, initials are used instead
224
- | given[1] | ./contributor[2]/name/forename[1] | |
225
- | middle[0] | ./contributor[1]/name/forename[not(first())] | Y |
226
- | middle[1] | ./contributor[2]/name/forename[not(first())] | Y |
227
- | nonpersonal[0] |./contributor[1]/organization/name | Y |
228
- | nonpersonal[1] |./contributor[2]/organization/name | Y |
229
- |===
230
-
231
- There are at least three distinct `nametemplate` instances that need to be provided, one for a single contributor (`one:`), one for two contributors (`two:`), one for three or more (`more:`), and optionally one for "et al." (`etal:`). The number of contributors for which "et al." starts being used is indicated by `etal_count`.
232
-
233
- For example:
234
- ....
235
- {
236
- one: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{ surname[0] }}, {{ given[0] }} {{ middle[0] | slice : 0 }}{% endif %}",
237
- two: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{ surname[0] }}, {{ given[0] }} {{ middle[0] | slice : 0 }}{% endif %} &amp; {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{ given[1] }} {{ middle[1] | slice : 0 }} {{ surname[1] }}{% endif %}",
238
- more: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{ surname[0] }}, {{ given[0] }} {{ middle[0] | slice : 0 }}{% endif %}, {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{ given[1] }} {{ middle[1] | slice : 0 }} {{ surname[1] }}{% endif %} &amp; {% if nonpersonal[2] %}{{ nonpersonal[2] }}{% else %}{{ given[2] }} {{ middle[2] | slice : 0 }} {{ surname[2] }}{% endif %}",
239
- etal: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{ surname[0] }}, {{ given[0] }} {{ middle[0] | slice : 0 }}{% endif %}, {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{ given[1] }} {{ middle[1] | slice : 0 }} {{ surname[1] }}{% endif %} <em>et al.</em>",
240
- etal_count: 6
241
- }
242
- ....
243
-
244
- In the case of `more`, the `(name)[1]` entries are repeated for all additional authors above 2 and before the final author.
245
-
246
- [[authorcitetemplate]]
247
- === Author citation templates
94
+ === Parsing single reference
248
95
 
249
- The `authorcitetemplate` is a subclass of the name template, configured for rendering author names for author-date citations.
250
- That means that it typically selects only surnames for rendering.
96
+ Given an Relaton bibitem object (or equivalent Relaton XML), `parse(input)` will output the hash of fields that is passed into the
97
+ Liquid templates described below for rendering: it is the hash of bibliographic fields extracted by the gem.
251
98
 
252
- [[seriestemplate]]
253
- === Series template
254
-
255
- The `seriestemplate` is a template for the rendering of series information. It draws on the following fields drawn from the bibliographic item:
256
-
257
- |===
258
- | Field | Relaton XPath | Multiple | Can come from host | Note
259
-
260
- | series_title | ./series[@type = 'main' or not(@type) or true]/name | | Y |
261
- | series_abbr | ./series[@type = 'main' or not(@type) or true]/abbreviation | | Y |
262
- | series_num | ./series[@type = 'main' or not(@type) or true]/number | | Y |
263
- | series_partnumber | ./series[@type = 'main' or not(@type) or true]/partnumber | | Y |
264
- | series_run | ./series[@type = 'main' or not(@type) or true]/run | | Y |
265
- |===
266
-
267
- For example: `{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %} ,_({{series_run}}) {{series_num}}|({{series_partnumber}})`
268
-
269
- === Journal template
270
-
271
- The `journaltemplate` is a template for the rendering of series information, when they relate to articles in a journal. The template is distinct because of longstanding practice of rendering journal information differently from monograph series information. The template draws on the same fields as the `seriestemplate`, but because the journal title is typically italicised and the numeration is not, any italicisation needs to occur within the template.
272
-
273
- For example, the recommended practice in the current edition of ISO 690 is to give explicit volume labels:
274
-
275
- `<em>{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %}</em> {{ labels['volume'] }}_{{series_num}} {{ labels['part'] }}_{{series_partnumber}}`
276
-
277
- A common template that drops those labels is:
278
-
279
- `<em>{% if series_abbr %}{{series_abbr}}{% else %}{{series_title}}{% endif %}</em> {{series_num}}|({{series_partnumber}})`
280
-
281
- === Extent template
282
-
283
- The extent of a bibliographic item may be expressed differently depending on the type of bibliographic item. For example, the extent of a book chapter may be expressed as _pp. 9–20_, while the extent of an article may be expressed as just _9–20_.
284
-
285
- To capture this, a separate template is supplied under `extenttemplate` for each bibliographic item type. For those types where none is supplied, the template given for `misc` is used as the default.
286
-
287
- The template draws on the defined types of locality of extents; the most common of these is `volume`, `issue` (within volume; "number" for journals), and `page`. Locality types are the fields used in the Liquid templates; for example:
288
-
289
- ....
290
- {
291
- article: "{{ volume_raw }}|({{ issue_raw }}) : {{ page_raw }}"
292
- misc: "{{ volume }}, {{ page }}"
293
- }
294
- ....
295
-
296
- The internationalisation files define a singular and a plural version of the locality types, under `labels['extent']`.
297
-
298
- * The plural label is always used if the extent is a range (with a `<from>` and `<to>`).
299
- * The singular label is used if the extent is not a range (_pp. 2–4_ vs. _p. 3_).
300
- * The internationalisation files include a slot where the number or number range is inserted, indicated by `%`, since this varies by language. (For instance, English has `pp. %`, whereas Chinese has `第%页`.)
301
- * The number of the volume, issue/number, or page, without accompanying labels, is given in `volume_raw`, `issue_raw`, and `page_raw`.
302
-
303
- === Size template
304
-
305
- The size of a bibliographic item is distinct from the extent: the size is how large the item is (e.g. how many pages are in the book), whereas the extent is how much of the host item the item covers (e.g. which pages of the book are in the current chapter.) They can be displayed quite differently from extent; for example, while extent pages is given in English as _pp. 9–20_ or _p. 3_, size pages is given as _3 pp._.
306
-
307
- To capture this, a separate template is supplied under `sizetemplate` for each bibliographic item type. Again, for those types where none is supplied, the template given for `misc` is used as the default.
308
-
309
- The template draws on the defined types of locality of extents; the following are currently recognised:
310
-
311
- |===
312
- | Field | Relaton XPath | Note
313
-
314
- | volume | ./medium/size[@type = 'volume'] | With internationalisation of label
315
- | volume_raw | ./medium/size[@type = 'volume'] |
316
- | issue | ./medium/size[@type = 'issue'] | With internationalisation of label
317
- | issue_raw | ./medium/size[@type = 'issue'] |
318
- | page | ./medium/size[@type = 'page'] | With internationalisation of label
319
- | page_raw | ./medium/size[@type = 'page'] |
320
- | data | ./medium/size[@type = 'data'] | Unit of size is included in value
321
- | duration | ./medium/size[@type = 'time'] | Expressed in ISO 8601 duration
322
- |===
323
-
324
-
325
- Locality types are the fields used in the Liquid templates; for example:
326
-
327
- ....
328
- {
329
- dataset: "{{ data }}"
330
- misc: "{{ volume }}, {{ page }}, {{ data }}, {{ duration }}"
331
- }
332
- ....
333
-
334
- The internationalisation files define a singular and a plural version of the locality types, under `labels['size']`.
335
-
336
- * The plural label is always used if the extent is a range (with a `<from>` and `<to>`).
337
- * The label is singular only if the value is `1`, else it is plural (_1 p._, _2 pp._)
338
- * Again, the internationalisation files include a slot where the number or number range is inserted, since this varies by language.
339
- * The number of volumes or pages, without accompanying labels, is given in `volume_raw` and `page_raw`.
340
- * Multiple spans of the same type are joined by `+`; e.g. _xlii + 76 pp._.
99
+ == Configuration
341
100
 
342
- === Other
101
+ For the configuation YAML used in relaton-render, refer to https://relaton.org/specs/relaton-render
343
102
 
344
- In addition, the configuration includes different configuration options for rendering:
103
+ == Documentation
345
104
 
346
- The internationalisation file sets the following variables, which can be overridden in configuration parameters:
347
- `edition_number`:: has following values corresponding to the rule-based number rules defined in https://github.com/twitter/twitter-cldr-rb[Twitter CLDR].
348
- for a language. For example, English _4th_ is defined as `["OrdinalRules", "digits-ordinal"]`, because under twitter-cldr, `4th` is generated as `4.localize(:en).to_rbnf_s("OrdinalRules", "digits-ordinal")`. If missing, the raw number is given.
349
- `edition`:: is the localised expression for edition, with the edition number given as %. So _4th ed.` is generated with `edition` as `% ed.`.
350
- `date`:: date format default, taken from https://github.com/twitter/twitter-cldr-rb[Twitter CLDR]: `to_full_s`, `to_long_s`, `to_medium_s`, `to_short_s`, or one of the `to_additional_s` formats. One value is given for each of "month_year", "day_month_year", and "date_time"; e.g. `{ month_year: to_long_s, day_month_year: to_long_s, date_time: to_long_s }`.
105
+ * link:docs/citation-style-pack.adoc[Defining a Citation Style: the pack format] — the authoritative spec for CitationStyle YAML packs: resource types, presentation patterns, model presentation templates, locale/punctuation, inheritance and conformance.