isodoc 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +2 -2
- data/appveyor.yml +1 -0
- data/lib/isodoc/function/utils.rb +1 -0
- data/lib/isodoc/html_function/html.rb +13 -5
- data/lib/isodoc/version.rb +1 -1
- data/spec/isodoc/postproc_spec.rb +40 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986c12ed2b13ccc9a053a01bd349fd2aab55c45ce0c165f8da27462b406e44a7
|
4
|
+
data.tar.gz: 70cc1c851e800931a2dc4bf146fbe988256ffe7b3810b72ff0047cfbe7f0aa8b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac13334d0028a116d294601f1b3354ef46138a5a0f7baa05052b23701755873547acb0de1ad7590bfea6af345e8ea11af9b7f6d916ce3e7cbaf497ceac16a026
|
7
|
+
data.tar.gz: 04a396b315e1c7c5abd31cd144d1ed9f6c9c2a73dd3004a3713f83d18c8b54e9035e15fe44e8547a8c6ff77291125799544fdd25b11f23979e9f1e49e9da1535
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
isodoc (0.10.
|
4
|
+
isodoc (0.10.3)
|
5
5
|
asciimath
|
6
6
|
html2doc (~> 0.8.11)
|
7
7
|
htmlentities (~> 4.3.4)
|
@@ -81,7 +81,7 @@ GEM
|
|
81
81
|
coderay (~> 1.1.0)
|
82
82
|
method_source (~> 0.9.0)
|
83
83
|
rainbow (3.0.0)
|
84
|
-
rake (12.3.
|
84
|
+
rake (12.3.3)
|
85
85
|
rb-fsevent (0.10.3)
|
86
86
|
rb-inotify (0.10.0)
|
87
87
|
ffi (~> 1.0)
|
data/appveyor.yml
CHANGED
@@ -137,6 +137,7 @@ module IsoDoc::Function
|
|
137
137
|
meta = @meta.get.merge(@labels || {})
|
138
138
|
docxml = docxml.
|
139
139
|
gsub(/\[TERMREF\]\s*/, l10n("[#{@source_lbl}: ")).
|
140
|
+
gsub(/\s*\[MODIFICATION\]\s*\[\/TERMREF\]/, l10n(", #{@modified_lbl} [/TERMREF]")).
|
140
141
|
gsub(/\s*\[\/TERMREF\]\s*/, l10n("]")).
|
141
142
|
gsub(/\s*\[MODIFICATION\]/, l10n(", #{@modified_lbl} — "))
|
142
143
|
template = liquid(docxml)
|
@@ -44,7 +44,9 @@ module IsoDoc::HtmlFunction
|
|
44
44
|
def toHTML(result, filename)
|
45
45
|
result = (from_xhtml(html_cleanup(to_xhtml(result))))
|
46
46
|
result = populate_template(result, :html)
|
47
|
-
result = script_cdata(from_xhtml(move_images(to_xhtml(result))))
|
47
|
+
#result = script_cdata(from_xhtml(move_images(to_xhtml(result))))
|
48
|
+
result = from_xhtml(move_images(to_xhtml(result)))
|
49
|
+
result = script_cdata(inject_script(result))
|
48
50
|
File.open("#{filename}.html", "w:UTF-8") do |f|
|
49
51
|
f.write(result)
|
50
52
|
end
|
@@ -169,14 +171,20 @@ module IsoDoc::HtmlFunction
|
|
169
171
|
html_intro(docxml) if @htmlintropage
|
170
172
|
docxml.at("//body") << mathjax(@openmathdelim, @closemathdelim)
|
171
173
|
docxml.at("//body") << sourcecode_highlighter
|
172
|
-
if @scripts
|
173
|
-
|
174
|
-
|
175
|
-
end
|
174
|
+
#if @scripts
|
175
|
+
# scripts = File.read(@scripts, encoding: "UTF-8")
|
176
|
+
# a = docxml.at("//body").add_child docxml.create_cdata(scripts)
|
177
|
+
#end
|
176
178
|
html_main(docxml)
|
177
179
|
docxml
|
178
180
|
end
|
179
181
|
|
182
|
+
def inject_script(doc)
|
183
|
+
return doc unless @scripts
|
184
|
+
scripts = File.read(@scripts, encoding: "UTF-8")
|
185
|
+
doc.sub("</body>", scripts + "\n</body>")
|
186
|
+
end
|
187
|
+
|
180
188
|
def html_cover(docxml)
|
181
189
|
cover = File.read(@htmlcoverpage, encoding: "UTF-8")
|
182
190
|
coverxml = to_xhtml_fragment(cover)
|
data/lib/isodoc/version.rb
CHANGED
@@ -706,6 +706,46 @@ TOCLEVEL
|
|
706
706
|
expect(html).to match(%r{<h2 class="TermNum" id="paddy">1\.2\.</h2>})
|
707
707
|
end
|
708
708
|
|
709
|
+
it "processes empty term modifications" do
|
710
|
+
FileUtils.rm_f "test.html"
|
711
|
+
FileUtils.rm_f "test.doc"
|
712
|
+
IsoDoc::HtmlConvert.new({wordstylesheet: "spec/assets/word.css", htmlstylesheet: "spec/assets/html.css"}).convert("test", <<~"INPUT", false)
|
713
|
+
<iso-standard xmlns="http://riboseinc.com/isoxml">
|
714
|
+
<sections>
|
715
|
+
<terms id="_terms_and_definitions" obligation="normative"><title>Terms and Definitions</title>
|
716
|
+
|
717
|
+
<term id="paddy1"><preferred>paddy</preferred>
|
718
|
+
<domain>rice</domain>
|
719
|
+
<definition><p id="_eb29b35e-123e-4d1c-b50b-2714d41e747f">rice retaining its husk after threshing</p></definition>
|
720
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f892">
|
721
|
+
<p id="_65c9a509-9a89-4b54-a890-274126aeb55c">Foreign seeds, husks, bran, sand, dust.</p>
|
722
|
+
<ul>
|
723
|
+
<li>A</li>
|
724
|
+
</ul>
|
725
|
+
</termexample>
|
726
|
+
<termexample id="_bd57bbf1-f948-4bae-b0ce-73c00431f894">
|
727
|
+
<ul>
|
728
|
+
<li>A</li>
|
729
|
+
</ul>
|
730
|
+
</termexample>
|
731
|
+
|
732
|
+
<termsource status="modified">
|
733
|
+
<origin bibitemid="ISO7301" type="inline" citeas="ISO 7301:2011"><locality type="clause"><referenceFrom>3.1</referenceFrom></locality></origin>
|
734
|
+
<modification>
|
735
|
+
<p id="_e73a417d-ad39-417d-a4c8-20e4e2529489"/>
|
736
|
+
</modification>
|
737
|
+
</termsource></term>
|
738
|
+
|
739
|
+
</terms>
|
740
|
+
</sections>
|
741
|
+
</iso-standard>
|
742
|
+
INPUT
|
743
|
+
expect(File.exist?("test.html")).to be true
|
744
|
+
html = File.read("test.html")
|
745
|
+
expect(html).to include '[SOURCE: <a href="#ISO7301">ISO 7301:2011, Clause 3.1</a>, modified]'
|
746
|
+
end
|
747
|
+
|
748
|
+
|
709
749
|
it "creates continuation styles for multiparagraph list items in Word" do
|
710
750
|
FileUtils.rm_f "test.doc"
|
711
751
|
FileUtils.rm_f "test.html"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|