metanorma-csa 1.6.6 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,7 +71,7 @@ p.MsoNormal, li.MsoNormal, div.MsoNormal
71
71
  margin:0cm;
72
72
  margin-bottom:12.0pt;
73
73
  mso-pagination:widow-orphan;
74
- font-size:10.5pt;
74
+ font-size:$normalfontsize;
75
75
  font-family:$bodyfont;
76
76
  mso-fareast-font-family:"Times New Roman";
77
77
  mso-ansi-language:EN-US;
@@ -86,7 +86,7 @@ p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
86
86
  /* do not put in margin-left, it is specific to list level */
87
87
  mso-add-space:auto;
88
88
  mso-pagination:widow-orphan;
89
- font-size:10.5pt;
89
+ font-size:$normalfontsize;
90
90
  font-family:$bodyfont;
91
91
  mso-ansi-language:EN-AU;
92
92
  mso-fareast-language:EN-US;}
@@ -101,7 +101,7 @@ p.MsoListParagraphCxSpFirst, li.MsoListParagraphCxSpFirst, div.MsoListParagraphC
101
101
  /* do not put in margin-left, it is specific to list level */
102
102
  mso-add-space:auto;
103
103
  mso-pagination:widow-orphan;
104
- font-size:10.5pt;
104
+ font-size:$normalfontsize;
105
105
  font-family:$bodyfont;
106
106
  mso-ansi-language:EN-AU;
107
107
  mso-fareast-language:EN-US;}
@@ -116,7 +116,7 @@ p.MsoListParagraphCxSpMiddle, li.MsoListParagraphCxSpMiddle, div.MsoListParagrap
116
116
  /* do not put in margin-left, it is specific to list level */
117
117
  mso-add-space:auto;
118
118
  mso-pagination:widow-orphan;
119
- font-size:10.5pt;
119
+ font-size:$normalfontsize;
120
120
  font-family:$bodyfont;
121
121
  mso-ansi-language:EN-AU;
122
122
  mso-fareast-language:EN-US;}
@@ -131,7 +131,7 @@ p.MsoListParagraphCxSpLast, li.MsoListParagraphCxSpLast, div.MsoListParagraphCxS
131
131
  /* do not put in margin-left, it is specific to list level */
132
132
  mso-add-space:auto;
133
133
  mso-pagination:widow-orphan;
134
- font-size:10.5pt;
134
+ font-size:$normalfontsize;
135
135
  font-family:$bodyfont;
136
136
  mso-ansi-language:EN-AU;
137
137
  mso-fareast-language:EN-US;}
@@ -142,7 +142,7 @@ p.MsoCommentText, li.MsoCommentText, div.MsoCommentText
142
142
  margin:0cm;
143
143
  margin-bottom:.0001pt;
144
144
  mso-pagination:widow-orphan;
145
- font-size:10.0pt;
145
+ font-size:$footnotefontsize;
146
146
  font-family:$bodyfont;
147
147
  mso-fareast-font-family:"Times New Roman";
148
148
  mso-ansi-language:EN-US;
@@ -153,7 +153,7 @@ p.MsoHeader, li.MsoHeader, div.MsoHeader
153
153
  margin-bottom:.0001pt;
154
154
  mso-pagination:widow-orphan;
155
155
  tab-stops:center 216.0pt right 482.0pt;
156
- font-size:10.5pt;
156
+ font-size:$normalfontsize;
157
157
  font-family:$bodyfont;
158
158
  mso-fareast-font-family:"Times New Roman";
159
159
  mso-ansi-language:EN-US;
@@ -164,7 +164,7 @@ p.MsoHeaderLandscape, li.MsoHeaderLandscape, div.MsoHeaderLandscape
164
164
  margin-bottom:.0001pt;
165
165
  mso-pagination:widow-orphan;
166
166
  tab-stops:center 367.0pt right 734.0pt;
167
- font-size:10.5pt;
167
+ font-size:$normalfontsize;
168
168
  font-family:$bodyfont;
169
169
  mso-fareast-font-family:"Times New Roman";
170
170
  mso-ansi-language:EN-US;
@@ -175,7 +175,7 @@ p.MsoFooter, li.MsoFooter, div.MsoFooter
175
175
  margin-bottom:.0001pt;
176
176
  mso-pagination:widow-orphan;
177
177
  tab-stops:right 482.0pt;
