metanorma-acme 1.4.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9d601ee51c1830ca813d20b85309d021b0e5064c438f2000251070100d8d0ee
4
- data.tar.gz: c49236b4c46b2b34f5bd1b1881516c56b36341d6bc6c4a96b21a5e0e5dceb49e
3
+ metadata.gz: 4d38983bff42e94e27d19ae72ab3c6809467ec137e44529b6bc1f06a7d56a746
4
+ data.tar.gz: f9f1e18030443e96ffb4f65c8d4d749db40528335a5fcdc9a91069c17fcd8b24
5
5
  SHA512:
6
- metadata.gz: 8c5aaacf9c48a7507457962bf9521be83dc8f13f77a944231dcd519f88505cfc2d130f97b086225dd42a4ea9fdbb607ea153da32aab93e69c704e1853bd6da5d
7
- data.tar.gz: c4a81ebdd99f0a73b331fb12378130c4b5a6c0dd8c731979bbc830e1f9d6fe1c43391a1cfcf6946d2f80b900ccae87871237716230749147dfc39d72da7ea59d
6
+ metadata.gz: 06dd665eae90ccec10bdfe15f57ecd3f6dca44b86f8fdcd8fe6fd13a4645cbbcddc5767f105c5c1e3d2efbfe22c661b8bcd19817159550622fb8bac18a864d61
7
+ data.tar.gz: 434734db9c61af0eb346e1eb38a604b9dc0fb4b8fd4dc883fdcc7ed53b2c9eb6bd359af589141fc1bee734d19ec506f1a0eda07462a752ec4d0955b1f231f6b0
@@ -14,6 +14,11 @@ module Asciidoctor
14
14
 
15
15
  register_for "acme"
16
16
 
17
+ def baselocation(loc)
18
+ return nil if loc.nil?
19
+ File.expand_path(File.join(File.dirname(self.class::_file || __FILE__), "..", "..", "..", loc))
20
+ end
21
+
17
22
  def metadata_author(node, xml)
18
23
  xml.contributor do |c|
19
24
  c.role **{ type: "author" }
@@ -21,6 +26,7 @@ module Asciidoctor
21
26
  a.name configuration.organization_name_short
22
27
  end
23
28
  end
29
+ personal_author(node, xml)
24
30
  end
25
31
 
26
32
  def metadata_publisher(node, xml)
@@ -83,21 +89,25 @@ module Asciidoctor
83
89
  result = textcleanup(result)
84
90
  ret1 = cleanup(Nokogiri::XML(result))
85
91
  validate(ret1) unless @novalid
86
- ret1.root.add_namespace(nil, configuration.document_namespace || XML_NAMESPACE)
92
+ ret1.root.add_namespace(nil, configuration.document_namespace ||
93
+ XML_NAMESPACE)
87
94
  ret1
88
95
  end
89
96
 
90
97
  def doctype(node)
91
98
  d = node.attr("doctype")
92
- unless %w{policy-and-procedures best-practices supporting-document report legal directives proposal standard}.include? d
93
- warn "#{d} is not a legal document type: reverting to 'standard'"
99
+ unless %w{policy-and-procedures best-practices supporting-document
100
+ report legal directives proposal standard}.include? d
101
+ @log.add("Document Attributes", nil,
102
+ "#{d} is not a legal document type: reverting to 'standard'")
94
103
  d = "standard"
95
104
  end
96
105
  d
97
106
  end
98
107
 
99
108
  def read_config_file(path_to_config_file)
100
- Metanorma::Acme.configuration.set_default_values_from_yaml_file(path_to_config_file)
109
+ Metanorma::Acme.configuration.
110
+ set_default_values_from_yaml_file(path_to_config_file)
101
111
  end
102
112
 
103
113
  def document(node)
@@ -113,6 +123,7 @@ module Asciidoctor
113
123
  word_converter(node).convert filename unless node.attr("nodoc")
114
124
  pdf_converter(node).convert filename unless node.attr("nodoc")
115
125
  end
126
+ @log.write(@filename + ".err") unless @novalid
116
127
  @files_to_delete.each { |f| FileUtils.rm f }
117
128
  ret
118
129
  end
@@ -120,7 +131,7 @@ module Asciidoctor
120
131
  def validate(doc)
121
132
  content_validate(doc)
122
133
  schema_validate(formattedstr_strip(doc.dup),
123
- configuration.validate_rng_file ||
134
+ baselocation(configuration.validate_rng_file) ||
124
135
  File.join(File.dirname(__FILE__), "acme.rng"))
125
136
  end
126
137
 
@@ -645,6 +645,11 @@
645
645
  <optional>
646
646
  <attribute name="script"/>
647
647
  </optional>
648
+ <optional>
649
+ <attribute name="inline-header">
650
+ <data type="boolean"/>
651
+ </attribute>
652
+ </optional>
648
653
  <optional>
