metanorma-standoc 1.4.4 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/lib/asciidoctor/standoc/base.rb +4 -3
- data/lib/asciidoctor/standoc/cleanup_boilerplate.rb +11 -24
- data/lib/asciidoctor/standoc/cleanup_section.rb +72 -5
- data/lib/asciidoctor/standoc/cleanup_terms.rb +10 -0
- data/lib/asciidoctor/standoc/converter.rb +0 -2
- data/lib/asciidoctor/standoc/isodoc.rng +12 -6
- data/lib/asciidoctor/standoc/ref.rb +24 -25
- data/lib/asciidoctor/standoc/section.rb +27 -25
- data/lib/asciidoctor/standoc/utils.rb +16 -0
- data/lib/metanorma/standoc/version.rb +1 -1
- data/metanorma-standoc.gemspec +1 -1
- data/spec/asciidoctor-standoc/base_spec.rb +1 -0
- data/spec/asciidoctor-standoc/blocks_spec.rb +12 -5
- data/spec/asciidoctor-standoc/cleanup_spec.rb +1216 -12
- data/spec/asciidoctor-standoc/inline_spec.rb +1 -1
- data/spec/asciidoctor-standoc/refs_dl_spec.rb +4 -4
- data/spec/asciidoctor-standoc/refs_spec.rb +16 -16
- data/spec/asciidoctor-standoc/section_spec.rb +42 -38
- data/spec/assets/i18n.yaml +17 -2
- data/spec/metanorma/processor_spec.rb +1 -2
- metadata +4 -8
- data/lib/asciidoctor-yaml/i18n-en.yaml +0 -20
- data/lib/asciidoctor-yaml/i18n-fr.yaml +0 -13
- data/lib/asciidoctor-yaml/i18n-zh-Hans.yaml +0 -15
- data/lib/asciidoctor/standoc/i18n.rb +0 -39
@@ -49,8 +49,7 @@ RSpec.describe Metanorma::Standoc::Processor do
|
|
49
49
|
expect(File.read("test.html", encoding: "utf-8").gsub(%r{^.*<main}m, "<main").gsub(%r{</main>.*}m, "</main>")).to be_equivalent_to <<~"OUTPUT"
|
50
50
|
<main class="main-section"><button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
|
51
51
|
<p class="zzSTDTitle1"></p>
|
52
|
-
<div id="H"><h1>
|
53
|
-
<h2 class="TermNum" id="J">1.1.</h2>
|
52
|
+
<div id="H"><h1>Terms, Definitions, Symbols and Abbreviated Terms</h1><h2 class="TermNum" id="J"></h2>
|
54
53
|
<p class="Terms" style="text-align:left;">Term2</p>
|
55
54
|
</div>
|
56
55
|
</main>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-standoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciidoctor
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.2.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.2.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: iev
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -361,9 +361,6 @@ files:
|
|
361
361
|
- Rakefile
|
362
362
|
- bin/rspec
|
363
363
|
- docs/quickstart.adoc
|
364
|
-
- lib/asciidoctor-yaml/i18n-en.yaml
|
365
|
-
- lib/asciidoctor-yaml/i18n-fr.yaml
|
366
|
-
- lib/asciidoctor-yaml/i18n-zh-Hans.yaml
|
367
364
|
- lib/asciidoctor/standoc/base.rb
|
368
365
|
- lib/asciidoctor/standoc/basicdoc.rng
|
369
366
|
- lib/asciidoctor/standoc/biblio.rng
|
@@ -383,7 +380,6 @@ files:
|
|
383
380
|
- lib/asciidoctor/standoc/datamodel/plantuml_renderer.rb
|
384
381
|
- lib/asciidoctor/standoc/front.rb
|
385
382
|
- lib/asciidoctor/standoc/front_contributor.rb
|
386
|
-
- lib/asciidoctor/standoc/i18n.rb
|
387
383
|
- lib/asciidoctor/standoc/inline.rb
|
388
384
|
- lib/asciidoctor/standoc/isodoc.rng
|
389
385
|
- lib/asciidoctor/standoc/lists.rb
|
@@ -1,20 +0,0 @@
|
|
1
|
-
term_def_boilerplate:
|
2
|
-
no_terms_boilerplate: |
|
3
|
-
<p>No terms and definitions are listed in this document.</p>
|
4
|
-
internal_terms_boilerplate: |
|
5
|
-
<p>For the purposes of this document,
|
6
|
-
the following terms and definitions apply.</p>
|
7
|
-
norm_with_refs_pref:
|
8
|
-
The following documents are referred to in the text in such a way
|
9
|
-
that some or all of their content constitutes requirements of this
|
10
|
-
document. For dated references, only the edition cited applies.
|
11
|
-
For undated references, the latest edition of the referenced
|
12
|
-
document (including any amendments) applies.
|
13
|
-
norm_empty_pref:
|
14
|
-
There are no normative references in this document.
|
15
|
-
external_terms_boilerplate: |
|
16
|
-
<p>For the purposes of this document,
|
17
|
-
the terms and definitions given in % apply.</p>
|
18
|
-
internal_external_terms_boilerplate: |
|
19
|
-
<p>For the purposes of this document, the terms and definitions
|
20
|
-
given in % and the following apply.</p>
|
@@ -1,13 +0,0 @@
|
|
1
|
-
term_def_boilerplate:
|
2
|
-
no_terms_boilerplate: |
|
3
|
-
<p>Aucun terme n'est defini dans le présent document.</p>
|
4
|
-
internal_terms_boilerplate: |
|
5
|
-
<p>Pour les besoins du présent document, les termes et définitions suivants s'appliquent.</p>
|
6
|
-
norm_with_refs_pref:
|
7
|
-
Les documents suivants cités dans le texte constituent, pour tout ou partie de leur contenu, des exigences du présent document. Pour les références datées, seule l’édition citée s'applique. Pour les références non datées, la dernière édition du document de référence s'applique (y compris les éventuels amendements).
|
8
|
-
norm_empty_pref:
|
9
|
-
Le présent document ne contient aucune référence normative.
|
10
|
-
external_terms_boilerplate: |
|
11
|
-
<p>Pour les besoins du présent document, les termes et définitions de % s'appliquent.</p>
|
12
|
-
internal_external_terms_boilerplate: |
|
13
|
-
<p>Pour les besoins du présent document, les termes et définitions de % ainsi que les suivants, s'appliquent.</p>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
term_def_boilerplate:
|
2
|
-
no_terms_boilerplate: |
|
3
|
-
<p>本文件不提供术语和定义。</p>
|
4
|
-
internal_terms_boilerplate: |
|
5
|
-
<p>下列术语和定义适用于本文件。</p>
|
6
|
-
norm_with_refs_pref:
|
7
|
-
下列文件对于本文件的应用是必不可少的。
|
8
|
-
凡是注日期的引用文件,仅注日期的版本适用于本文件。
|
9
|
-
凡是不注日期的引用文件,其最新版本(包括所有的修改单)适用于本文件。
|
10
|
-
norm_empty_pref:
|
11
|
-
本文件并没有规范性引用文件。
|
12
|
-
external_terms_boilerplate: |
|
13
|
-
<p>% 界定的术语和定义适用于本文件。</p>
|
14
|
-
internal_external_terms_boilerplate: |
|
15
|
-
<p>% 界定的以及下列术语和定义适用于本文件。</p>
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require "yaml"
|
2
|
-
|
3
|
-
module Asciidoctor
|
4
|
-
module Standoc
|
5
|
-
module I18n
|
6
|
-
def load_yaml(lang, script)
|
7
|
-
if @i18nyaml then YAML.load_file(@i18nyaml)
|
8
|
-
elsif lang == "en"
|
9
|
-
YAML.load_file(File.join(File.dirname(__FILE__),
|
10
|
-
"../../asciidoctor-yaml/i18n-en.yaml"))
|
11
|
-
elsif lang == "fr"
|
12
|
-
YAML.load_file(File.join(File.dirname(__FILE__),
|
13
|
-
"../../asciidoctor-yaml/i18n-fr.yaml"))
|
14
|
-
elsif lang == "zh" && script == "Hans"
|
15
|
-
YAML.load_file(File.join(File.dirname(__FILE__),
|
16
|
-
"../../asciidoctor-yaml/i18n-zh-Hans.yaml"))
|
17
|
-
else
|
18
|
-
YAML.load_file(File.join(File.dirname(__FILE__),
|
19
|
-
"../../asciidoctor-yaml/i18n-en.yaml"))
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def i18n_init(lang, script)
|
24
|
-
@lang = lang
|
25
|
-
@script = script
|
26
|
-
y = load_yaml(lang, script)
|
27
|
-
@term_def_boilerplate = y["term_def_boilerplate"] || ""
|
28
|
-
@no_terms_boilerplate = y["no_terms_boilerplate"] || ""
|
29
|
-
@internal_terms_boilerplate = y["internal_terms_boilerplate"] || ""
|
30
|
-
@norm_with_refs_pref = y["norm_with_refs_pref"] || ""
|
31
|
-
@norm_empty_pref = y["norm_empty_pref"] || ""
|
32
|
-
@external_terms_boilerplate = y["external_terms_boilerplate"] || ""
|
33
|
-
@internal_external_terms_boilerplate =
|
34
|
-
y["internal_external_terms_boilerplate"] || ""
|
35
|
-
@labels = y
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|