178
- font-size:10.5pt;
178
+ font-size:$normalfontsize;
179
179
  font-family:$bodyfont;
180
180
  mso-fareast-font-family:"Times New Roman";
181
181
  mso-ansi-language:EN-US;
@@ -186,7 +186,7 @@ p.MsoFooterLandscape, li.MsoFooterLandscape, div.MsoFooterLandscape
186
186
  margin-bottom:.0001pt;
187
187
  mso-pagination:widow-orphan;
188
188
  tab-stops:right 734.0pt;
189
- font-size:10.5pt;
189
+ font-size:$normalfontsize;
190
190
  font-family:$bodyfont;
191
191
  mso-fareast-font-family:"Times New Roman";
192
192
  mso-ansi-language:EN-US;
@@ -306,7 +306,7 @@ p.MsoCommentSubject, li.MsoCommentSubject, div.MsoCommentSubject
306
306
  margin:0cm;
307
307
  margin-bottom:.0001pt;
308
308
  mso-pagination:widow-orphan;
309
- font-size:10.0pt;
309
+ font-size:$footnotefontsize;
310
310
  font-family:$bodyfont;
311
311
  mso-fareast-font-family:"Times New Roman";
312
312
  mso-ansi-language:EN-US;
@@ -567,7 +567,7 @@ p.MsoToc1, li.MsoToc1, div.MsoToc1
567
567
  mso-pagination:widow-orphan;
568
568
  mso-hyphenate:none;
569
569
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
570
- font-size:10.5pt;
570
+ font-size:$normalfontsize;
571
571
  font-family:$bodyfont;
572
572
  mso-fareast-font-family:$bodyfont;
573
573
  mso-bidi-font-family:$bodyfont;
@@ -590,7 +590,7 @@ p.MsoToc2, li.MsoToc2, div.MsoToc2
590
590
  mso-pagination:widow-orphan;
591
591
  mso-hyphenate:none;
592
592
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
593
- font-size:10.5pt;
593
+ font-size:$normalfontsize;
594
594
  font-family:$bodyfont;
595
595
  mso-fareast-font-family:$bodyfont;
596
596
  mso-bidi-font-family:$bodyfont;
@@ -613,7 +613,7 @@ p.MsoToc3, li.MsoToc3, div.MsoToc3
613
613
  mso-pagination:widow-orphan;
614
614
  mso-hyphenate:none;
615
615
  tab-stops:20.15pt 36.0pt right dotted 487.6pt;
616
- font-size:10.5pt;
616
+ font-size:$normalfontsize;
617
617
  font-family:$bodyfont;
618
618
  mso-fareast-font-family:$bodyfont;
619
619
  mso-bidi-font-family:$bodyfont;
@@ -635,7 +635,7 @@ p.MsoFootnoteText, li.MsoFootnoteText, div.MsoFootnoteText
635
635
  line-height:12.0pt;
636
636
  mso-pagination:widow-orphan;
637
637
  tab-stops:20.15pt;
638
- font-size:10.0pt;
638
+ font-size:$footnotefontsize;
639
639
  font-family:$bodyfont;
640
640
  mso-fareast-font-family:$bodyfont;
641
641
  mso-bidi-font-family:$bodyfont;
@@ -653,7 +653,7 @@ p.MsoBodyText, li.MsoBodyText, div.MsoBodyText
653
653
  text-align:justify;
654
654
  line-height:12.0pt;
655
655
  mso-pagination:widow-orphan;
656
- font-size:10.5pt;
656
+ font-size:$normalfontsize;
657
657
  font-family:$bodyfont;
658
658
  mso-fareast-font-family:$bodyfont;
659
659
  mso-bidi-font-family:$bodyfont;
@@ -762,9 +762,9 @@ p.Tablebody, li.Tablebody, div.Tablebody
762
762
  margin-right:0cm;
763
763
  margin-bottom:3.0pt;
764
764
  margin-left:0cm;
765
- line-height:10.5pt;
765
+ line-height:$normalfontsize;
766
766
  mso-pagination:widow-orphan;
767
- font-size:10.0pt;
767
+ font-size:$smallerfontsize;
768
768
  mso-bidi-font-size:11.0pt;
769
769
  font-family:$bodyfont;
770
770
  mso-fareast-font-family:$bodyfont;
@@ -1147,7 +1147,7 @@ table.MsoNormalTable
1147
1147
  mso-para-margin:0cm;
1148
1148
  mso-para-margin-bottom:.0001pt;
1149
1149
  mso-pagination:widow-orphan;
1150
- font-size:10.0pt;
1150
+ font-size:$smallerfontsize;
1151
1151
  font-family:$bodyfont;}
1152
1152
  ol
1153
1153
  {margin-bottom:0cm;
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'base_convert'
4
+ require "isodoc/generic/html_convert"
4
5
  require_relative 'init'
5
6
  require 'isodoc'
6
7
 
@@ -8,49 +9,7 @@ module IsoDoc
8
9
  module Csa
9
10
  # A {Converter} implementation that generates CSA output, and a document
10
11
  # schema encapsulation of the document for validation
11
- class HtmlConvert < IsoDoc::HtmlConvert
12
- def initialize(options)
13
- @libdir = File.dirname(__FILE__)
14
- super
15
- end
16
-
17
- def default_fonts(options)
18
- is_hans = options[:script] == 'Hans'
19
- {
20
- bodyfont: (is_hans ? '"SimSun",serif' : 'AzoSans,"Source Sans Pro",sans-serif'),
21
- headerfont: (is_hans ? '"SimHei",sans-serif'
22
- : 'AzoSans,"Source Sans Pro",sans-serif'),
23
- monospacefont: '"Source Code Pro",monospace'
24
- }
25
- end
26
-
27
- def default_file_locations(options)
28
- {
29
- htmlstylesheet: html_doc_path('htmlstyle.scss'),
30
- htmlcoverpage: html_doc_path('html_csa_titlepage.html'),
31
- htmlintropage: html_doc_path('html_csa_intro.html'),
32
- scripts: html_doc_path('scripts.html')
33
- }
34
- end
35
-
36
- def googlefonts()
37
- <<~HEAD.freeze
38
- <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700" rel="stylesheet">
39
- <link href="https://fonts.googleapis.com/css?family=Rubik:300,300i,500" rel="stylesheet">
40
- <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,700,900" rel="stylesheet">
41
- <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,300;0,600;1,300;1,600&display=swap" rel="stylesheet">
42
- HEAD
43
- end
44
-
45
- def make_body(xml, docxml)
46
- body_attr = { lang: 'EN-US', link: 'blue', vlink: '#954F72',
47
- 'xml:lang': 'EN-US', class: 'container' }
48
- xml.body **body_attr do |body|
49
- make_body1(body, docxml)
50
- make_body2(body, docxml)
51
- make_body3(body, docxml)
52
- end
53
- end
12
+ class HtmlConvert < IsoDoc::Generic::HtmlConvert
54
13
 
55
14
  include BaseConvert
56
15
  include Init
@@ -1,9 +1,8 @@
1
1
  module IsoDoc
2
2
  module Csa
3
- class I18n < IsoDoc::I18n
4
- def load_yaml1(lang, script)
5
- y = YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
6
- super.merge(y)
3
+ class I18n < IsoDoc::Generic::I18n
4
+ def configuration
5
+ Metanorma::Csa.configuration
7
6
  end
8
7
  end
9
8
  end
@@ -6,9 +6,9 @@ module IsoDoc
6
6
  module Csa
7
7
  # A {Converter} implementation that generates CSA output, and a document
8
8
  # schema encapsulation of the document for validation
9
- class Metadata < IsoDoc::Metadata
10
- def initialize(lang, script, labels)
11
- super
9
+ class Metadata < IsoDoc::Generic::Metadata
10
+ def configuration
11
+ Metanorma::Csa.configuration
12
12
  end
13
13
 
14
14
  def title(isoxml, _out)
@@ -27,22 +27,11 @@ module IsoDoc
27
27
  super
28
28
  end
29
29
 
30
-
31
30
  def docid(isoxml, _out)
32
31
  docnumber = isoxml.at(ns("//bibdata/docidentifier[@type = 'csa']"))
33
32
  set(:docnumber, docnumber&.text)
34
33
  end
35
34
 
36
- def stage_abbr(status)
37
- case status
38
- when "working-draft" then "wd"
39
- when "committee-draft" then "cd"
40
- when "draft-standard" then "d"
41
- else
42
- ""
43
- end
44
- end
45
-
46
35
  def personal_authors(isoxml)
47
36
  persons = auth_roles(isoxml, nonauth_roles(isoxml, {}))
48
37
  set(:roles_authors_affiliations, persons)
@@ -72,10 +61,6 @@ module IsoDoc
72
61
  end
73
62
  persons
74
63
  end
75
-
76
- def unpublished(status)
77
- !%w(published withdrawn).include? status.downcase
78
- end
79
64
  end
80
65
  end
81
66
  end
@@ -1,9 +1,10 @@
1
1
  require_relative "init"
2
+ require "metanorma-generic"
2
3
  require "isodoc"
3
4
 
4
5
  module IsoDoc
5
6
  module Csa
6
- class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
7
+ class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
7
8
  def annex1(f)
8
9
  lbl = @xrefs.anchor(f['id'], :label)
9
10
  if t = f.at(ns("./title"))
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'base_convert'
4
+ require "isodoc/generic/word_convert"
4
5
  require_relative 'init'
5
6
  require 'isodoc'
6
7
 
@@ -9,31 +10,6 @@ module IsoDoc
9
10
  # A {Converter} implementation that generates CSA output, and a document
10
11
  # schema encapsulation of the document for validation
11
12
  class WordConvert < IsoDoc::WordConvert
12
- def initialize(options)
13
- @libdir = File.dirname(__FILE__)
14
- super
15
- end
16
-
17
- def default_fonts(options)
18
- is_hans = options[:script] == 'Hans'
19
- {
20
- bodyfont: (is_hans ? '"SimSun",serif' : 'AzoSans,Arial,sans-serif'),
21
- headerfont: (is_hans ? '"SimHei",sans-serif' : 'AzoSans,Arial,sans-serif'),
22
- monospacefont: '"Source Code Pro","Courier New",monospace'
23
- }
24
- end
25
-
26
- def default_file_locations(options)
27
- {
28
- wordstylesheet: html_doc_path('wordstyle.scss'),
29
- standardstylesheet: html_doc_path('csa.scss'),
30
- header: html_doc_path('header.html'),
31
- wordcoverpage: html_doc_path('word_csa_titlepage.html'),
32
- wordintropage: html_doc_path('word_csa_intro.html'),
33
- ulstyle: 'l3',
34
- olstyle: 'l2'
35
- }
36
- end
37
13
 
38
14
  include BaseConvert
39
15
  include Init
@@ -1,6 +1,6 @@
1
1
  module IsoDoc
2
2
  module Csa
3
- class Xref < IsoDoc::Xref
3
+ class Xref < IsoDoc::Generic::Xref
4
4
  end
5
5
  end
6
6
  end
@@ -1,7 +1,32 @@
1
- require_relative 'csa/processor'
1
+ require "metanorma"
2
+ require "metanorma-generic"
3
+ require_relative './csa/processor'
2
4
 
3
5
  module Metanorma
4
6
  module Csa
7
+ class Configuration < Metanorma::Generic::Configuration
8
+ def initialize(*args)
9
+ super
10
+ end
11
+ end
5
12
 
13
+ class << self
14
+ extend Forwardable
15
+
16
+ attr_accessor :configuration
17
+
18
+ Configuration::CONFIG_ATTRS.each do |attr_name|
19
+ def_delegator :@configuration, attr_name
20
+ end
21
+
22
+ def configure
23
+ self.configuration ||= Configuration.new
24
+ yield(configuration)
25
+ end
26
+ end
27
+
28
+ configure {}
6
29
  end
7
30
  end
31
+ Metanorma::Registry.instance.register(Metanorma::Csa::Processor)
32
+
@@ -1,24 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'metanorma/processor'
4
- require 'asciidoctor/csa/converter'
5
4
 
6
5
  module Metanorma
7
6
  module Csa
8
- def self.fonts_used
9
- {
10
- html: %w(AzoSans AzoSans-Light SourceCodePro-Light),
11
- doc: %w(AzoSans AzoSans-Light SourceCodePro-Light),
12
- pdf: %w(AzoSans AzoSans-Light SourceCodePro-Light)
13
- }
14
- end
15
-
16
7
  class Processor < Metanorma::Processor
17
8
 
18
9
  def initialize
19
10
  @short = :csa
20
11
  @input_format = :asciidoc
21
- @asciidoctor_backend = Asciidoctor::Csa::CSA_TYPE.to_sym
12
+ @asciidoctor_backend = :csa
22
13
  end
23
14
 
24
15
  def output_formats
@@ -29,6 +20,14 @@ module Metanorma
29
20
  )
