isodoc 1.5.5 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +2 -12
  3. data/.hound.yml +3 -1
  4. data/.rubocop.yml +3 -7
  5. data/Gemfile +2 -2
  6. data/Rakefile +2 -2
  7. data/bin/rspec +1 -2
  8. data/isodoc.gemspec +11 -11
  9. data/lib/isodoc-yaml/i18n-ar.yaml +152 -0
  10. data/lib/isodoc-yaml/i18n-de.yaml +149 -0
  11. data/lib/isodoc-yaml/i18n-es.yaml +151 -0
  12. data/lib/isodoc-yaml/i18n-ru.yaml +154 -0
  13. data/lib/isodoc.rb +0 -2
  14. data/lib/isodoc/base_style/all.css +7 -0
  15. data/lib/isodoc/base_style/metanorma_word.css +7 -0
  16. data/lib/isodoc/base_style/metanorma_word.scss +8 -0
  17. data/lib/isodoc/base_style/reset.css +7 -0
  18. data/lib/isodoc/base_style/reset.scss +9 -0
  19. data/lib/isodoc/base_style/scripts.html +187 -0
  20. data/lib/isodoc/class_utils.rb +6 -5
  21. data/lib/isodoc/common.rb +2 -0
  22. data/lib/isodoc/convert.rb +30 -17
  23. data/lib/isodoc/css.rb +43 -34
  24. data/lib/isodoc/function/blocks.rb +21 -4
  25. data/lib/isodoc/function/blocks_example_note.rb +2 -2
  26. data/lib/isodoc/function/cleanup.rb +53 -45
  27. data/lib/isodoc/function/form.rb +51 -0
  28. data/lib/isodoc/function/inline.rb +37 -15
  29. data/lib/isodoc/function/references.rb +55 -42
  30. data/lib/isodoc/function/section.rb +29 -16
  31. data/lib/isodoc/function/table.rb +1 -0
  32. data/lib/isodoc/function/to_word_html.rb +33 -29
  33. data/lib/isodoc/function/utils.rb +180 -159
  34. data/lib/isodoc/gem_tasks.rb +30 -31
  35. data/lib/isodoc/headlesshtml_convert.rb +8 -7
  36. data/lib/isodoc/html_convert.rb +6 -4
  37. data/lib/isodoc/html_function/comments.rb +2 -0
  38. data/lib/isodoc/html_function/footnotes.rb +14 -7
  39. data/lib/isodoc/html_function/form.rb +62 -0
  40. data/lib/isodoc/html_function/html.rb +30 -26
  41. data/lib/isodoc/html_function/postprocess.rb +41 -82
  42. data/lib/isodoc/html_function/postprocess_footnotes.rb +59 -0
  43. data/lib/isodoc/i18n.rb +33 -31
  44. data/lib/isodoc/pdf_convert.rb +12 -16
  45. data/lib/isodoc/presentation_function/bibdata.rb +54 -30
  46. data/lib/isodoc/presentation_function/block.rb +17 -8
  47. data/lib/isodoc/presentation_function/inline.rb +84 -120
  48. data/lib/isodoc/presentation_function/math.rb +84 -0
  49. data/lib/isodoc/presentation_function/section.rb +20 -22
  50. data/lib/isodoc/presentation_xml_convert.rb +2 -1
  51. data/lib/isodoc/sassc_importer.rb +1 -1
  52. data/lib/isodoc/version.rb +1 -1
  53. data/lib/isodoc/word_function/body.rb +28 -24
  54. data/lib/isodoc/word_function/footnotes.rb +22 -15
  55. data/lib/isodoc/word_function/postprocess.rb +50 -36
  56. data/lib/isodoc/xref.rb +9 -10
  57. data/lib/isodoc/xref/xref_counter.rb +32 -17
  58. data/lib/isodoc/xref/xref_gen.rb +33 -21
  59. data/lib/isodoc/xref/xref_gen_seq.rb +60 -35
  60. data/lib/isodoc/xref/xref_sect_gen.rb +37 -35
  61. data/lib/isodoc/xslfo_convert.rb +36 -27
  62. data/spec/assets/scripts_override.html +3 -0
  63. data/spec/isodoc/blocks_spec.rb +2490 -2591
  64. data/spec/isodoc/cleanup_spec.rb +1107 -1109
  65. data/spec/isodoc/footnotes_spec.rb +1 -16
  66. data/spec/isodoc/form_spec.rb +156 -0
  67. data/spec/isodoc/i18n_spec.rb +984 -972
  68. data/spec/isodoc/inline_spec.rb +1129 -912
  69. data/spec/isodoc/lists_spec.rb +316 -315
  70. data/spec/isodoc/postproc_spec.rb +1751 -1540
  71. data/spec/isodoc/presentation_xml_spec.rb +403 -323
  72. data/spec/isodoc/ref_spec.rb +718 -723
  73. data/spec/isodoc/section_spec.rb +910 -902
  74. data/spec/isodoc/table_spec.rb +566 -556
  75. data/spec/isodoc/terms_spec.rb +251 -255
  76. data/spec/isodoc/xref_spec.rb +3041 -2992
  77. data/spec/isodoc/xslfo_convert_spec.rb +39 -0
  78. data/spec/spec_helper.rb +30 -29
  79. metadata +77 -65
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bdc454593acf1b0a4d0a9cc04a6338de5848e3e28b77a3fc22126d8c445f07b
4
- data.tar.gz: d4e1a7f0db4f38fdb76eaae029a26fda9d04bb43a5d25d03ad82e7956e247c5b
3
+ metadata.gz: c36b5db70dc3eb379ad1f903a8707b7c9403474e55f0fe99b9218536d0651c9a
4
+ data.tar.gz: 33e3a3e805b97042ac336754d43c47162e0d3e8851649514c20e4d5ede0301c0
5
5
  SHA512:
