metanorma-csa 1.4.12 → 1.6.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/macos.yml +8 -1
- data/.github/workflows/ubuntu.yml +20 -7
- data/.github/workflows/windows.yml +8 -1
- data/Rakefile +2 -0
- data/lib/asciidoctor/csa/biblio.rng +1 -1
- data/lib/asciidoctor/csa/converter.rb +15 -17
- data/lib/asciidoctor/csa/csa.rng +14 -0
- data/lib/asciidoctor/csa/isodoc.rng +439 -6
- data/lib/asciidoctor/csa/reqt.rng +23 -0
- data/lib/isodoc/csa/base_convert.rb +0 -20
- data/lib/isodoc/csa/csa.standard.xsl +1624 -2495
- data/lib/isodoc/csa/html/csa.css +801 -0
- data/lib/isodoc/csa/html/htmlstyle.css +1070 -0
- data/lib/isodoc/csa/html/htmlstyle.scss +0 -1
- data/lib/isodoc/csa/html/wordstyle.css +1253 -0
- data/lib/isodoc/csa/html/wordstyle.scss +0 -1
- data/lib/isodoc/csa/html_convert.rb +2 -0
- data/lib/isodoc/csa/i18n-en.yaml +2 -0
- data/lib/isodoc/csa/i18n.rb +10 -0
- data/lib/isodoc/csa/init.rb +24 -0
- data/lib/isodoc/csa/pdf_convert.rb +2 -12
- data/lib/isodoc/csa/presentation_xml_convert.rb +19 -0
- data/lib/isodoc/csa/word_convert.rb +2 -0
- data/lib/isodoc/csa/xref.rb +6 -0
- data/lib/metanorma/csa/processor.rb +6 -8
- data/lib/metanorma/csa/version.rb +1 -1
- data/metanorma-csa.gemspec +3 -2
- metadata +32 -11
@@ -0,0 +1,24 @@
|
|
1
|
+
require "isodoc"
|
2
|
+
require_relative "metadata"
|
3
|
+
require_relative "xref"
|
4
|
+
require_relative "i18n"
|
5
|
+
|
6
|
+
module IsoDoc
|
7
|
+
module Csa
|
8
|
+
module Init
|
9
|
+
def metadata_init(lang, script, i18n)
|
10
|
+
@meta = Metadata.new(lang, script, i18n)
|
11
|
+
end
|
12
|
+
|
13
|
+
def xref_init(lang, script, klass, i18n, options)
|
14
|
+
html = HtmlConvert.new(language: lang, script: script)
|
15
|
+
@xrefs = Xref.new(lang, script, html, i18n, options)
|
16
|
+
end
|
17
|
+
|
18
|
+
def i18n_init(lang, script, i18nyaml = nil)
|
19
|
+
@i18n = I18n.new(lang, script, i18nyaml || @i18nyaml)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
@@ -13,18 +13,8 @@ module IsoDoc
|
|
13
13
|
super
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
|
18
|
-
docxml, outname_html, dir = convert_init(file, filename, debug)
|
19
|
-
/\.xml$/.match(filename) or
|
20
|
-
filename = Tempfile.open([outname_html, ".xml"], encoding: "utf-8") do |f|
|
21
|
-
f.write file
|
22
|
-
f.path
|
23
|
-
end
|
24
|
-
FileUtils.rm_rf dir
|
25
|
-
::Metanorma::Output::XslfoPdf.new.convert(
|
26
|
-
filename, outname_html + ".pdf",
|
27
|
-
File.join(@libdir, "csa.standard.xsl"))
|
16
|
+
def pdf_stylesheet(docxml)
|
17
|
+
"csa.standard.xsl"
|
28
18
|
end
|
29
19
|
end
|
30
20
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require_relative "init"
|
2
|
+
require "isodoc"
|
3
|
+
|
4
|
+
module IsoDoc
|
5
|
+
module Csa
|
6
|
+
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
|
7
|
+
def annex1(f)
|
8
|
+
lbl = @xrefs.anchor(f['id'], :label)
|
9
|
+
if t = f.at(ns("./title"))
|
10
|
+
t.children = "<strong>#{t.children.to_xml}</strong>"
|
11
|
+
end
|
12
|
+
prefix_name(f, "<br/>", lbl, "title")
|
13
|
+
end
|
14
|
+
|
15
|
+
include Init
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
@@ -33,18 +33,16 @@ module Metanorma
|
|
33
33
|
"Metanorma::Csa #{Metanorma::Csa::VERSION}"
|
34
34
|
end
|
35
35
|
|
36
|
-
def
|
37
|
-
Metanorma::Input::Asciidoc.new.process(file, filename, @asciidoctor_backend)
|
38
|
-
end
|
39
|
-
|
40
|
-
def output(isodoc_node, outname, format, options={})
|
36
|
+
def output(isodoc_node, inname, outname, format, options={})
|
41
37
|
case format
|
42
38
|
when :html
|
43
|
-
IsoDoc::Csa::HtmlConvert.new(options).convert(
|
39
|
+
IsoDoc::Csa::HtmlConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
44
40
|
when :doc
|
45
|
-
IsoDoc::Csa::WordConvert.new(options).convert(
|
41
|
+
IsoDoc::Csa::WordConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
46
42
|
when :pdf
|
47
|
-
IsoDoc::Csa::PdfConvert.new(options).convert(
|
43
|
+
IsoDoc::Csa::PdfConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
44
|
+
when :presentation
|
45
|
+
IsoDoc::Csa::PresentationXMLConvert.new(options).convert(inname, isodoc_node, nil, outname)
|
48
46
|
else
|
49
47
|
super
|
50
48
|
end
|
data/metanorma-csa.gemspec
CHANGED
@@ -36,10 +36,11 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.add_dependency "thread_safe"
|
37
37
|
spec.add_dependency "uuidtools"
|
38
38
|
|
39
|
-
spec.add_dependency "metanorma-standoc", "~> 1.
|
40
|
-
spec.add_dependency "isodoc", "~> 1.
|
39
|
+
spec.add_dependency "metanorma-standoc", "~> 1.5.0"
|
40
|
+
spec.add_dependency "isodoc", "~> 1.2.0"
|
41
41
|
|
42
42
|
spec.add_development_dependency "byebug", "~> 9.1"
|
43
|
+
spec.add_development_dependency "sassc", "2.4.0"
|
43
44
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
44
45
|
spec.add_development_dependency "guard", "~> 2.14"
|
45
46
|
spec.add_development_dependency "guard-rspec", "~> 4.7"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-csa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: htmlentities
|
@@ -100,28 +100,28 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 1.
|
103
|
+
version: 1.5.0
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 1.
|
110
|
+
version: 1.5.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: isodoc
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: 1.2.0
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: 1.2.0
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: byebug
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,6 +136,20 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '9.1'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: sassc
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - '='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 2.4.0
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - '='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 2.4.0
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
154
|
name: equivalent-xml
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -286,6 +300,7 @@ files:
|
|
286
300
|
- lib/isodoc/csa/base_convert.rb
|
287
301
|
- lib/isodoc/csa/csa.standard.xsl
|
288
302
|
- lib/isodoc/csa/html/csa-logo-white.png
|
303
|
+
- lib/isodoc/csa/html/csa.css
|
289
304
|
- lib/isodoc/csa/html/csa.png
|
290
305
|
- lib/isodoc/csa/html/csa.scss
|
291
306
|
- lib/isodoc/csa/html/dots-w@2x.png
|
@@ -293,15 +308,22 @@ files:
|
|
293
308
|
- lib/isodoc/csa/html/header.html
|
294
309
|
- lib/isodoc/csa/html/html_csa_intro.html
|
295
310
|
- lib/isodoc/csa/html/html_csa_titlepage.html
|
311
|
+
- lib/isodoc/csa/html/htmlstyle.css
|
296
312
|
- lib/isodoc/csa/html/htmlstyle.scss
|
297
313
|
- lib/isodoc/csa/html/scripts.html
|
298
314
|
- lib/isodoc/csa/html/word_csa_intro.html
|
299
315
|
- lib/isodoc/csa/html/word_csa_titlepage.html
|
316
|
+
- lib/isodoc/csa/html/wordstyle.css
|
300
317
|
- lib/isodoc/csa/html/wordstyle.scss
|
301
318
|
- lib/isodoc/csa/html_convert.rb
|
319
|
+
- lib/isodoc/csa/i18n-en.yaml
|
320
|
+
- lib/isodoc/csa/i18n.rb
|
321
|
+
- lib/isodoc/csa/init.rb
|
302
322
|
- lib/isodoc/csa/metadata.rb
|
303
323
|
- lib/isodoc/csa/pdf_convert.rb
|
324
|
+
- lib/isodoc/csa/presentation_xml_convert.rb
|
304
325
|
- lib/isodoc/csa/word_convert.rb
|
326
|
+
- lib/isodoc/csa/xref.rb
|
305
327
|
- lib/metanorma-csa.rb
|
306
328
|
- lib/metanorma/csa.rb
|
307
329
|
- lib/metanorma/csa/processor.rb
|
@@ -311,7 +333,7 @@ homepage: https://github.com/metanorma/metanorma-csa
|
|
311
333
|
licenses:
|
312
334
|
- BSD-2-Clause
|
313
335
|
metadata: {}
|
314
|
-
post_install_message:
|
336
|
+
post_install_message:
|
315
337
|
rdoc_options: []
|
316
338
|
require_paths:
|
317
339
|
- lib
|
@@ -326,9 +348,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
326
348
|
- !ruby/object:Gem::Version
|
327
349
|
version: '0'
|
328
350
|
requirements: []
|
329
|
-
|
330
|
-
|
331
|
-
signing_key:
|
351
|
+
rubygems_version: 3.0.3
|
352
|
+
signing_key:
|
332
353
|
specification_version: 4
|
333
354
|
summary: metanorma-csa lets you write CSA Normal Documents (CSAND) in AsciiDoc.
|
334
355
|
test_files: []
|