metanorma-iho 0.4.5 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe0847c09cfdfde2e17055709884e36114585df1c82e72ca972959da5537b915
4
- data.tar.gz: 61017f76453d1a730328e274a5f6b150c0761c69340cbd92244b2ce1fc01efba
3
+ metadata.gz: ee0ce9c8c2bd6d95f99e1a81307f83751cea7086046359bf0c98c4567ba3c8e3
4
+ data.tar.gz: 0addeac4155072d4eed975211ad8ed40a3da6f3a6ff8f97c35f53be9422392ea
5
5
  SHA512:
6
- metadata.gz: e4be9b3b344e0ea3c98bf779a1880770a97a5099c56857ecce0d2f55b05ad34d67288b092b71d10a25d520da7b6777bb41d648bb1fba6e2451ca34d15a66d34d
7
- data.tar.gz: d67e94e5dc7b1460503b60da913339dd59e46b709917e97af3daa064b67ef21c586333f8860b36fcb15e2301a960bf44f86340c87c0effbe0c0a8685085fa37d
6
+ metadata.gz: 576967ae59fddeeadde1f4b18ecc7ac78f0fc32c3535920cd84164846534666a55e3104f0ba42d1f6a2a11c61ee379f22d1d7c71913974f5bbe9b870201219cf
7
+ data.tar.gz: d3842b851ccc0f122b2b5cb0b631078a611d87a836d722bedfa0d46b7bd226b8adc95c126221c728964f7e12e768948e47257476634d49ee3a704cab09c5e408
@@ -10,34 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
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@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
@@ -1 +1,12 @@
1
1
  .rubocop-https--*
2
+
3
+ /.rspec_status
4
+ /Gemfile.devel
5
+ /Gemfile.lock
6
+ /coverage/
7
+ /test.doc
8
+ /test.err
9
+ /test.html
10
+ /test.pdf
11
+ /test.presentation.xml
12
+ /test_*_htmlimages/
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "asciidoctor/rsd"
4
+ require "metanorma/iho"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -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
- id ||= bib.at(ns("./docidentifier[not(@type = 'metanorma')]"))
61
- return [nil, id, nil] if id
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[1] if id[1]
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[1] || ed
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)
@@ -248,51 +248,56 @@ body {
248
248
  main {
249
249
  margin: 0 3em 0 6em; }
250
250
 
251
- #toc {
251
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
252
252
  font-family: {{bodyfont}};
253
253
  font-weight: 400; }
254
- #toc ul {
254
+ #toc ul, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul {
255
255
  margin: 0;
256
256
  padding: 0;
257
257
  list-style: none; }
258
- #toc ul li a {
258
+ #toc ul li a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul li a {
259
259
  padding: 5px 10px; }
260
- #toc ul a {
260
+ #toc ul a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a {
261
261
  color: #05164d;
262
262
  text-decoration: none;
263
263
  display: block; }
264
- #toc ul a:hover {
264
+ #toc ul a:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a:hover {
265
265
  box-shadow: none;
266
266
  color: #05164d; }
267
- #toc .h2 {
267
+ #toc .h2, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h2 {
268
268
  padding-left: 30px; }
269
- #toc .h3 {
269
+ #toc .h3, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .h3 {
270
270
  padding-left: 50px; }
271
- #toc .toc-active, #toc li:hover {
271
+ #toc .toc-active, #toc li:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
272
272
  background: #fedc5b;
273
273
  box-shadow: inset -5px 0px 10px -5px #fedc5b !important; }
274
- #toc .toc-active a, #toc li:hover a {
274
+ #toc .toc-active a, #toc li:hover a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
275
275
  color: #05164d; }
276
276
  @media print {
277
- #toc .toc-active, #toc li:hover {
277
+ #toc .toc-active, #toc li:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover {
278
278
  background: white;
279
279
  box-shadow: none !important; }
280
- #toc .toc-active a {
280
+ #toc .toc-active a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a {
281
281
  color: #05164d; }
282
- #toc li:hover a {
282
+ #toc li:hover a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li:hover a {
283
283
  color: black; } }
284
284
  @media screen and (max-width: 768px) {
285
- #toc {
285
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
286
286
  padding: 0 1.5em;
287
287
  overflow: visible; } }
288
- #toc .toc-active a {
288
+ #toc .toc-active a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) .toc-active a {
289
289
  color: #05164d; }
290
- #toc li a {
290
+ #toc li a, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) li a {
291
291
  text-transform: uppercase; }
292
- #toc ul a:hover {
292
+ #toc ul a:hover, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) ul a:hover {
293
293
  box-shadow: none;
294
294
  color: #05164d; }
295
295
 
296
+ #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
297
+ margin-top: 0;
298
+ margin-bottom: 0;
299
+ font-size: 100%; }
300
+
296
301
  @media screen and (min-width: 768px) {
297
302
  nav {
298
303
  position: fixed;
@@ -377,7 +382,7 @@ main {
377
382
  display: none; }
378
383
  h1.toc-contents {
379
384
  margin-top: 1em; }
380
- ul#toc-list {
385
+ ul#toc-list, ul#toc-list > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
381
386
  padding: 0;
382
387
  margin: 0; } }
383
388
 
@@ -18,7 +18,7 @@ main {
18
18
  margin: 0 3em 0 6em;
19
19
  }
20
20
 
21
- #toc {
21
+ #toc, #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
22
22
  @include toc(#05164d, #fedc5b, #05164d);
23
23
  @include sidebarToc();
24
24
 
@@ -38,6 +38,12 @@ main {
38
38
  }
39
39
  }
40
40
 
41
+ #toc > ul :is(.h1, .h2, .h3, .h4, .h5, .h6) {
42
+ margin-top: 0;
43
+ margin-bottom: 0;
44
+ font-size: 100%;
45
+ }
46
+
41
47
  nav {
42
48
  @include sidebarNav(#f7f7f7, 323px, 45px);
43
49
  }
@@ -72,7 +78,7 @@ nav {
72
78
  margin-top: 1em;
73
79
  }
74
80
 
75
- ul#toc-list {
81
+ ul#toc-list, ul#toc-list > :is(.h1, .h2, .h3, .h4, .h5, .h6) {
76
82
  padding: 0;
77
83
  margin: 0;
78
84
  }
@@ -785,8 +785,7 @@ div.example p.MsoListParagraph {
785
785
  font-size: {{smallerfontsize}}; }
786
786
 
787
787
  div.Note p.MsoListParagraph {
788
- font-size: {{smallerfontsize}};
789
- margin-left: 1.0cm; }
788
+ font-size: {{smallerfontsize}}; }
790
789
 
791
790
  div.Note span.stem {
792
791
  font-size: {{smallerfontsize}}; }
@@ -744,7 +744,6 @@ div.example p.MsoListParagraph {
744
744
 
745
745
  div.Note p.MsoListParagraph {
746
746
  font-size: $smallerfontsize;
747
- margin-left: 1.0cm;
748
747
  }
749
748
 
750
749
  div.Note span.stem {