6
- metadata.gz: fae8cdbb24965be799d0e8bf084dc56c7af1cd303981a3b151f039bc51184dec5792e6537641fad9f0dd5b7098262d961277a5f10a9eb0673e0739775baaaf74
7
- data.tar.gz: e300abaa10548c18961d1aac9ab111c6cc392821d28d29c6083c2daab4dcef2a7b245858689995f7f0adb6afad35452707a4dbaaf60b63b463bf4f05305a4298
6
+ metadata.gz: 7ec36b6afb9cdb96291f75a78740d5cd555d898fa9bce309904a7ac54408c8ad90f2f4dcb5fe5e97aeb08526f6659d317a42537466801f9abbc4735b8fa23a39
7
+ data.tar.gz: ffb1143efd27cf641cc9b336b9ff538bb6c6c5153cdc351f0e9edb8f4c7f029793267b47caa5682e9ce886ac9e30ea7c0601d1b91eca88a62f92ccb675294fc5
@@ -16,19 +16,9 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5', '2.4' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
- include:
23
- - ruby: '3.0'
24
- os: 'ubuntu-latest'
25
- experimental: true
26
- - ruby: '3.0'
27
- os: 'windows-latest'
28
- experimental: true
29
- - ruby: '3.0'
30
- os: 'macos-latest'
31
- experimental: true
32
22
  steps:
33
23
  - uses: actions/checkout@master
34
24
 
@@ -49,5 +39,5 @@ jobs:
49
39
  with:
50
40
  token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }}
51
41
  repository: ${{ github.repository }}
52
- event-type: notify
42
+ event-type: tests-passed
53
43
  client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'
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
10
  TargetRubyVersion: 2.4
13
- Rails:
14
- Enabled: true
data/Gemfile CHANGED
@@ -6,6 +6,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
7
  gemspec
8
8
 
9
- if File.exist? 'Gemfile.devel'
10
- eval File.read('Gemfile.devel'), nil, 'Gemfile.devel' # rubocop:disable Security/Eval
9
+ if File.exist? "Gemfile.devel"
10
+ eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
11
11
  end
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
- require 'isodoc/gem_tasks'
3
+ require "isodoc/gem_tasks"
4
4
 
5
5
  IsoDoc::GemTasks.install
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task default: :spec
8
+ task default: :spec
data/bin/rspec CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
-
2
+
3
3
  # This file was generated by Bundler.
4
4
  #
5
5
  # The application 'rspec' is installed as part of a gem, and
@@ -15,4 +15,3 @@ require "rubygems"
15
15
  require "bundler/setup"
16
16
 
17
17
  load Gem.bin_path("rspec-core", "rspec")
18
-
data/isodoc.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
 
3
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
  require "isodoc/version"
6
6
 
@@ -29,26 +29,26 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
31
  spec.add_dependency "asciimath"
32
+ spec.add_dependency "html2doc", "~> 1.1.1"
32
33
  spec.add_dependency "htmlentities", "~> 4.3.4"
