metanorma-ieee 0.0.4 → 0.0.5

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: 62bafd0727fc5b10d3a146196f4317b9d158802d918c7c3a7e407d689348bac9
4
- data.tar.gz: ffd4fbc73ea2b2af25abf3b4b21863e07e79706fc2f2bf8403a75b804e8eb7cf
3
+ metadata.gz: 6c86c6a16bc8dd970b847c292e019e32cccadfc47724d72b4bdc1d6088219f57
4
+ data.tar.gz: ceefc8bc98e602f43a31838d391ea66ce34589bd02e2c012771fd3d18b75f231
5
5
  SHA512:
6
- metadata.gz: 52bc01c58e681f92ed46c3241db36244fbb805d6ec81678e90ad07b5ad9b7c89c1a528fbfbe411af74a9b7d58c01f032b2bdebaaaa7996dc313fe052ba73e7f0
7
- data.tar.gz: 6fb175826c51f3b48ceb6a7b330560f166d358a24412109b09b77f04f84a66bcdc2e75bff43d2d277767257cd619e33265218dd399c47eee842b85799b274ab0
6
+ metadata.gz: e8f6e7048509be967c9e265bd5e30599fe0d329afbf4b48034f9e05d8673c9caaae896c20fa913e38d8c79d3bb293dba2cf87c40b45b39fee6ff69e467055d74
7
+ data.tar.gz: be9a6467394e494473dcdf60b4a1cf2cccff6bcdc997ddf047b26d672929555e62e93b021ae728303f3ffd276e3a008270963e5796a1a09719968b5be93f1988
@@ -4177,6 +4177,9 @@
4177
4177
  <xsl:attribute-set name="import-style">
4178
4178
  </xsl:attribute-set>
4179
4179
 
4180
+ <xsl:attribute-set name="component-style">
4181
+ </xsl:attribute-set>
4182
+
4180
4183
  <xsl:attribute-set name="recommendation-style">
4181
4184
 
4182
4185
  </xsl:attribute-set>
@@ -10109,41 +10112,47 @@
10109
10112
  </fo:block>
10110
10113
  </xsl:template>
10111
10114
 
10112
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
10115
+ <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
10113
10116
  <fo:block xsl:use-attribute-sets="inherit-style">
10114
10117
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
10115
10118
  </fo:block>
10116
10119
  </xsl:template>
10117
10120
 
10118
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
10121
+ <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
10119
10122
  <fo:block xsl:use-attribute-sets="description-style">
10120
10123
  <xsl:apply-templates/>
10121
10124
  </fo:block>
10122
10125
  </xsl:template>
10123
10126
 
10124
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
10127
+ <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
10125
10128
  <fo:block xsl:use-attribute-sets="specification-style">
10126
10129
  <xsl:apply-templates/>
10127
10130
  </fo:block>
10128
10131
  </xsl:template>
10129
10132
 
10130
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
10133
+ <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
10131
10134
  <fo:block xsl:use-attribute-sets="measurement-target-style">
10132
10135
  <xsl:apply-templates/>
10133
10136
  </fo:block>
10134
10137
  </xsl:template>
10135
10138
 
10136
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
10139
+ <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
10137
10140
  <fo:block xsl:use-attribute-sets="verification-style">
10138
10141
  <xsl:apply-templates/>
10139
10142
  </fo:block>
10140
10143
  </xsl:template>
10141
10144
 
10142
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
10145
+ <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
10143
10146
  <fo:block xsl:use-attribute-sets="import-style">
10144
10147
  <xsl:apply-templates/>
10145
10148
  </fo:block>
10146
10149
  </xsl:template>
10150
+
10151
+ <xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
10152
+ <fo:block xsl:use-attribute-sets="component-style">
10153
+ <xsl:apply-templates/>
10154
+ </fo:block>
10155
+ </xsl:template>
10147
10156
  <!-- ========== -->
10148
10157
  <!-- END -->
10149
10158
  <!-- ========== -->
@@ -4177,6 +4177,9 @@
4177
4177
  <xsl:attribute-set name="import-style">
4178
4178
  </xsl:attribute-set>
4179
4179
 
4180
+ <xsl:attribute-set name="component-style">
4181
+ </xsl:attribute-set>
4182
+
4180
4183
  <xsl:attribute-set name="recommendation-style">
4181
4184
 
4182
4185
  </xsl:attribute-set>
@@ -10109,41 +10112,47 @@
10109
10112
  </fo:block>
10110
10113
  </xsl:template>
10111
10114
 
10112
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
10115
+ <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
10113
10116
  <fo:block xsl:use-attribute-sets="inherit-style">
10114
10117
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
10115
10118
  </fo:block>
10116
10119
  </xsl:template>
10117
10120
 