30
21
  end
31
22
 
23
+ def fonts_manifest
24
+ {
25
+ "AzoSans" => nil,
26
+ "STIX Two Math" => nil,
27
+ "Source Code Pro" => nil,
28
+ }
29
+ end
30
+
32
31
  def version
33
32
  "Metanorma::Csa #{Metanorma::Csa::VERSION}"
34
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Metanorma
4
4
  module Csa
5
- VERSION = '1.6.6'
5
+ VERSION = '1.7.2'
6
6
  end
7
7
  end
@@ -28,16 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.require_paths = ["lib"]
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
- spec.add_dependency "htmlentities", "~> 4.3.4"
32
- spec.add_dependency "image_size"
33
- spec.add_dependency "mime-types"
34
- #spec.add_dependency "nokogiri"
35
- spec.add_dependency "ruby-jing"
36
- spec.add_dependency "thread_safe"
37
- spec.add_dependency "uuidtools"
38
-
39
- spec.add_dependency "metanorma-standoc", "~> 1.6.0"
40
- spec.add_dependency "isodoc", "~> 1.2.0"
31
+ spec.add_dependency "metanorma-generic", "~> 1.8.2"
41
32
 
42
33
  spec.add_development_dependency "byebug", "~> 9.1"
43
34
  spec.add_development_dependency "sassc", "2.4.0"
