metanorma-iho 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -31
- data/.gitignore +11 -0
- data/bin/console +1 -1
- data/lib/isodoc/iho/base_convert.rb +11 -9
- data/lib/isodoc/iho/iho.specification.xsl +163 -134
- data/lib/isodoc/iho/iho.standard.xsl +163 -134
- data/lib/{asciidoctor → metanorma}/iho/basicdoc.rng +0 -0
- data/lib/{asciidoctor → metanorma}/iho/biblio.rng +0 -0
- data/lib/{asciidoctor → metanorma}/iho/boilerplate.xml +0 -0
- data/lib/{asciidoctor → metanorma}/iho/converter.rb +4 -4
- data/lib/{asciidoctor → metanorma}/iho/iho.rng +0 -0
- data/lib/{asciidoctor → metanorma}/iho/isodoc.rng +29 -0
- data/lib/{asciidoctor → metanorma}/iho/reqt.rng +0 -0
- data/lib/metanorma/iho/version.rb +1 -1
- data/lib/metanorma-iho.rb +1 -1
- data/metanorma-iho.gemspec +1 -1
- data/metanorma.yml +1 -1
- metadata +11 -12
- data/lib/asciidoctor/iho.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4082060ac60fbd1e8eba4fcf79e0591b0e41b8efe8977c1ace2a00ed3c37d1e5
|
4
|
+
data.tar.gz: 58176a042041336c07803e46439ebc0ef095c84353db29847669aea5ceeeedb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '048b316ef1689e16aa924af0b3b868c725dc64c3d36142c74adecd5c01a4a8c696250d9fbe4f3dfdfc835bd3f8b8185a9d9c20aa5bb2bed4b23c51791dca4b19'
|
7
|
+
data.tar.gz: c55b5acea52a9d45aa69eb970ea689e8375b5241a4c05486d020e44628a4ae70b8e8ae9c09e96ab801078cb5925e6aabef7427ce442f603751fee092f456b27b
|
data/.github/workflows/rake.yml
CHANGED
@@ -10,34 +10,6 @@ on:
|
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
rake:
|
13
|
-
|
14
|
-
|
15
|
-
|
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@master
|
24
|
-
|
25
|
-
- uses: ruby/setup-ruby@v1
|
26
|
-
with:
|
27
|
-
ruby-version: ${{ matrix.ruby }}
|
28
|
-
bundler-cache: true
|
29
|
-
|
30
|
-
- uses: metanorma/metanorma-build-scripts/plantuml-setup-action@master
|
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 }}"}'
|
13
|
+
uses: metanorma/metanorma-build-scripts/.github/workflows/generic-rake.yml@main
|
14
|
+
secrets:
|
15
|
+
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
data/.gitignore
CHANGED
data/bin/console
CHANGED
@@ -27,7 +27,7 @@ module IsoDoc
|
|
27
27
|
xml.span do |s|
|
28
28
|
node&.children&.each { |x| parse(x, s) }
|
29
29
|
end
|
30
|
-
end.join
|
30
|
+
end.join
|
31
31
|
end
|
32
32
|
|
33
33
|
def multiplenames_and(names)
|
@@ -56,13 +56,15 @@ module IsoDoc
|
|
56
56
|
def inline_bibitem_ref_code(bib)
|
57
57
|
id = bib.at(ns("./docidentifier[not(@type = 'DOI' or "\
|
58
58
|
"@type = 'metanorma' or @type = 'ISSN' or "\
|
59
|
-
"@type = 'ISBN' or @type = 'rfc-anchor'
|
60
|
-
|
61
|
-
|
59
|
+
"@type = 'ISBN' or @type = 'rfc-anchor' or "\
|
60
|
+
"@type = 'metanorma-ordinal')]"))
|
61
|
+
id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma' or "\
|
62
|
+
"@type = 'metanorma-ordinal')]"))
|
63
|
+
return [nil, id, nil, nil] if id
|
62
64
|
|
63
65
|
id = Nokogiri::XML::Node.new("docidentifier", bib.document)
|
64
66
|
id << "(NO ID)"
|
65
|
-
[nil, id, nil]
|
67
|
+
[nil, id, nil, nil]
|
66
68
|
end
|
67
69
|
|
68
70
|
def extract_edition(bib)
|
@@ -101,9 +103,9 @@ module IsoDoc
|
|
101
103
|
c = p.at(ns("./completename")) and return c.text
|
102
104
|
s = p&.at(ns("./surname"))&.text or return
|
103
105
|
i = p.xpath(ns("./initial")) and
|
104
|
-
front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join
|
106
|
+
front = i.map { |e| e.text.gsub(/[^[:upper:]]/, "") }.join
|
105
107
|
i.empty? and f = p.xpath(ns("./forename")) and
|
106
|
-
front = f.map { |e| e.text[0].upcase }.join
|
108
|
+
front = f.map { |e| e.text[0].upcase }.join
|
107
109
|
front ? "#{s} #{front}" : s
|
108
110
|
end
|
109
111
|
|
@@ -117,10 +119,10 @@ module IsoDoc
|
|
117
119
|
ftitle&.children&.each { |n| parse(n, out) }
|
118
120
|
else
|
119
121
|
id = render_identifier(inline_bibitem_ref_code(bib))
|
120
|
-
out << id[
|
122
|
+
out << id[:sdo] if id[:sdo]
|
121
123
|
ed = extract_edition(bib) if iho?(bib)
|
122
124
|
out << " edition #{ed}" if ed
|
123
|
-
out << ": " if id[
|
125
|
+
out << ": " if id[:sdo] || ed
|
124
126
|
iso_title(bib)&.children&.each { |n| parse(n, out) }
|
125
127
|
out << ", "
|
126
128
|
author = extract_author(bib)
|