10118
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
10121
+ <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
10119
10122
  <fo:block xsl:use-attribute-sets="description-style">
10120
10123
  <xsl:apply-templates/>
10121
10124
  </fo:block>
10122
10125
  </xsl:template>
10123
10126
 
10124
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
10127
+ <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
10125
10128
  <fo:block xsl:use-attribute-sets="specification-style">
10126
10129
  <xsl:apply-templates/>
10127
10130
  </fo:block>
10128
10131
  </xsl:template>
10129
10132
 
10130
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
10133
+ <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
10131
10134
  <fo:block xsl:use-attribute-sets="measurement-target-style">
10132
10135
  <xsl:apply-templates/>
10133
10136
  </fo:block>
10134
10137
  </xsl:template>
10135
10138
 
10136
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
10139
+ <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
10137
10140
  <fo:block xsl:use-attribute-sets="verification-style">
10138
10141
  <xsl:apply-templates/>
10139
10142
  </fo:block>
10140
10143
  </xsl:template>
10141
10144
 
10142
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
10145
+ <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
10143
10146
  <fo:block xsl:use-attribute-sets="import-style">
10144
10147
  <xsl:apply-templates/>
10145
10148
  </fo:block>
10146
10149
  </xsl:template>
10150
+
10151
+ <xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
10152
+ <fo:block xsl:use-attribute-sets="component-style">
10153
+ <xsl:apply-templates/>
10154
+ </fo:block>
10155
+ </xsl:template>
10147
10156
  <!-- ========== -->
10148
10157
  <!-- END -->
10149
10158
  <!-- ========== -->
@@ -14,7 +14,7 @@ module IsoDoc
14
14
  if %w(techreport standard).include?(bib[:type])
15
15
  node["citeas"] + " #{bib[:ord]}"
16
16
  else
17
- "#{bib[:title]} " + node["citeas"]
17
+ "#{bib[:author]} " + node["citeas"]
18
18
  end
19
19
  end
20
20
 
@@ -25,6 +25,8 @@ module IsoDoc
25
25
  { docid: pref_ref_code(b), type: b["type"],
26
26
  title: (b.at(ns("./title")) ||
27
27
  b.at(ns("./formattedref")))&.text,
28
+ author: @author[b["id"]] || (b.at(ns("./title")) ||
29
+ b.at(ns("./formattedref")))&.text,
28
30
  ord: b.at(ns("./docidentifier[@type = 'metanorma' or "\
29
31
  "@type = 'metanorma-ordinal']")).text }
30
32
  end
@@ -35,13 +37,22 @@ module IsoDoc
35
37
  i18nhash: @i18n.get)
36
38
  end
37
39
 
38
- def bibrender_relaton(xml)
39
- bib = xml.dup
40
- bib["suppress_identifier"] == true and
41
- bib.xpath(ns("./docidentifier")).each(&:remove)
40
+ def citestyle
41
+ "author-date"
42
+ end
43
+
44
+ def references_render(docxml)
45
+ @author = {}
46
+ super
47
+ end
48
+
49
+ def bibrender_relaton(xml, renderings)
50
+ f = renderings[xml["id"]][:formattedref]
51
+ f &&= "<formattedref>#{f}</formattedref>"
42
52
  xml.children =
43
- "#{bibrenderer.render(bib.to_xml)}"\
44
- "#{xml.xpath(ns('./docidentifier | ./uri | ./note | ./title')).to_xml}"
53
+ "#{f}#{xml.xpath(ns('./docidentifier | ./uri | ./note | ./title'))
54
+ .to_xml}"
55
+ @author[xml["id"]] = renderings[xml["id"]][:author]
45
56
  end
46
57
 
47
58
  def creatornames(bibitem)
@@ -1,3 +1,5 @@
1
+ require "isoics"
2
+
1
3
  module Metanorma
2
4
  module IEEE
3
5
  class Converter < Standoc::Converter
@@ -64,7 +66,7 @@ module Metanorma
64
66
 
65
67
  def metadata_status(node, xml)
66
68
  status = node.attr("status") || node.attr("docstage") ||
67
- (node.attr("draft") ? "developing" : "active")
69
+ (node.attr("draft") ? "draft" : "approved")
68
70
  xml.status do |s|
69
71
  s.stage status
70
72
  end
@@ -87,6 +89,17 @@ module Metanorma
87
89
  super + %w(merges updates)
88
90
  end
89
91
 
92
+ def metadata_ics(node, xml)
93
+ ics = node.attr("library-ics")
94
+ ics&.split(/,\s*/)&.each do |i|
95
+ xml.ics {
96
+ |elem| elem.code i
97
+ icsdata = Isoics.fetch i
98
+ elem.text_ icsdata.description
99
+ }
100
+ end
101
+ end
102
+
90
103
  def metadata_ext(node, xml)