@@ -0,0 +1,60 @@
1
+ metanorma_name: csa
2
+ organization_name_short: CSA
3
+ organization_name_long: Cloud Security Alliance
4
+ document_namespace: https://www.metanorma.org/ns/csa
5
+ xml_root_tag: csa-standard
6
+ html_bodyfont: 'AzoSans,"Source Sans Pro",sans-serif'
7
+ html_headerfont: 'AzoSans,"Source Sans Pro",sans-serif'
8
+ html_monospacefont: '"Source Code Pro",monospace'
9
+ validate_rng_file: lib/asciidoctor/csa/csa.rng
10
+ htmlcoverpage: lib/isodoc/csa/html/html_csa_titlepage.html
11
+ htmlintropage: lib/isodoc/csa/html/html_csa_intro.html
12
+ htmlstylesheet: lib/isodoc/csa/html/htmlstyle.scss
13
+ html_normalfontsize: "1.2em"
14
+ html_monospacefontsize: "1.0em"
15
+ html_footnotefontsize: "0.9em"
16
+ scripts: lib/isodoc/csa/html/scripts.html
17
+ i18nyaml: lib/isodoc/csa/i18n-en.yaml
18
+ word_bodyfont: 'AzoSans,Arial,sans-serif'
19
+ word_headerfont: 'AzoSans,Arial,sans-serif'
20
+ word_monospacefont: '"Source Code Pro","Courier New",monospace'
21
+ word_normalfontsize: "10.5pt"
22
+ word_smallerfontsize: "10.0pt"
23
+ word_monospacefontsize: "10.0pt"
24
+ word_footnotefontsize: "10.0pt"
25
+ standardstylesheet: lib/isodoc/csa/html/csa.scss
26
+ header: lib/isodoc/csa/html/header.html
27
+ wordcoverpage: lib/isodoc/csa/html/word_csa_titlepage.html
28
+ wordintropage: lib/isodoc/csa/html/word_csa_intro.html
29
+ wordstylesheet: lib/isodoc/csa/html/wordstyle.scss
30
+ webfont:
31
+ - "https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i|Space+Mono:400,700"
32
+ - "https://fonts.googleapis.com/css?family=Rubik:300,300i,500"
33
+ - "https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,300i,400,700,900"
34
+ - "https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,300;0,600;1,300;1,600&display=swap"
35
+ docid_template: "{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}{% if docyear %}:{{docyear}}{%endif%}"
36
+ doctypes:
37
+ standard:
38
+ guidance:
39
+ proposal:
40
+ report:
41
+ whitepaper:
42
+ charter:
43
+ policy:
44
+ glossary:
45
+ case-study:
46
+ default_doctype: standard
47
+ published_stages:
48
+ - published
49
+ - withdrawn
50
+ default_stage: published
51
+ stage_abbreviations:
52
+ proposal:
53
+ working-draft: wd
54
+ committee-draft: cd
55
+ draft-standard: d
56
+ final-draft:
57
+ published:
58
+ withdrawn:
59
+ logo_path: ""
60
+