649
654
  <attribute name="obligation">
650
655
  <choice>
@@ -1,8 +1,8 @@
1
- <div class="document-stage-band" id='{{ stage | downcase | replace: " ", "-" }}-band'>
1
+ <div class="document-stage-band" id="{{ stage | downcase | replace: ' ', '-' }}-band">
2
2
  <p class="document-stage">{{ stage }}</p>
3
3
  </div>
4
4
 
5
- <div class="document-type-band" id='{{ doctype | downcase | replace: " ", "-" }}-band'>
5
+ <div class="document-type-band" id="{{ doctype | downcase | replace: ' ', '-' }}-band">
6
6
  <p class="document-type">Acme {{ doctype }}</p>
7
7
  </div>
8
8
 
@@ -23,9 +23,11 @@ module IsoDoc
23
23
 
24
24
  def default_fonts(options)
25
25
  {
26
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
27
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
28
- monospacefont: '"Space Mono",monospace'
26
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif'
27
+ : configuration.html_bodyfont || '"Overpass",sans-serif'),
28
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
29
+ configuration.html_headerfont || '"Overpass",sans-serif'),
30
+ monospacefont: configuration.html_monospacefont || '"Space Mono",monospace'
29
31
  }
30
32
  end
31
33
 
@@ -19,11 +19,13 @@ module IsoDoc
19
19
  k._file = caller_locations.first.absolute_path
20
20
  end
21
21
 
22
- def default_fonts(options)
22
+ def default_fonts(options)
23
23
  {
24
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
25
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
26
- monospacefont: '"Space Mono",monospace'
24
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif'
25
+ : configuration.html_bodyfont || '"Overpass",sans-serif'),
26
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
27
+ configuration.html_headerfont || '"Overpass",sans-serif'),
28
+ monospacefont: configuration.html_monospacefont || '"Space Mono",monospace'
27
29
  }
28
30
  end
29
31
 
@@ -22,9 +22,9 @@ module IsoDoc
22
22
 
23
23
  def default_fonts(options)
24
24
  {
25
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
26
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
27
- monospacefont: '"Courier New",monospace'
25
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : configuration.word_bodyfont || '"Arial",sans-serif'),
26
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : configuration.word_headerfont || '"Arial",sans-serif'),
27
+ monospacefont: configuration.word_monospacefont || '"Courier New",monospace'
28
28
  }
29
29
  end
30
30
 
@@ -22,6 +22,9 @@ module Metanorma
22
22
  htmlcoverpage
23
23
  htmlintropage
24
24
  htmlstylesheet
25
+ html_bodyfont
26
+ html_headerfont
27
+ html_monospacefont
25
28
  published_stages
26
29
  stage_abbreviations
27
30
  scripts
@@ -31,15 +34,27 @@ module Metanorma
31
34
  wordcoverpage
32
35
  wordintropage
33
36
  wordstylesheet
37
+ word_bodyfont
38
+ word_headerfont
39
+ word_monospacefont
34
40
  xml_root_tag
35
41
  ].freeze
36
42
 
37
43
  attr_accessor(*CONFIG_ATTRS)
38
44
 
45
+ class << self
46
+ attr_accessor :_file
47
+ end
48
+
49
+ def self.inherited( k )
50
+ k._file = caller_locations.first.absolute_path
51
+ end
52
+
39
53
  def initialize(*args)
40
54
  super
41
55
  # Try to set config values from yaml file in current directory
42
- set_default_values_from_yaml_file(YAML_CONFIG_FILE) if File.file?(YAML_CONFIG_FILE)
56
+ @yaml = File.join(File.dirname(self.class::_file || __FILE__), "..", "..", YAML_CONFIG_FILE)
57
+ set_default_values_from_yaml_file(@yaml) if File.file?(@yaml)
43
58
  self.organization_name_short ||= ORGANIZATION_NAME_SHORT
44
59
  self.organization_name_long ||= ORGANIZATION_NAME_LONG
45
60
  self.document_namespace ||= DOCUMENT_NAMESPACE
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Acme
3
- VERSION = "1.4.3"
3
+ VERSION = "1.4.4"
4
4
  end
5
5
  end
@@ -40,5 +40,4 @@ Gem::Specification.new do |spec|
40
40
  spec.add_development_dependency "rubocop", "= 0.54.0"
41
41
  spec.add_development_dependency "simplecov", "~> 0.15"
42
42
  spec.add_development_dependency "timecop", "~> 0.9"
43
- spec.add_development_dependency "metanorma", "~> 0.3.0"
44
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-acme
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.3
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -192,20 +192,6 @@ dependencies:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0.9'
195
- - !ruby/object:Gem::Dependency
196
- name: metanorma
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: 0.3.0
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: 0.3.0
209
195
  description: |
210
196
  Metanorma for the (fictitious) Acme Corp.
211
197