91
104
  super
92
105
  structured_id(node, xml)
@@ -14,14 +14,18 @@
14
14
  <value>guide</value>
15
15
  <value>recommended-practice</value>
16
16
  <value>standard</value>
17
+ <value>whitepaper</value>
18
+ <value>redline</value>
19
+ <value>other</value>
17
20
  </choice>
18
21
  </define>
19
22
  <define name="stage">
20
23
  <element name="stage">
21
24
  <choice>
22
- <value>developing</value>
23
- <value>active</value>
24
- <value>inactive</value>
25
+ <value>draft</value>
26
+ <value>approved</value>
27
+ <value>superseded</value>
28
+ <value>withdrawn</value>
25
29
  </choice>
26
30
  </element>
27
31
  </define>
@@ -64,10 +68,59 @@
64
68
  <zeroOrMore>
65
69
  <ref name="ics"/>
66
70
  </zeroOrMore>
71
+ <optional>
72
+ <ref name="standard_status"/>
73
+ </optional>
74
+ <optional>
75
+ <ref name="standard_modified"/>
76
+ </optional>
77
+ <optional>
78
+ <ref name="pubstatus"/>
79
+ </optional>
80
+ <optional>
81
+ <ref name="holdstatus"/>
82
+ </optional>
67
83
  </define>
68
84
  </include>
85
+ <define name="standard_status">
86
+ <element name="standard_status">
87
+ <choice>
88
+ <value>Inactive</value>
89
+ <value>Active</value>
90
+ <value>Superseded</value>
91
+ </choice>
92
+ </element>
93
+ </define>
94
+ <define name="standard_modified">
95
+ <element name="standard_modified">
96
+ <choice>
97
+ <value>Draft</value>
98
+ <value>Withdrawn</value>
99
+ <value>Superseded</value>
100
+ <value>Approved</value>
101
+ <value>Reserved</value>
102
+ <value>Redline</value>
103
+ </choice>
104
+ </element>
105
+ </define>
106
+ <define name="pubstatus">
107
+ <element name="pubstatus">
108
+ <choice>
109
+ <value>Active</value>
110
+ <value>Inactive</value>
111
+ </choice>
112
+ </element>
113
+ </define>
114
+ <define name="holdstatus">
115
+ <element name="holdstatus">
116
+ <choice>
117
+ <value>Hold</value>
118
+ <value>Publish</value>
119
+ </choice>
120
+ </element>
121
+ </define>
69
122
  <define name="BibliographicDateType" combine="choice">
70
- <value>feecback-ended</value>
123
+ <value>feedback-ended</value>
71
124
  </define>
72
125
  <define name="trialuse">
73
126
  <element name="trial-use">
@@ -29,7 +29,8 @@ module Metanorma
29
29
 
30
30
  def doctype_validate(xmldoc)
31
31
  doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
32
- %w(standard recommended-practice guide).include? doctype or
32
+ %w(standard recommended-practice guide whitepaper redline other)
33
+ .include? doctype or
33
34
  @log.add("Document Attributes", nil,
34
35
  "#{doctype} is not a recognised document type")
35
36
  docsubtype = xmldoc&.at("//bibdata/ext/subdoctype")&.text or return
@@ -40,7 +41,7 @@ module Metanorma
40
41
 
41
42
  def stage_validate(xmldoc)
42
43
  stage = xmldoc&.at("//bibdata/status/stage")&.text
43
- %w(active inactive developing).include? stage or
44
+ %w(draft approved superseded withdrawn).include? stage or
44
45
  @log.add("Document Attributes", nil,
45
46
  "#{stage} is not a recognised stage")
46
47
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IEEE
3
- VERSION = "0.0.4".freeze
3
+ VERSION = "0.0.5".freeze
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  nametemplate:
2
- one: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} ,_{{initials[0] | join: '. '}}.{% endif %}"
2
+ one: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} ,_{{initials[0] | join: '. '}} {% endif %}"
3
3
  two: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} ,_{{initials[0] | join: '. '}}.{% endif %} , {{ labels['and'] }} {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{initials[1] | join: '. '}}. {{surname[1] }}{% endif %}"
4
4
  more: "{% if nonpersonal[0] %}{{ nonpersonal[0] }}{% else %}{{surname[0] }} ,_{{initials[0] | join: '. '}}.{% endif %} , {% if nonpersonal[1] %}{{ nonpersonal[1] }}{% else %}{{initials[1] | join: '. '}}. {{surname[1] }}{% endif %} , {{ labels['and'] }} {% if nonpersonal[2] %}{{ nonpersonal[2] }}{% else %}{{initials[2] | join: '. '}}. {{surname[2] }}{% endif %}"
5
5
  extenttemplate:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc