metanorma-bsi 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of metanorma-bsi might be problematic. Click here for more details.

Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +43 -0
  3. data/.github/workflows/release_github_packages.yml +49 -0
  4. data/.hound.yml +3 -1
  5. data/.rubocop.yml +4 -8
  6. data/README.adoc +95 -11
  7. data/lib/asciidoctor/bsi/biblio.rng +1 -0
  8. data/lib/asciidoctor/bsi/bsi.rng +32 -4
  9. data/lib/asciidoctor/bsi/bsi_intro_en.xml +87 -61
  10. data/lib/asciidoctor/bsi/cleanup.rb +15 -8
  11. data/lib/asciidoctor/bsi/cleanup_ref.rb +10 -21
  12. data/lib/asciidoctor/bsi/converter.rb +7 -5
  13. data/lib/asciidoctor/bsi/front.rb +26 -5
  14. data/lib/asciidoctor/bsi/isodoc.rng +191 -3
  15. data/lib/asciidoctor/bsi/isostandard.rng +12 -0
  16. data/lib/asciidoctor/bsi/validate.rb +5 -6
  17. data/lib/asciidoctor/bsi/validate_list.rb +2 -2
  18. data/lib/isodoc/bsi/base_convert.rb +2 -1
  19. data/lib/isodoc/bsi/bsi.international-standard.xsl +3380 -2349
  20. data/lib/isodoc/bsi/html/htmlstyle.css +43 -22
  21. data/lib/isodoc/bsi/html/htmlstyle.scss +46 -22
  22. data/lib/isodoc/bsi/html_convert.rb +2 -2
  23. data/lib/isodoc/bsi/i18n-en.yaml +4 -4
  24. data/lib/isodoc/bsi/metadata.rb +2 -2
  25. data/lib/isodoc/bsi/presentation_xml_convert.rb +26 -5
  26. data/lib/isodoc/bsi/xref.rb +11 -4
  27. data/lib/metanorma/bsi/version.rb +1 -1
  28. data/metanorma-bsi.gemspec +2 -2
  29. data/spec/asciidoctor/base_spec.rb +564 -494
  30. data/spec/asciidoctor/blocks_spec.rb +192 -195
  31. data/spec/asciidoctor/cleanup_spec.rb +361 -361
  32. data/spec/asciidoctor/refs_spec.rb +8 -78
  33. data/spec/asciidoctor/section_spec.rb +227 -227
  34. data/spec/asciidoctor/validate_spec.rb +26 -1
  35. data/spec/isodoc/blocks_spec.rb +56 -21
  36. data/spec/isodoc/i18n_spec.rb +156 -234
  37. data/spec/isodoc/inline_spec.rb +7 -7
  38. data/spec/isodoc/iso_spec.rb +4 -4
  39. data/spec/isodoc/metadata_spec.rb +0 -1
  40. data/spec/isodoc/ref_spec.rb +7 -7
  41. data/spec/isodoc/section_spec.rb +400 -343
  42. data/spec/isodoc/terms_spec.rb +224 -225
  43. data/spec/isodoc/xref_spec.rb +1347 -1360
  44. data/spec/metanorma/processor_spec.rb +37 -40
  45. data/spec/spec_helper.rb +6 -4
  46. data/spec/vcr_cassettes/iso-639.yml +19 -19
  47. data/spec/vcr_cassettes/isobib_get_639_1967.yml +17 -17
  48. data/spec/vcr_cassettes/multistandard.yml +15 -193
  49. metadata +7 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b54389a2be552034efcc821b280f538ccc89c864463dffc9e06f78ca247211e4
4
- data.tar.gz: 735cd41f8f3af50fd6c5d135c33223a6a11934f0e338d4aa32c8de083ae359bd
3
+ metadata.gz: b5f5cd240589dac094e6cb8b4c5e3731946e938e8d19831cde6935324f7462cb
4
+ data.tar.gz: f40597a6694cdea8cd80a396732fd307f0f5710ec9a7d08d5121ee75207fe746
5
5
  SHA512:
6
- metadata.gz: 047b7a5c4e731a347f448a3206ec0cab50b071c5ef1338fbd86a9b81d27ca45e6a6d887286d745efd00bbc7757102149bf59b5456f79c703679cd8522dc16900
7
- data.tar.gz: 65d78de82e6bfaaca68d580675632eb18985136c9a2e35b20541201acd8441ea399959786350dc9c723c5773795b0944212f3c2c972c248359f52ed2cab15ed2
6
+ metadata.gz: 9b9d96a278e7207fa3f0c7b16a66ecef67df7e4df5db23965a1b2928e7cbb6441fbf2e675e7b2baa50c0e08bed032d3540b8717fa21fc70a00bd4aee477999ee
7
+ data.tar.gz: 3e16b74a696ed00ad6b9c792df0eda9250cbf5b4eb27456eebfb6e60a2676871acec9da80b14020a562c2ea307901f54293158d9cee0a495450637441decd639
@@ -0,0 +1,43 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ with:
25
+ submodules: true
26
+
27
+ - uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: ${{ matrix.ruby }}
30
+ bundler-cache: true
31
+
32
+ - run: bundle exec rake
33
+
34
+ tests-passed:
35
+ needs: rake
36
+ runs-on: ubuntu-latest
37
+ steps:
38
+ - uses: peter-evans/repository-dispatch@v1
39
+ with:
40
+ token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
41
+ repository: ${{ github.repository }}
42
+ event-type: tests-passed
43
+ client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
@@ -0,0 +1,49 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release-github-packages
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
+ required: true
12
+ default: 'skip'
13
+ push:
14
+ tags: [ v* ]
15
+
16
+ jobs:
17
+ release:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v2
21
+
22
+ - uses: ruby/setup-ruby@v1
23
+ with:
24
+ ruby-version: '2.6'
25
+ bundler-cache: true
26
+
27
+ - run: gem install gem-release
28
+
29
+ - run: |
30
+ git config user.name github-actions
31
+ git config user.email github-actions@github.com
32
+
33
+ - if: github.event_name == 'workflow_dispatch' && github.event.inputs.next_version != 'skip'
34
+ run: |
35
+ gem bump --version ${{ github.event.inputs.next_version }} --tag --push
36
+
37
+ - name: publish to GitHub Packages
38
+ env:
39
+ GITHUB_PACKAGES_TOKEN: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
40
+ run: |
41
+ envsubst << 'EOF' > ~/.gem/credentials
42
+ ---
43
+ :github: Bearer ${GITHUB_PACKAGES_TOKEN}
44
+ EOF
45
+ chmod 0600 ~/.gem/credentials
46
+ bundle exec rake build
47
+ # gem release - don't allow to execute rake tasks
48
+ # rake release - finished with ERROR: too many connection resets
49
+ gem push --key github --host https://rubygems.pkg.github.com/metanorma pkg/*.gem
data/.hound.yml CHANGED
@@ -1,3 +1,5 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
1
3
  ruby:
2
- Enabled: true
4
+ enabled: true
3
5
  config_file: .rubocop.yml
data/.rubocop.yml CHANGED
@@ -1,14 +1,10 @@
1
- # This project follows the Ribose OSS style guide.
2
- # https://github.com/riboseinc/oss-guides
3
- # All project-specific additions and overrides should be specified in this file.
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
4
3
  inherit_from:
5
4
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
6
5
 
7
6
  # local repo-specific modifications
7
+ # ...
8
8
 
9
9
  AllCops:
10
- DisplayCopNames: false
11
- StyleGuideCopsOnly: false
12
- TargetRubyVersion: 2.4
13
- Rails:
14
- Enabled: true
10
+ TargetRubyVersion: 2.5
data/README.adoc CHANGED
@@ -1,4 +1,4 @@
1
- = metanorma-BSI: Metanorma processor for the British Standards Institute
1
+ = metanorma-BSI: Metanorma processor for the British Standards Institution
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-bsi.svg["Gem Version", link="https://rubygems.org/gems/metanorma-bsi"]
4
4
  image:https://github.com/metanorma/metanorma-bsi/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-bsi/actions?workflow=rake"]
@@ -40,16 +40,12 @@ gem, and aligns closely to it.
40
40
 
41
41
  Please see https://www.metanorma.com for instructions to get started.
42
42
 
43
- If you are using a Mac, the https://github.com/metanorma/metanorma-macos-setup
44
- repository has instructions on setting up your machine to run Metanorma
45
- scripts such as this one. You need only run the following in a Terminal console:
43
+ You will need to setup your Git credentials for bundler or for HTTPS in order
44
+ to fetch the software. Please refer to the following articles for details:
46
45
 
47
- [source,console]
48
- ----
49
- $ bash <(curl -s https://raw.githubusercontent.com/metanorma/metanorma-macos-setup/master/metanorma-setup)
50
- $ gem install metanorma-cli
51
- $ gem install metanorma-bsi
52
- ----
46
+ * https://depfu.com/blog/2017/08/02/bundler-and-private-dependencies[Setting up bundler for private dependencies]
47
+ * https://bundler.io/v1.16/bundle_config.html#CREDENTIALS-FOR-GEM-SOURCES[Bundler credentials for gem sources]
48
+ * https://help.github.com/articles/caching-your-github-password-in-git[GitHub - Caching your GitHub credentials in Git]
53
49
 
54
50
 
55
51
  == Usage
@@ -79,7 +75,82 @@ See https://www.metanorma.com/author/iso/[Write ISO documents with Metanorma]
79
75
 
80
76
  Extensions specific to BSI:
81
77
 
82
- === Adoptiopn of standard
78
+ === Document types
79
+
80
+ The following document types are recognised in the `:doctype:` document attribute:
81
+
82
+ BSI document types::
83
+ +
84
+ --
85
+ * british-standard
86
+ * draft-for-development
87
+ * published-document
88
+ * privately-subscribed-standard
89
+ * publicly-available-specification
90
+ * flex-standard
91
+ --
92
+
93
+ Adoptable types, ISO ::
94
+ +
95
+ --
96
+ * international-standard
97
+ * technical-specification
98
+ * technical-report
99
+ * guide
100
+ * publicly-available-specification
101
+ * international-workshop-agreement
102
+ --
103
+
104
+
105
+ Adoptable types, IEC ::
106
+ +
107
+ --
108
+ * international-standard
109
+ * technical-specification
110
+ * technical-report
111
+ * industry-technical-agreement
112
+ --
113
+
114
+ Adoptable types, CEN and CENELEC ::
115
+ +
116
+ --
117
+ * standard
118
+ * technical-specification
119
+ * technical-report
120
+ * guide
121
+ * european-workshop-agreement
122
+ --
123
+
124
+ The following document types are recognised in the `:docsubtype:` document attribute:
125
+
126
+ * specification
127
+ * method-of-test
128
+ * method-of-specifying
129
+ * vocabulary
130
+ * code-of-practice
131
+
132
+
133
+ === Related BSI Standards
134
+
135
+ The frontispiece of BSI Standards includes text like the following:
136
+
137
+ ____
138
+ The following BSI references relate to the work on this document: +
139
+ Committee reference DEF/1 +
140
+ Draft for comment 20/30387670 DC
141
+ ____
142
+
143
+ This text is created by adding the BSI list of documents that the document relates to
144
+ as a semicolon-delimited list of references, using `:bsi-related:`:
145
+
146
+ [source,asciidoctor]
147
+ ----
148
+ :bsi-related: Committee reference DEF/1;Draft for comment 20/30387670 DC
149
+ ----
150
+
151
+ The introductory phrase is added automatically.
152
+
153
+ === Adoption of standard
83
154
 
84
155
  An adopted external standard is defined as `:adopted-from:`:
85
156
 
@@ -96,7 +167,20 @@ An adopted external standard is defined as `:adopted-from:`:
96
167
  :adopted-from: ISO 639-2
97
168
  ----
98
169
 
170
+ === Corrigenda
99
171
 
172
+ Corrigenda are specified by a prefatory clause, of type "corrigenda":
173
+
174
+ [source,asciidoctor]
175
+ ----
176
+ [.preface,type=corrigenda]
177
+ == Amendments/corrigenda issued since publication
178
+ [[tab_ace_nat]]
179
+ [cols="1,1",options="header,unnumbered"]
180
+ |===
181
+ |Date |Text affected
182
+ |===
183
+ ----
100
184
 
101
185
  === Commentaries
102
186
 
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -7,18 +7,36 @@
7
7
  </start>
8
8
  <define name="DocumentType">
9
9
  <choice>
10
- <value>specification</value>
11
- <value>management-systems-standard</value>
12
- <value>code-of-practice</value>
10
+ <value>british-standard</value>
11
+ <value>draft-for-development</value>
12
+ <value>published-document</value>
13
+ <value>privately-subscribed-standard</value>
14
+ <value>publicly-available-specification</value>
15
+ <value>flex-standard</value>
16
+ <value>international-standard</value>
17
+ <value>technical-specification</value>
18
+ <value>technical-report</value>
13
19
  <value>guide</value>
20
+ <value>international-workshop-agreement</value>
21
+ <value>industry-technical-agreement</value>
22
+ <value>standard</value>
23
+ <value>european-workshop-agreement</value>
24
+ </choice>
25
+ </define>
26
+ <define name="DocumentSubtype">
27
+ <choice>
28
+ <value>specification</value>
14
29
  <value>method-of-test</value>
15
30
  <value>method-of-specifying</value>
16
31
  <value>vocabulary</value>
17
- <value>classification</value>
32
+ <value>code-of-practice</value>
18
33
  </choice>
19
34
  </define>
20
35
  <define name="BibDataExtensionType">
21
36
  <ref name="doctype"/>
37
+ <optional>
38
+ <ref name="doctype"/>
39
+ </optional>
22
40
  <ref name="editorialgroup"/>
23
41
  <zeroOrMore>
24
42
  <ref name="ics"/>
@@ -33,6 +51,9 @@
33
51
  <optional>
34
52
  <ref name="cen-processing"/>
35
53
  </optional>
54
+ <optional>
55
+ <ref name="coverimages"/>
56
+ </optional>
36
57
  </define>
37
58
  <define name="admonition">
38
59
  <element name="admonition">
@@ -81,6 +102,13 @@
81
102
  <data type="boolean"/>
82
103
  </element>
83
104
  </define>
105
+ <define name="coverimages">
106
+ <element name="coverimages">
107
+ <oneOrMore>
108
+ <ref name="image"/>
109
+ </oneOrMore>
110
+ </element>
111
+ </define>
84
112
  <!--
85
113
  We display the Normative References between scope and terms; but to keep the
86
114
  grammar simple, we keep the references together
@@ -1,39 +1,14 @@
1
1
  <boilerplate>
2
2
  <copyright-statement>
3
3
  <clause>
4
- {% if unpublished %}
5
- <p><strong>Copyright © {{ docyear }} International Electrotechnical Commission, IEC.</strong>
6
- All rights reserved. It is permitted to download this electronic file, to make a copy and to
7
- print out the content for the sole purpose of preparing National Committee positions. You
8
- may not copy or "mirror" the file or printed version of the document, or any part of it,
9
- for any other purpose without permission in writing from IEC.
10
- {% else %}
11
- <p id="boilerplate-year">
12
- © {{ agency }} {{ docyear }}, Published in Switzerland
13
- </p>
14
- <p id="boilerplate-message">
15
- All rights
16
- reserved. Unless otherwise specified, no part of this publication may be
17
- reproduced or utilized otherwise in any form or by any means, electronic or
18
- mechanical, including photocopying, or posting on the internet or an intranet,
19
- without prior written permission. Permission can be requested from either IEC
20
- at the address below or IEC's member body in the country of the requester.
21
- </p>
22
- <p id="boilerplate-name">IEC Central Office</p>
23
- <p id="boilerplate-address" align="left">
24
- 3, rue de Varembé<br/>
25
- CH-1211 Geneva 20, Switzerland<br/>
26
- Tel.&#xa0;&#xa0;+ 41 22 919 02 11<br/>
27
- Fax&#xa0;&#xa0;+ 41 22 919 03 00<br/>
28
- info@iec.ch<br/>
29
- www.iec.ch
30
- {% endif %}
31
- </p>
4
+ <title>Publishing and copyright information</title>
5
+ <p>The BSI copyright notice displayed in this document indicates when the document was last issued.</p>
6
+ <p id="boilerplate-year"> © {{ agency }} {{ docyear }}</p>
7
+ <p>Published by BSI Standards Limited {{ docyear }}</p>
32
8
  </clause>
33
9
  </copyright-statement>
34
10
  <legal-statement>
35
11
  <clause>
36
- <p>Attention is drawn to the possibility that some of the elements of this IEC Publication may be the subject of patent rights. IEC shall not be held responsible for identifying any or all such patent rights.</p>
37
12
  </clause>
38
13
  </legal-statement>
39
14
  {% if unpublished %}
@@ -41,8 +16,7 @@
41
16
  <clause>
42
17
  {% if stage_int < 50 %}
43
18
  <p>This document is still under study and subject to change. It should not be used for reference purposes.</p>
44
- until published as such.</p>
45
- {% endif %}
19
+ {% endif %}
46
20
  {% if stage_int >= 50 %}
47
21
  <p>This document is a draft distributed for approval. It may not be referred to as an International Standard
48
22
  until published as such.</p>
@@ -58,48 +32,100 @@
58
32
  </license-statement>
59
33
  {% endif %}
60
34
  <feedback-statement>
61
- {% if unpublished %}
62
- <clause id="boilerplate-cenelec-attention">
63
- <title>Attention IEC-CENELEC parallel voting</title>
64
- <p>The attention of IEC National Committees, members of CENELEC, is drawn to the fact that this
65
- {% if stage_int >= 30 and stage_int < 40 %}Committee Draft{% endif %}
66
- {% if stage_int >= 40 and stage_int < 50 %}Committee Draft For Vote{% endif %}
67
- {% if stage_int >= 50 and stage_int < 60 %}Final Draft International Standard{% endif %}
68
- ({{ stageabbr }})
69
- is submitted for parallel voting.</p>
70
- <p>The CENELEC members are invited to vote through the CENELEC voting system.</p>
35
+ <clause>
36
+ <title>British Standards Institution (BSI)</title>
37
+ <p>BSI is the national body responsible for preparing British Standards and other standards-related publications, information and services.</p>
38
+ <p>BSI is incorporated by Royal Charter. British Standards and other standardization products are published by BSI Standards Limited.</p>
39
+ </clause>
40
+ <clause>
41
+ <title>About us</title>
42
+ <p>We bring together business, industry, government, consumers, innovators and others to shape their combined experience and expertise into standards-based solutions.</p>
43
+ <p>The knowledge embodied in our standards has been carefully assembled in a dependable format and refined through our open consultation process. Organizations of all sizes and across all sectors choose standards to help them achieve their goals.</p>
44
+ </clause>
45
+ <clause>
46
+ <title>Information on standards</title>
47
+ <p>We can provide you with the knowledge that your organization needs
48
+ to succeed. Find out more about British Standards by visiting our website at bsigroup.com/standards or contacting our Customer Services team or Knowledge Centre.</p>
49
+ </clause>
50
+ <clause>
51
+ <title>Buying standards</title>
52
+ <p>You can buy and download PDF versions of BSI publications, including British and adopted European and international standards, through our website at bsigroup.com/shop, where hard copies can also be purchased.</p>
53
+ <p>If you need international and foreign standards from other Standards Development Organizations, hard copies can be ordered from our Customer Services team.</p>
71
54
  </clause>
72
- {% else %}
55
+ {% if doctype != "publicly-available-specification" %}
73
56
  <clause>
74
- <title>About the IEC</title>
75
- <p>The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes International Standards for all electrical, electronic and related technologies.</p>
57
+ <title>Copyright in BSI publications</title>
58
+ <p>All the content in BSI publications, including British Standards, is the property of and copyrighted by BSI or some person or entity that owns copyright in the information used (such as the international standardization bodies) and has formally licensed such information to BSI for commercial publication and use.</p>
59
+ <p>Save for the provisions below, you may not transfer, share or disseminate any portion of the standard to any other person. You may not adapt, distribute, commercially exploit or publicly display the standard or any portion thereof in any manner whatsoever without BSI’s prior written consent.</p>
76
60
  </clause>
77
61
  <clause>
78
- <title>About IEC publications</title>
79
- <p>The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the latest edition, a corrigenda or an amendment might have been published.</p>
62
+ <title>Storing and using standards</title>
63
+ <p>Standards purchased in soft copy format:</p>
64
+ <ul>
65
+ <li>A British Standard purchased in soft copy format is licensed to a sole named user for personal or internal company use only.</li>
66
+ <li>The standard may be stored on more than one device provided that it is accessible by the sole named user only and that only one copy is accessed at any one time.</li>
67
+ <li>A single paper copy may be printed for personal or internal company use only.</li>
68
+ </ul>
69
+ <p>Standards purchased in hard copy format:</p>
70
+ <ul>
71
+ <li>A British Standard purchased in hard copy format is for personal or internal company use only.</li>
72
+ <li>It may not be further reproduced – in any format – to create an additional copy. This includes scanning of the document.</li>
73
+ </ul>
74
+ <p>If you need more than one copy of the document, or if you wish to share the document on an internal network, you can save money by choosing a subscription product (see ‘Subscriptions’).</p>
80
75
  </clause>
81
76
  <clause>
77
+ <title>Reproducing extracts</title>
78
+ <p>For permission to reproduce content from BSI publications contact the BSI Copyright and Licensing team.</p>
79
+ </clause>
80
+ {% endif %}
81
+ <clause>
82
+ <title>Subscriptions</title>
83
+ <p>Our range of subscription services are designed to make using standards easier for you. For further information on our subscription products go to bsigroup.com/subscriptions.</p>
84
+ <p>With <strong>British Standards Online (BSOL)</strong> you’ll have instant access to over 55,000 British and adopted European and international standards from your desktop. It’s available 24/7 and is refreshed daily so you’ll always be up to date.</p>
85
+ <p>You can keep in touch with standards developments and receive substantial discounts on the purchase price of standards, both in single copy and subscription format, by becoming a <strong>BSI Subscribing Member</strong>.</p>
86
+ <p><strong>PLUS</strong> is an updating service exclusive to BSI Subscribing Members. You will automatically receive the latest hard copy of your standards when they’re revised or replaced.</p>
87
+ <p>To find out more about becoming a BSI Subscribing Member and the benefits of membership, please visit bsigroup.com/shop.</p>
88
+ <p>With a <strong>Multi-User Network Licence (MUNL)</strong> you are able to host standards publications on your intranet. Licences can cover as few or as many users as you wish. With updates supplied as soon as they’re available, you can be sure your documentation is current. For further information, email cservices@bsigroup.com.</p>
89
+ </clause>
90
+ <clause>
91
+ <title>Revisions</title>
92
+ <p>Our British Standards and other publications are updated by amendment or revision.</p>
93
+ <p>We continually improve the quality of our products and services to benefit your business. If you find an inaccuracy or ambiguity within a British Standard or other BSI publication please inform the Knowledge Centre.</p>
94
+ </clause>
95
+ {% if doctype == "publicly-available-specification" %}
96
+ <clause>
97
+ <title>Copyright</title>
98
+ <p>All the data, software and documentation set out in
99
+ all British Standards and other BSI publications are the property of and copyrighted by BSI, or some person or entity that owns copyright in the information used (such as the international standardization bodies) and has formally licensed such information to BSI for commercial publication and use. Except as permitted under the Copyright, Designs and Patents Act 1988 no extract may be reproduced, stored in a retrieval system or transmitted in any form or by any means &#x2013; electronic, photocopying, recording or otherwise &#x2013; without prior written permission from BSI. Details and advice can be obtained from the Copyright &#x26; Licensing Department.</p>
100
+ </clause>
101
+ {% endif %}
102
+ <clause>
103
+ <title>Useful Contacts</title>
82
104
  <clause>
83
- <title>IEC Catalogue - <link target="https://webstore.iec.ch/catalogue">webstore.iec.ch/catalogue</link></title>
84
- <p>The stand-alone application for consulting the entire bibliographical information on IEC International Standards, Technical Specifications, Technical Reports and other documents. Available for PC, Mac OS, Android Tablets and iPad.</p>
85
- </clause>
86
- <clause><title>IEC publications search - <link target="https://www.iec.ch/searchpub">www.iec.ch/searchpub</link></title>
87
- <p>The advanced search enables to find IEC publications by a variety of criteria (reference number, text, technical committee,...). It also gives information on projects, replaced and withdrawn publications.</p>
105
+ <title>Customer Relations</title>
106
+ <p align="left"><strong>Tel</strong>: +44 345 086 9001<br/>
107
+ <strong>Email:</strong> cservices@bsigroup.com</p>
88
108
  </clause>
89
- <clause><title>IEC Just Published - <link target="https://webstore.iec.ch/justpublished">webstore.iec.ch/justpublished</link></title>
90
- <p>Stay up to date on all new IEC publications. Just Published details all new publications released. Available online and also once a month by email.</p>
91
- </clause>
92
- <clause><title>Electropedia - <link target="http://www.electropedia.org">www.electropedia.org</link></title>
93
- <p>The world's leading online dictionary of electronic and electrical terms containing more than 30 000 terms and definitions in English and French, with equivalent terms in 14 additional languages. Also known as the International Electrotechnical Vocabulary (IEV) online.</p>
109
+ <clause>
110
+ <title>Subscription Support</title>
111
+ <p align="left"><strong>Tel</strong>: +44 345 086 9001<br/>
112
+ <strong>Email:</strong> subscription.support@bsigroup.com</p>
94
113
  </clause>
95
- <clause><title>IEC Glossary - <link target="http://std.iec.ch/glossary">std.iec.ch/glossary</link></title>
96
- <p>More than 55 000 electrotechnical terminology entries in English and French extracted from the Terms and Definitions clause of IEC publications issued since 2002. Some entries have been collected from earlier publications of IEC TC 37, 77, 86 and CISPR.</p>
114
+ <clause>
115
+ <title>Knowledge Centre</title>
116
+ <p align="left"><strong>Tel</strong>: +44 20 8996 7004<br/>
117
+ <strong>Email:</strong> knowledgecentre@bsigroup.com</p>
97
118
  </clause>
98
- <clause><title>IEC Customer Service Centre - <link target="https://webstore.iec.ch/csc">webstore.iec.ch/csc</link></title>
99
- <p>If you wish to give us your feedback on this publication or need further assistance, please contact the Customer Service Centre: <link target="mailto://csc@iec.ch">csc@iec.ch</link>.</p>
119
+ <clause>
120
+ <title>Copyright and Licensing</title>
121
+ <p align="left"><strong>Tel</strong>: +44 20 8996 7070<br/>
122
+ <strong>Email:</strong> copyright@bsigroup.com</p>
100
123
  </clause>
101
124
  </clause>
102
- {% endif %}
125
+ <clause id="boilerplate_address">
126
+ <title>BSI Group Headquarters</title>
127
+ <p>389 Chiswick High Road London W4 4AL UK</p>
128
+ </clause>
103
129
  </feedback-statement>
104
130
  </boilerplate>
105
131
 
@@ -11,7 +11,7 @@ module Asciidoctor
11
11
  end
12
12
 
13
13
  def ol_cleanup(doc)
14
- doc.xpath("//clause[not(.//clause)] | //annex | //preface/* | //note")
14
+ doc.xpath("//clause[not(.//clause)] | //annex | //preface/*")
15
15
  .each do |c|
16
16
  (c.xpath(".//ol") - c.xpath(".//ul//ol | .//ol//ol"))
17
17
  .each_with_index do |l, i|
@@ -55,17 +55,24 @@ module Asciidoctor
55
55
  id.content = id_prefix(prefix, id)
56
56
  end
57
57
 
58
- def table_footnote_renumber1(fn, i, seen)
59
- content = footnote_content(fn)
58
+ def bibdata_cleanup(xmldoc)
59
+ super
60
+ xmldoc.xpath("//bibdata/relation[@type = 'bsi-related']").each do |r|
61
+ r["type"] = "related"
62
+ end
63
+ end
64
+
65
+ def table_footnote_renumber1(fnote, idx, seen)
66
+ content = footnote_content(fnote)
60
67
  if seen[content] then outnum = seen[content]
61
68
  else
62
- i += 1
63
- outnum = i
69
+ idx += 1
70
+ outnum = idx
64
71
  seen[content] = outnum
65
72
  end
66
- fn["reference"] = (outnum - 1 + "A".ord).chr
67
- fn["table"] = true
68
- [i, seen]
73
+ fnote["reference"] = (outnum - 1 + "A".ord).chr
74
+ fnote["table"] = true
75
+ [idx, seen]
69
76
  end
70
77
 
71
78
  # TODO: Rules for structure 10.5 amendments:
@@ -23,13 +23,6 @@ module Asciidoctor
23
23
  end
24
24
  end
25
25
 
26
- def biblio_metanorma_ids_informative(xmldoc)
27
- xmldoc.xpath("//references[@normative = 'false']/bibitem")
28
- .each_with_index do |b, i|
29
- biblio_metanorma_ids1(b, i)
30
- end
31
- end
32
-
33
26
  def biblio_metanorma_ids1(bib, idx)
34
27
  bib.at("./docidentifier[@type][not(@type = 'DOI' or "\
35
28
  "@type = 'ISSN' or @type = 'ISBN')]") and return
@@ -47,19 +40,16 @@ module Asciidoctor
47
40
  end
48
41
 
49
42
  def biblio_reorder(xmldoc)
50
- @sort_bib_by_appearance = true
51
43
  xmldoc.xpath("//references[@normative = 'false']").each do |r|
52
44
  biblio_reorder1(r)
53
45
  end
54
- @sort_bib_by_appearance = false
55
46
  xmldoc.xpath("//references[@normative = 'true']").each do |r|
56
47
  biblio_reorder1(r)
57
48
  end
58
49
  end
59
50
 
60
51
  def sort_biblio(bib)
61
- @sort_bib_by_appearance and sort_biblio_appearance(bib) or
62
- sort_norm_appearance(bib)
52
+ sort_norm_appearance(bib)
63
53
  end
64
54
 
65
55
  def citation_order(bib)
@@ -74,19 +64,15 @@ module Asciidoctor
74
64
  ids
75
65
  end
76
66
 
67
+ # if this is a standard document, we ignore citation order
68
+ # (Rules for Structure 21.4). That is done by zeroing id_to_num
69
+ #
77
70
  def id_to_num(bib, ids)
78
71
  return "000000000" if bib["id"].nil?
79
72
 
80
73
  sprintf("%09d", ids[bib["id"]] || 0)
81
74
  end
82
75
 
83
- def sort_biblio_appearance(bib)
84
- ids = citation_order(bib)
85
- bib.sort do |a, b|
86
- id_to_num(a, ids) <=> id_to_num(b, ids)
87
- end
88
- end
89
-
90
76
  def sort_norm_appearance(bib)
91
77
  ids = citation_order(bib)
92
78
  bib.each do |b|
@@ -113,11 +99,14 @@ module Asciidoctor
113
99
  abbrid = metaid unless /^\[\d+\]$/.match?(metaid)
114
100
  /\d-(?<partid>\d+)/ =~ id&.text
115
101
  type = id["type"] if id
116
- title = bib&.at("./title[@type = 'main']")&.text ||
117
- bib&.at("./title")&.text || bib&.at("./formattedref")&.text
118
102
  "#{type} :: "\
119
103
  "#{num.nil? ? abbrid : sprintf('%09d', num.to_i)} :: "\
120
- "#{partid} :: #{id&.text} :: #{title}"
104
+ "#{partid} :: #{id&.text} :: #{biblio_key_title(bib)}"
105
+ end
106
+
107
+ def biblio_key_title(bib)
108
+ bib&.at("./title[@type = 'main']")&.text ||
109
+ bib&.at("./title")&.text || bib&.at("./formattedref")&.text
121
110
  end
122
111
 
123
112
  def biblio_renumber(xmldoc)