33
- spec.add_dependency "nokogiri", "~> 1.10.4"
34
- spec.add_dependency "thread_safe"
35
- spec.add_dependency "uuidtools"
36
- spec.add_dependency "html2doc", "~> 1.0.0"
37
34
  spec.add_dependency "liquid", "~> 4"
38
- spec.add_dependency "twitter_cldr", ">= 6.6.0"
39
- spec.add_dependency "roman-numerals"
40
- spec.add_dependency "metanorma", "~> 1.2.0"
35
+ spec.add_dependency "metanorma", ">= 1.2.0"
36
+ spec.add_dependency "nokogiri", "~> 1.11.0"
41
37
  spec.add_dependency "relaton-cli"
38
+ spec.add_dependency "roman-numerals"
39
+ spec.add_dependency "thread_safe"
40
+ spec.add_dependency "twitter_cldr", ">= 6.6.0"
41
+ spec.add_dependency "uuidtools"
42
42
 
43
- spec.add_development_dependency "rake", "~> 13.0"
44
43
  spec.add_development_dependency "byebug", "~> 9.1"
45
- spec.add_development_dependency "sassc", "~> 2.4.0"
46
44
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
47
45
  spec.add_development_dependency "guard", "~> 2.14"
48
46
  spec.add_development_dependency "guard-rspec", "~> 4.7"
47
+ spec.add_development_dependency "rake", "~> 13.0"
48
+ spec.add_development_dependency "rexml"
49
49
  spec.add_development_dependency "rspec", "~> 3.6"
50
50
  spec.add_development_dependency "rubocop", "~> 1.5.2"
51
+ spec.add_development_dependency "sassc", "~> 2.4.0"
51
52
  spec.add_development_dependency "simplecov", "~> 0.15"
52
53
  spec.add_development_dependency "timecop", "~> 0.9"
53
- spec.add_development_dependency "rexml"
54
54
  end
