metanorma 0.3.1 → 0.3.2

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: 76715eff6f9baf15080144dbe229e9853929a5ab8e5dd7db6be61383d40d8567
4
- data.tar.gz: a30c147a779a137db98033a2ecf61e648775a5e25ec76034fb9cc8c5c7cada32
3
+ metadata.gz: 59c1e77fc3df934cbf3512262e9bcf280272db2489dbc640c2f508365b03589f
4
+ data.tar.gz: 0be23070d766e7531e2d60c49db7b788d0800b0b23548a77c32891135b833ed7
5
5
  SHA512:
6
- metadata.gz: e2d99e2f42830d0a4fc180915949d16feec5fde95729ee2953650cd11012cc5ae5c7603a696b0afcf88b99f9e32e874251a30f6ba50ca1dc48fac9ade8a80bd1
7
- data.tar.gz: e8e80287e3d4ebd0ab6bc68d5e67b166d2a7bf39b06e9c936076f6617c0344cc7458cbb68a96697fc1fe9b0166c6af7c28d535811c4ad1b59ee11caccd006fb2
6
+ metadata.gz: 5d4d1525a4a6917ef045806b05b2e8b2656ee9d3778e66e6748fffa30fa5584ac2225992edadf80a141dd98d50b2792def8b2069a15533db56d8e1dbc937a0c3
7
+ data.tar.gz: d045217e6895b936b86bf420bbe08ccc66fba36be294798fb341f5dc0ec0ad296f2fa58bc9d6fba9de33a70732b462bf86bb375cee31d473f05f9f3c27eb25b4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- metanorma (0.3.0)
4
+ metanorma (0.3.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -49,4 +49,4 @@ DEPENDENCIES
49
49
  rspec-command (~> 1.0.3)
50
50
 
51
51
  BUNDLED WITH
52
- 1.16.6
52
+ 1.17.1
@@ -194,6 +194,19 @@ $ metanorma -t mpfd mpfd-bpn.adoc
194
194
  $ metanorma -t mpfd -r metanorma-mpfd mpfd-bpn.adoc
195
195
  ----
196
196
 
197
+ The `type` and `extension` options can be omitted if the corresponding metanorma directives
198
+ are included in the document as Metanorma directives; for Asciidoctor input, these take the form
199
+ of document attributes `mn-document-class:` and `:mn-output-extensions:`, e.g.
200
+
201
+ [source,asciidoctor]
202
+ ----
203
+ = My ISO document
204
+ :mn-document-class: iso
205
+ :mn-output-extensions: html,xml,pdf
206
+
207
+ .Foreword
208
+ ----
209
+
197
210
 
198
211
  == Origin of name
199
212
 
@@ -15,6 +15,16 @@ module Metanorma
15
15
  )
16
16
  end
17
17
 
18
+ def extract_metanorma_options(file)
19
+ headerextract = file.sub(/\n\n.*$/m, "\n")
20
+ /\n:mn-document-class: (?<type>[^\n]+)\n/ =~ headerextract
21
+ /\n:mn-output-extensions: (?<extensions>[^\n]+)\n/ =~ headerextract
22
+ {
23
+ type: defined?(type) ? type : nil,
24
+ extensions: defined?(extensions) ? extensions : nil,
25
+ }.reject { |_, val| val.nil? }
26
+ end
27
+
18
28
  def extract_options(file)
19
29
  headerextract = file.sub(/\n\n.*$/m, "\n")
20
30
 
@@ -28,5 +28,9 @@ module Metanorma
28
28
  def extract_options(file)
29
29
  Metanorma::Input::Asciidoc.new.extract_options(file)
30
30
  end
31
+
32
+ def extract_metanorma_options(file)
33
+ Metanorma::Input::Asciidoc.new.extract_metanorma_options(file)
34
+ end
31
35
  end
32
36
  end
@@ -1,3 +1,3 @@
1
1
  module Metanorma
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-14 00:00:00.000000000 Z
11
+ date: 2018-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler