metanorma-m3aawg 1.5.6 → 1.6.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,9 +2,11 @@ require "isodoc"
2
2
 
3
3
  module IsoDoc
4
4
  module M3AAWG
5
- # A {Converter} implementation that generates CSAND output, and a document
6
- # schema encapsulation of the document for validation
7
- class Metadata < IsoDoc::Metadata
5
+ class Metadata < IsoDoc::Generic::Metadata
6
+ def configuration
7
+ Metanorma::M3AAWG.configuration
8
+ end
9
+
8
10
  def initialize(lang, script, labels)
9
11
  super
10
12
  here = File.dirname(__FILE__)
@@ -34,20 +36,6 @@ module IsoDoc
34
36
  docnumber = isoxml.at(ns("//bibdata/docidentifier"))
35
37
  set(:docnumber, docnumber&.text)
36
38
  end
37
-
38
- def stage_abbr(status)
39
- case status
40
- when "working-draft" then "wd"
41
- when "committee-draft" then "cd"
42
- when "draft-standard" then "d"
43
- else
44
- ""
45
- end
46
- end
47
-
48
- def unpublished(status)
49
- !%w(published withdrawn).include? status.downcase
50
- end
51
39
  end
52
40
  end
53
41
  end
@@ -1,16 +1,21 @@
1
1
  require_relative "init"
2
+ require "metanorma-generic"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
5
6
  module M3AAWG
6
- class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
7
+ class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
8
+ def configuration
9
+ Metanorma::M3AAWG.configuration
10
+ end
11
+
7
12
  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>"
13
+ lbl = @xrefs.anchor(f['id'], :label)
14
+ if t = f.at(ns("./title"))
15
+ t.children = "<strong>#{t.children.to_xml}</strong>"
16
+ end
17
+ prefix_name(f, "<br/>", lbl, "title")
11
18
  end
12
- prefix_name(f, "<br/>", lbl, "title")
13
- end
14
19
 
15
20
  include Init
16
21
  end
@@ -1,39 +1,13 @@
1
1
  require "isodoc"
2
2
  require_relative "base_convert"
3
+ require "isodoc/generic/word_convert"
3
4
  require_relative "init"
4
5
 
5
6
  module IsoDoc
6
7
  module M3AAWG
7
- # A {Converter} implementation that generates GB output, and a document
8
- # schema encapsulation of the document for validation
9
-
10
- class WordConvert < IsoDoc::WordConvert
11
- def initialize(options)
12
- @libdir = File.dirname(__FILE__)
13
- super
14
- end
15
-
16
- def default_fonts(options)
17
- {
18
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Garamond",serif'),
19
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Garamond",serif'),
20
- monospacefont: '"Courier New",monospace'
21
- }
22
- end
23
-
24
- def default_file_locations(_options)
25
- {
26
- htmlstylesheet: html_doc_path("htmlstyle.scss"),
27
- htmlcoverpage: html_doc_path("html_m3d_titlepage.html"),
28
- htmlintropage: html_doc_path("html_m3d_intro.html"),
29
- scripts: html_doc_path("scripts.html"),
30
- wordstylesheet: html_doc_path("wordstyle.scss"),
31
- standardstylesheet: html_doc_path("m3d.scss"),
32
- header: html_doc_path("header.html"),
33
- wordintropage: html_doc_path("word_m3d_intro.html"),
34
- ulstyle: "l3",
35
- olstyle: "l2",
36
- }
8
+ class WordConvert < IsoDoc::Generic::WordConvert
9
+ def configuration
10
+ Metanorma::M3AAWG.configuration
37
11
  end
38
12
 
39
13
  def colophon(body, docxml)
@@ -51,11 +25,6 @@ module IsoDoc
51
25
  end
52
26
  end
53
27
 
54
- def title(isoxml, _out)
55
- main = isoxml&.at(ns("//title[@language='en']"))&.text
56
- set_metadata(:doctitle, main)
57
- end
58
-
59
28
  include BaseRender
60
29
  include Init
61
30
  end
@@ -1,6 +1,11 @@
1
+ require "metanorma-generic"
2
+
1
3
  module IsoDoc
2
4
  module M3AAWG
3
5
  class Xref < IsoDoc::Xref
6
+ def configuration
7
+ Metanorma::M3AAWG.configuration
8
+ end
4
9
  end
5
10
  end
6
11
  end
@@ -1,7 +1,33 @@
1
- require_relative "./m3aawg/processor"
1
+ require "metanorma"
2
+ require "metanorma-generic"
3
+ require "metanorma/m3aawg/processor"
2
4
 
3
5
  module Metanorma
4
- module M3AWWG
6
+ module M3AAWG
5
7
 
8
+ class Configuration < Metanorma::Generic::Configuration
9
+ def initialize(*args)
10
+ super
11
+ end
12
+ end
13
+
14
+ class << self
15
+ extend Forwardable
16
+
17
+ attr_accessor :configuration
18
+
19
+ Configuration::CONFIG_ATTRS.each do |attr_name|
20
+ def_delegator :@configuration, attr_name
21
+ end
22
+
23
+ def configure
24
+ self.configuration ||= Configuration.new
25
+ yield(configuration)
26
+ end
27
+ end
28
+
29
+ configure {}
6
30
  end
7
31
  end
32
+ Metanorma::Registry.instance.register(Metanorma::M3AAWG::Processor)
33
+
@@ -2,15 +2,10 @@ require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
4
  module M3AAWG
5
- def self.fonts_used
6
- {
7
- html: ["Overpass", "Space Mono"],
8
- doc: ["Garamond", "Courier New"],
9
- pdf: ["Garamond", "Courier New"]
10
- }
11
- end
12
-
13
- class Processor < Metanorma::Processor
5
+ class Processor < Metanorma::Generic::Processor
6
+ def configuration
7
+ Metanorma::Ribose.configuration
8
+ end
14
9
 
15
10
  def initialize
16
11
  @short = [:m3d, :m3aawg]
@@ -26,6 +21,18 @@ module Metanorma
26
21
  )
27
22
  end
28
23
 
24
+ def fonts_manifest
25
+ {
26
+ "Arial" => nil,
27
+ "Cambria Math" => nil,
28
+ "Courier" => nil,
29
+ "Courier New" => nil,
30
+ "Garamond" => nil,
31
+ "Overpass" => nil,
32
+ "Space Mono" => nil,
33
+ }
34
+ end
35
+
29
36
  def version
30
37
  "Metanorma::M3AAWG #{Metanorma::M3AAWG::VERSION}"
31
38
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module M3AAWG
3
- VERSION = "1.5.6"
3
+ VERSION = "1.6.4"
4
4
  end
5
5
  end
@@ -31,8 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "htmlentities", "~> 4.3.4"
32
32
  spec.add_dependency "thread_safe"
33
33
 
34
- spec.add_dependency "metanorma-standoc", "~> 1.6.0"
35
- spec.add_dependency "isodoc", "~> 1.2.0"
34
+ spec.add_dependency "metanorma-generic", "~> 1.8.2"
36
35
 
37
36
  spec.add_development_dependency "byebug", "~> 9.1"
38
37
  spec.add_development_dependency "sassc", "~> 2.4.0"