@@ -0,0 +1,152 @@
1
+ term_def_boilerplate:
2
+ scope: مجال التطبيق
3
+ symbolsabbrev: الرموز والاختصارات
4
+ abbrev: الاختصارات
5
+ symbols: الرموز
6
+ table_of_contents: جدول المحتويات
7
+ introduction: مقدمة
8
+ foreword: تمهيد
9
+ abstract: ملخص
10
+ acknowledgements: شكر
11
+ termsdef: مصطلحات معرفة
12
+ termsdefsymbolsabbrev: المصطلحات والتعريفات والرموز والاختصارات
13
+ termsdefsymbols: المصطلحات والتعريفات والرموز
14
+ termsdefabbrev: المصطلحات والتعريفات والاختصارات
15
+ normref: المراجع المعيارية
16
+ bibliography: بيبليوغرافيا
17
+ clause: فقرة
18
+ annex: ملحق
19
+ appendix: تذييل
20
+ no_terms_boilerplate: |
21
+ <p>No terms and definitions are listed in this document.</p>
22
+ internal_terms_boilerplate: |
23
+ <p>For the purposes of this document,
24
+ the following terms and definitions apply.</p>
25
+ norm_with_refs_pref:
26
+ The following documents are referred to in the text in such a way
27
+ that some or all of their content constitutes requirements of this
28
+ document. For dated references, only the edition cited applies.
29
+ For undated references, the latest edition of the referenced
30
+ document (including any amendments) applies.
31
+ norm_empty_pref:
32
+ There are no normative references in this document.
33
+ external_terms_boilerplate: |
34
+ <p>For the purposes of this document,
35
+ the terms and definitions given in % apply.</p>
36
+ internal_external_terms_boilerplate: |
37
+ <p>For the purposes of this document, the terms and definitions
38
+ given in % and the following apply.</p>
39
+ term_defined_in: "[term defined in %]"
40
+ note: ملاحظة
41
+ note_xref: ملاحظة
42
+ termnote: Note % to entry
43
+ list: قائمة
44
+ figure: شكل
45
+ formula: معادلة
46
+ inequality: عدم مساواة
47
+ table: جدول
48
+ requirement: مطلب
49
+ recommendation: توصية
50
+ permission: إذن
51
+ key: Key
52
+ example: مثال
53
+ example_xref: مثال
54
+ where: حيث
55
+ wholeoftext: كامل النص
56
+ draft_label: draft
57
+ inform_annex: informative
58
+ norm_annex: normative
59
+ modified: معدلة
60
+ deprecated: DEPRECATED
61
+ source: مصدر
62
+ and: و
63
+ all_parts: كل الأجزاء
64
+ month_january: يناير
65
+ month_february: فبراير
66
+ month_march: مارس
67
+ month_april: أبريل
68
+ month_may: مايو
69
+ month_june: يونيو
70
+ month_july: يوليو
71
+ month_august: أعسطس
72
+ month_september: سبتمبر
73
+ month_october: أكتوبر
74
+ month_november: نوفمبر
75
+ month_december: ديسمبر
76
+ obligation: التزام
77
+ subject: موضوع
78
+ inherits: يرث
79
+ admonition:
80
+ danger: خطر
81
+ warning: Warning
82
+ caution: Caution
83
+ important: مهم
84
+ safety precautions: احتياطات السلامة
85
+ locality:
86
+ section: قسم
87
+ clause: فقرة
88
+ part: جزء
89
+ paragraph: فقرة
90
+ chapter: فصل
91
+ page: صفحة
92
+ table: جدول
93
+ annex: ملحق, مرفق
94
+ figure: شكل
95
+ example: مثال
96
+ note: ملحوظة, ملاحظة
97
+ formula: معادلة
98
+ inflection:
99
+ فقرة:
100
+ sg: فقرة
101
+ pl: فقرات
102
+ ملحق:
103
+ sg: ملحق
104
+ pl: لحقات
105
+ تذييل:
106
+ sg: تذييل
107
+ pl: تذييلات
108
+ ملاحظة:
109
+ sg: ملاحظة
110
+ pl: ملاحظات
111
+ "Note % to entry":
112
+ sg: Note % to entry
113
+ pl: Notes % to entry
114
+ قائمة:
115
+ sg: قائمة
116
+ pl: قوائم
117
+ شكل:
118
+ sg: شكل
119
+ pl: أشكال
120
+ معادلة:
121
+ sg: معادلة
122
+ pl: معادلات
123
+ جدول:
124
+ sg: جدول
125
+ pl: جداول
126
+ مطلب:
127
+ sg: مطلب
128
+ pl: متطلبات
129
+ توصية:
130
+ sg: توصية
131
+ pl: توصيات
132
+ تصريح:
133
+ sg: تصريح
134
+ pl: تصريحات
135
+ مثال:
136
+ sg: مثال
137
+ pl: أمثلة
138
+ جزء:
139
+ sg: جزء
140
+ pl: أجزاء
141
+ قسم:
142
+ sg: قسم
143
+ pl: أقسام
144
+ فقرة:
145
+ sg: فقرة
146
+ pl: فقرات
147
+ فصل:
148
+ sg: فصل
149
+ pl: فصول
150
+ صفحة:
151
+ sg: صفحة
152
+ pl: صفحات
@@ -0,0 +1,149 @@
1
+ term_def_boilerplate:
2
+ scope: Umfang
3
+ symbolsabbrev: Symbole und abgekürzte Begriffe
4
+ abbrev: Abgekürzte Begriffe
5
+ symbols: Symbole
6
+ table_of_contents: Inhaltsübersicht
7
+ introduction: Einführung
8
+ foreword: Vorwort
9
+ abstract: Abstrakt
10
+ acknowledgements: Danksagung
11
+ termsdef: Begriffe und Definitionen
12
+ termsdefsymbolsabbrev: Begriffe, Definitionen, Symbole und abgekürzte Begriffe
13
+ termsdefsymbols: Begriffe, Definitionen und Symbole
14
+ termsdefabbrev: Begriffe, Definitionen und abgekürzte Begriffe
15
+ normref: Normative Verweise
16
+ bibliography: Bibliographie
17
+ clause: Klausel
18
+ annex: Anhang
19
+ appendix: Appendix
20
+ no_terms_boilerplate: |
21
+ <p>In diesem Dokument sind keine Begriffe und Definitionen aufgeführt.</p>
22
+ internal_terms_boilerplate: |
23
+ <p>Für die Zwecke dieses Dokuments gelten die folgenden Begriffe und Definitionen</p>
24
+ norm_with_refs_pref:
25
+ Auf die folgenden Dokumente wird im Text so verwiesen, dass ihr Inhalt ganz oder
26
+ teilweise Anforderungen dieses Dokuments darstellt. Bei datierten Verweisen gilt
27
+ nur die zitierte Ausgabe. Bei undatierten Verweisen gilt die neueste Ausgabe des
28
+ referenzierten Dokuments (einschließlich eventueller Änderungen).
29
+ norm_empty_pref: In diesem Dokument sind keine normativen Verweise enthalten.
30
+ external_terms_boilerplate: |
31
+ <p>Für die Zwecke dieses Dokuments gelten die in % angegebenen Begriffe und Definitionen.</p>
32
+ internal_external_terms_boilerplate: |
33
+ <p>Für die Zwecke dieses Dokuments gelten die in % und im Folgenden aufgeführten Begriffe und Definitionen.</p>
34
+ term_defined_in: "[Begriff definiert in %]"
35
+ note: HINWEIS
36
+ note_xref: Hinweis
37
+ termnote: Hinweis % zum Eintrag
38
+ list: Liste
39
+ figure: Abbildung
40
+ formula: Formel
41
+ inequality: Formel
42
+ table: Tabelle
43
+ requirement: Anforderung
44
+ recommendation: Empfehlung
45
+ permission: Erlaubnis
46
+ key: Taste
47
+ example: BEISPIEL
48
+ example_xref: Beispiel
49
+ where: wobei
50
+ wholeoftext: Ganzer Text
51
+ draft_label: Entwurf
52
+ inform_annex: informativ
53
+ norm_annex: normativ
54
+ modified: geändert
55
+ deprecated: DEPRECATED
56
+ source: QUELLE
57
+ and: und
58
+ all_parts: Alle Teile
59
+ month_january: Januar
60
+ month_february: Februar
61
+ month_march: März
62
+ month_april: April
63
+ month_may: Mai
64
+ month_june: Juni
65
+ month_july: Juli
66
+ month_august: August
67
+ month_september: September
68
+ month_october: Oktober
69
+ month_november: November
70
+ month_december: Dezember
71
+ obligation: Verbindlichkeit
72
+ subject: Thema
73
+ inherits: Erbt
74
+ admonition: {
75
+ danger: Gefahr,
76
+ warning: Warnung,
77
+ caution: Vorsicht,
78
+ important: Wichtig,
79
+ safety precautions: Sicherheitsvorkehrungen
80
+ }
81
+ locality: {
82
+ section: Abschnitt,
83
+ clause: Klausel,
84
+ part: Teil,
85
+ paragraph: Absatz,
86
+ chapter: Kapitel,
87
+ page: Seite,
88
+ table: Tabelle,
89
+ annex: Anhang,
90
+ figure: Abbildung,
91
+ example: Beispiel,
92
+ note: Hinweis,
93
+ formula: Formel
94
+ }
95
+ inflection:
96
+ Klausel:
97
+ sg: Klausel
98
+ pl: Klauseln
99
+ Anhang:
100
+ sg: Anhang
101
+ pl: Anhänge
102
+ Appendix:
103
+ sg: Appendix
104
+ pl: Appendixe
105
+ Note:
106
+ sg: Hinweis
107
+ pl: Hinweise
108
+ "Hinweis % zum Eintrag":
109
+ sg: Hinweis % zum Eintrag
110
+ pl: Anmerkungen % zum Eintrag
111
+ Liste:
112
+ sg: Liste
113
+ pl: Listen
114
+ Abbildung:
115
+ sg: Abbildung
116
+ pl: Abbildungen
117
+ Formel:
118
+ sg: Formel
119
+ pl: Formeln
120
+ Tabelle:
121
+ sg: Tabelle
122
+ pl: Tabellen
123
+ Anforderung:
124
+ sg: Anforderung
125
+ pl: Anforderungen
126
+ Empfehlung:
127
+ sg: Empfehlung
128
+ pl: Empfehlungen
129
+ Erlaubnis:
130
+ sg: Erlaubnis
131
+ pl: Berechtigungen
132
+ Beispiel:
133
+ sg: Beispiel
134
+ pl: Beispiele
135
+ Teil:
136
+ sg: Teil
137
+ pl: Teile
138
+ Abschnitt:
139
+ sg: Abschnitt
140
+ pl: Abschnitte
141
+ Absatz:
142
+ sg: Absatz
143
+ pl: Absätze
144
+ Kapitel:
145
+ sg: Kapitel
146
+ pl: Kapitel
147
+ Seite:
148
+ sg: Seite
149
+ pl: Seiten