@@ -0,0 +1,51 @@
1
+ metanorma_name: m3aawg
2
+ organization_name_short: M3AAWG
3
+ organization_name_long: Messaging Malware and Mobile Anti-Abuse Working Group
4
+ document_namespace: https://www.metanorma.org/ns/m3d
5
+ xml_root_tag: m3d-standard
6
+ html_bodyfont: '"Overpass",sans-serif'
7
+ html_headerfont: '"Overpass",sans-serif'
8
+ html_monospacefont: '"Space Mono",monospace'
9
+ html_normalfontsize: "15px"
10
+ html_footnotefontsize: "0.9em"
11
+ i18nyaml: lib/isodoc/m3aawg/i18n-en.yaml
12
+ validate_rng_file: lib/asciidoctor/m3aawg/m3d.rng
13
+ htmlcoverpage: lib/isodoc/m3aawg/html/html_m3d_titlepage.html
14
+ htmlintropage: lib/isodoc/m3aawg/html/html_m3d_intro.html
15
+ htmlstylesheet: lib/isodoc/m3aawg/html/htmlstyle.scss
16
+ scripts: lib/isodoc/m3aawg/html/scripts.html
17
+ word_bodyfont: '"Garamond",serif'
18
+ word_headerfont: '"Garamond",serif'
19
+ word_monospacefont: '"Courier New",monospace'
20
+ word_normalfontsize: "11.0pt"
21
+ word_monospacefontsize: "9.0pt"
22
+ word_smallerfontsize: "10.0pt"
23
+ word_footnotefontsize: "10.0pt"
24
+ standardstylesheet: lib/isodoc/m3aawg/html/m3d.scss
25
+ header: lib/isodoc/m3aawg/html/header.html
26
+ wordcoverpage: ""
27
+ wordintropage: lib/isodoc/m3aawg/html/word_m3d_intro.html
28
+ wordstylesheet: lib/isodoc/m3aawg/html/wordstyle.scss
29
+ webfont:
30
+ - "https://fonts.googleapis.com/css?family=Overpass:300,300i,600,900"
31
+ - "https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700"
32
+ docid_template: "{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}{% if docyear %}:{{docyear}}{%endif%}"
33
+ doctypes:
34
+ - policy
35
+ - best-practices
36
+ - supporting-document
37
+ - report
38
+ default_doctype: report
39
+ published_stages:
40
+ - published
41
+ - withdrawn
42
+ default_stage: published
43
+ stage_abbreviations:
44
+ proposal:
45
+ working-draft: wd
46
+ committee-draft: cd
47
+ draft-standard: d
48
+ final-draft:
49
+ published:
50
+ withdrawn:
51
+ logo_path: ""
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-m3aawg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.6
4
+ version: 1.6.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-10-25 00:00:00.000000000 Z
11
+ date: 2021-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -39,33 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: metanorma-standoc
42
+ name: metanorma-generic
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.6.0
47
+ version: 1.8.2
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.6.0
55
- - !ruby/object:Gem::Dependency
56
- name: isodoc
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 1.2.0
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 1.2.0
54
+ version: 1.8.2
69
55
  - !ruby/object:Gem::Dependency
70
56
  name: byebug
71
57
  requirement: !ruby/object:Gem::Requirement
@@ -238,7 +224,6 @@ files:
238
224
  - lib/asciidoctor/m3aawg/isodoc.rng
239
225
  - lib/asciidoctor/m3aawg/m3d.rng
240
226
  - lib/asciidoctor/m3aawg/reqt.rng
241
- - lib/asciidoctor/m3aawg/validate.rb
242
227
  - lib/isodoc/m3aawg/base_convert.rb
243
228
  - lib/isodoc/m3aawg/html/dots-w@2x.png
244
229
  - lib/isodoc/m3aawg/html/dots@2x.png
@@ -271,6 +256,7 @@ files:
271
256
  - lib/metanorma/m3aawg/processor.rb
272
257
  - lib/metanorma/m3aawg/version.rb
273
258
  - metanorma-m3d.gemspec
259
+ - metanorma.yml
274
260
  homepage: https://github.com/metanorma/metanorma-m3aawg
275
261
  licenses:
276
262
  - BSD-2-Clause
@@ -1,22 +0,0 @@
1
- module Asciidoctor
2
- module M3AAWG
3
- class Converter < Standoc::Converter
4
- def content_validate(doc)
5
- super
6
- bibdata_validate(doc.root)
7
- end
8
-
9
- def bibdata_validate(doc)
10
- stage_validate(doc)
11
- end
12
-
13
- def stage_validate(xmldoc)
14
- stage = xmldoc&.at("//bibdata/status/stage")&.text
15
- %w(proposal working-draft committee-draft draft-standard final-draft
16
- published withdrawn).include? stage or
17
- @log.add("Document Attributes", nil, "#{stage} is not a recognised status")
18
- end
19
- end
20
- end
21
- end
22
-