metanorma-iso 1.3.23 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +8 -0
  3. data/.github/workflows/ubuntu.yml +8 -0
  4. data/.github/workflows/windows.yml +8 -0
  5. data/lib/asciidoctor/iso/base.rb +26 -13
  6. data/lib/asciidoctor/iso/biblio.rng +36 -6
  7. data/lib/asciidoctor/iso/cleanup.rb +20 -3
  8. data/lib/asciidoctor/iso/front.rb +16 -107
  9. data/lib/asciidoctor/iso/front_id.rb +196 -0
  10. data/lib/asciidoctor/iso/isodoc.rng +450 -4
  11. data/lib/asciidoctor/iso/isostandard-amd.rng +98 -0
  12. data/lib/asciidoctor/iso/isostandard.rng +12 -1
  13. data/lib/asciidoctor/iso/macros.rb +21 -0
  14. data/lib/asciidoctor/iso/reqt.rng +23 -0
  15. data/lib/asciidoctor/iso/section.rb +18 -32
  16. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +87 -0
  17. data/lib/asciidoctor/iso/validate.rb +41 -25
  18. data/lib/asciidoctor/iso/validate_requirements.rb +1 -1
  19. data/lib/asciidoctor/iso/validate_section.rb +2 -2
  20. data/lib/asciidoctor/iso/validate_style.rb +6 -5
  21. data/lib/asciidoctor/iso/validate_title.rb +1 -1
  22. data/lib/isodoc/iso/base_convert.rb +67 -99
  23. data/lib/isodoc/iso/html/header.html +10 -6
  24. data/lib/isodoc/iso/html/html_iso_titlepage.html +25 -16
  25. data/lib/isodoc/iso/html/isodoc.scss +25 -0
  26. data/lib/isodoc/iso/html/scripts.html +18 -0
  27. data/lib/isodoc/iso/html/style-human.scss +23 -0
  28. data/lib/isodoc/iso/html/style-iso.scss +18 -0
  29. data/lib/isodoc/iso/html/word_iso_intro.html +4 -0
  30. data/lib/isodoc/iso/html/word_iso_titlepage.html +21 -0
  31. data/lib/isodoc/iso/html/wordstyle.scss +45 -4
  32. data/lib/isodoc/iso/html_convert.rb +7 -0
  33. data/lib/isodoc/iso/iso.amendment.xsl +5082 -0
  34. data/lib/isodoc/iso/iso.international-standard.xsl +1899 -796
  35. data/lib/isodoc/iso/metadata.rb +69 -23
  36. data/lib/isodoc/iso/pdf_convert.rb +5 -11
  37. data/lib/isodoc/iso/presentation_xml_convert.rb +13 -0
  38. data/lib/isodoc/iso/sections.rb +66 -0
  39. data/lib/isodoc/iso/sts_convert.rb +31 -0
  40. data/lib/isodoc/iso/xref.rb +111 -0
  41. data/lib/metanorma-iso.rb +2 -0
  42. data/lib/metanorma/iso/processor.rb +23 -8
  43. data/lib/metanorma/iso/version.rb +1 -1
  44. data/metanorma-iso.gemspec +5 -2
  45. data/spec/asciidoctor-iso/amd_spec.rb +726 -0
  46. data/spec/asciidoctor-iso/base_spec.rb +31 -21
  47. data/spec/asciidoctor-iso/blocks_spec.rb +6 -6
  48. data/spec/asciidoctor-iso/cleanup_spec.rb +15 -15
  49. data/spec/asciidoctor-iso/inline_spec.rb +1 -1
  50. data/spec/asciidoctor-iso/macros_spec.rb +289 -0
  51. data/spec/asciidoctor-iso/refs_spec.rb +5 -5
  52. data/spec/asciidoctor-iso/section_spec.rb +8 -8
  53. data/spec/asciidoctor-iso/table_spec.rb +1 -1
  54. data/spec/isodoc/amd_spec.rb +652 -0
  55. data/spec/isodoc/blocks_spec.rb +112 -27
  56. data/spec/isodoc/i18n_spec.rb +8 -8
  57. data/spec/isodoc/inline_spec.rb +4 -4
  58. data/spec/isodoc/iso_spec.rb +1 -1
  59. data/spec/isodoc/metadata_spec.rb +90 -4
  60. data/spec/isodoc/postproc_spec.rb +11 -116
  61. data/spec/isodoc/ref_spec.rb +9 -9
  62. data/spec/isodoc/section_spec.rb +33 -6
  63. data/spec/isodoc/table_spec.rb +29 -29
  64. data/spec/isodoc/terms_spec.rb +4 -4
  65. data/spec/isodoc/xref_spec.rb +34 -28
  66. data/spec/metanorma/processor_spec.rb +2 -2
  67. data/spec/spec_helper.rb +11 -0
  68. metadata +63 -12
  69. data/asciidoctor-iso.gemspec.old +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e8cbb045e33e2e3403dffc3beac4df18852c29f0bb18edbf579f919ba7923b0
4
- data.tar.gz: e38bf3e9fd8169b4ec39110360497a839690d2aed836f80b5033f0c5fc432cba
3
+ metadata.gz: cf7373ffbae98a68238da9522616ea93b1f80ed8c927351146bba35e3b55d8d3
4
+ data.tar.gz: 88c3f55c85d8bd6896f70fb8e5d049a23bef8b78ee5fb0dc3013dcdd9352cdd0
5
5
  SHA512:
6
- metadata.gz: 5ab999ee188ea2819dfe7a7c50192a96a7dfb2353d28ba3790033846d120f5b262c137bf5cfe5ed29f0dfd3e2129d4a2dad031d1d9974b6cf5bfb4e198dc40c3
7
- data.tar.gz: c2da9c1dcded9f65252718d00a22c6195f4a403477a91a3dba51572025ee3aaebbcf02e888301b04b461c938498fe5435c62ff0209b3705c57406bdaa903685f
6
+ metadata.gz: ec1b451def873895ba8d1d92f87ac2bfe3820312dbc36533df5115421b89fd7ac3d1ecd8ec8720c29c8070f210f6c1af1b554360cf668c0fa5a921ee8232d10b
7
+ data.tar.gz: bf7f4b814a7dfbd3c7daf1f3845ec2da2b0ee3bcb04494eb0b2a5c5346011819d1c386a553250d65cb84b305dde0ffe866f9d7b40ce167390fdfd1274b6824b0
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/ubuntu.yml
11
+ - .github/workflows/windows.yml
9
12
 
10
13
  jobs:
11
14
  test-macos:
12
15
  name: Test on Ruby ${{ matrix.ruby }} macOS
13
16
  runs-on: macos-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/windows.yml
9
12
 
10
13
  jobs:
11
14
  test-linux:
12
15
  name: Test on Ruby ${{ matrix.ruby }} Ubuntu
13
16
  runs-on: ubuntu-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -6,15 +6,23 @@ on:
6
6
  push:
7
7
  branches: [ master ]
8
8
  pull_request:
9
+ paths-ignore:
10
+ - .github/workflows/macos.yml
11
+ - .github/workflows/ubuntu.yml
9
12
 
10
13
  jobs:
11
14
  test-windows:
12
15
  name: Test on Ruby ${{ matrix.ruby }} Windows
13
16
  runs-on: windows-latest
17
+ continue-on-error: ${{ matrix.experimental }}
14
18
  strategy:
15
19
  fail-fast: false
16
20
  matrix:
17
21
  ruby: [ '2.6', '2.5', '2.4' ]
22
+ experimental: [false]
23
+ include:
24
+ - ruby: '2.7'
25
+ experimental: true
18
26
  steps:
19
27
  - uses: actions/checkout@master
20
28
  - name: Use Ruby
@@ -6,6 +6,7 @@ require "open-uri"
6
6
  require "pp"
7
7
  require "isodoc"
8
8
  require "fileutils"
9
+ require 'asciidoctor/iso/macros'
9
10
 
10
11
  module Asciidoctor
11
12
  module ISO
@@ -13,6 +14,10 @@ module Asciidoctor
13
14
  XML_ROOT_TAG = "iso-standard".freeze
14
15
  XML_NAMESPACE = "https://www.metanorma.org/ns/iso".freeze
15
16
 
17
+ Asciidoctor::Extensions.register do
18
+ inline_macro Asciidoctor::Iso::TermRefInlineMacro
19
+ end
20
+
16
21
  def html_converter(node)
17
22
  IsoDoc::Iso::HtmlConvert.new(html_extract_attributes(node))
18
23
  end
@@ -31,20 +36,28 @@ module Asciidoctor
31
36
  IsoDoc::Iso::PdfConvert.new(doc_extract_attributes(node))
32
37
  end
33
38
 
34
- def document(node)
35
- init(node)
36
- ret = makexml(node).to_xml(indent: 2)
37
- unless node.attr("nodoc") || !node.attr("docfile")
39
+ def sts_converter(node)
40
+ return nil if node.attr("no-pdf")
41
+ IsoDoc::Iso::StsConvert.new(html_extract_attributes(node))
42
+ end
43
+
44
+ def presentation_xml_converter(node)
45
+ IsoDoc::Iso::PresentationXMLConvert.new(html_extract_attributes(node))
46
+ end
47
+
48
+ def init(node)
49
+ super
50
+ @amd = %w(amendment technical-corrigendum).include? node.attr("doctype")
51
+ end
52
+
53
+ def outputs(node, ret)
38
54
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
39
- html_converter_alt(node).convert(@filename + ".xml")
40
- FileUtils.mv "#{@filename}.html", "#{@filename}_alt.html"
41
- html_converter(node).convert(@filename + ".xml")
42
- doc_converter(node).convert(@filename + ".xml")
43
- pdf_converter(node)&.convert(@filename + ".xml")
44
- end
45
- @log.write(@localdir + @filename + ".err") unless @novalid
46
- @files_to_delete.each { |f| FileUtils.rm f }
47
- ret
55
+ presentation_xml_converter(node).convert(@filename + ".xml")
56
+ html_converter_alt(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}_alt.html")
57
+ html_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.html")
58
+ doc_converter(node).convert(@filename + ".presentation.xml", nil, false, "#{@filename}.doc")
59
+ pdf_converter(node)&.convert(@filename + ".presentation.xml", nil, false, "#{@filename}.pdf")
60
+ #sts_converter(node)&.convert(@filename + ".xml")
48
61
  end
49
62
 
50
63
  def load_yaml(lang, script)
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -512,7 +532,7 @@
512
532
  </define>
513
533
  <define name="LocalityType">
514
534
  <data type="string">
515
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|locality:[a-zA-Z0-9_]+</param>
535
+ <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
516
536
  </data>
517
537
  </define>
518
538
  <define name="referenceFrom">
@@ -641,9 +661,9 @@
641
661
  <optional>
642
662
  <ref name="status"/>
643
663
  </optional>
644
- <optional>
664
+ <zeroOrMore>
645
665
  <ref name="copyright"/>
646
- </optional>
666
+ </zeroOrMore>
647
667
  <zeroOrMore>
648
668
  <ref name="docrelation"/>
649
669
  </zeroOrMore>
@@ -1001,7 +1021,17 @@
1001
1021
  <optional>
1002
1022
  <ref name="to"/>
1003
1023
  </optional>
1004
- <ref name="owner"/>
1024
+ <oneOrMore>
1025
+ <ref name="owner"/>
1026
+ </oneOrMore>
1027
+ <optional>
1028
+ <ref name="copyright_scope"/>
1029
+ </optional>
1030
+ </element>
1031
+ </define>
1032
+ <define name="copyright_scope">
1033
+ <element name="scope">
1034
+ <text/>
1005
1035
  </element>
1006
1036
  </define>
1007
1037
  <define name="from">
@@ -5,6 +5,7 @@ require "json"
5
5
  require "pathname"
6
6
  require "open-uri"
7
7
  require "pp"
8
+ require "asciidoctor/iso/term_lookup_cleanup"
8
9
 
9
10
  module Asciidoctor
10
11
  module ISO
@@ -13,12 +14,12 @@ module Asciidoctor
13
14
  "//clause[title = 'Scope']//fn".freeze
14
15
 
15
16
  NORMREF_FOOTNOTES =
16
- "//references[title = 'Normative References']//fn".freeze
17
+ "//references[@normative = 'true']//fn".freeze
17
18
 
18
19
  POST_NORMREF_FOOTNOTES =
19
20
  "//sections//clause[not(title = 'Scope')]//fn | "\
20
21
  "//annex//fn | "\
21
- "//references[title = 'Bibliography']//fn".freeze
22
+ "//references[@normative = 'false']//fn".freeze
22
23
 
23
24
  def other_footnote_renumber(xmldoc)
24
25
  seen = {}
@@ -35,6 +36,7 @@ module Asciidoctor
35
36
  end
36
37
 
37
38
  def id_prefix(prefix, id)
39
+ return id.text if @amd # we're just inheriting the prefixes from parent doc
38
40
  prefix.join("/") + ( id.text.match(%{^/}) ? "" : " " ) + id.text
39
41
  end
40
42
 
@@ -51,12 +53,14 @@ module Asciidoctor
51
53
  # ISO as a prefix goes first
52
54
  def docidentifier_cleanup(xmldoc)
53
55
  prefix = get_id_prefix(xmldoc)
54
- id = xmldoc.at("//bibdata/docidentifier[@type = 'iso']") or return
56
+ id = xmldoc.at("//bibdata/docidentifier[@type = 'ISO']") or return
55
57
  id.content = id_prefix(prefix, id)
56
58
  id = xmldoc.at("//bibdata/ext/structuredidentifier/project-number") and
57
59
  id.content = id_prefix(prefix, id)
58
60
  id = xmldoc.at("//bibdata/docidentifier[@type = 'iso-with-lang']") and
59
61
  id.content = id_prefix(prefix, id)
62
+ id = xmldoc.at("//bibdata/docidentifier[@type = 'iso-reference']") and
63
+ id.content = id_prefix(prefix, id)
60
64
  end
61
65
 
62
66
  def format_ref(ref, type, isopub)
@@ -86,6 +90,11 @@ module Asciidoctor
86
90
  end
87
91
  end
88
92
 
93
+ def termdef_cleanup(xmldoc)
94
+ Asciidoctor::ISO::TermLookupCleanup.new(xmldoc, @log).call
95
+ super
96
+ end
97
+
89
98
  # TODO sort by authors
90
99
  # sort by: doc class (ISO, IEC, other standard (not DOI &c), other
91
100
  # then standard class (docid class other than DOI &c)
@@ -108,6 +117,14 @@ module Asciidoctor
108
117
  "#{num.nil? ? abbrid : sprintf("%09d", num.to_i)} :: "\
109
118
  "#{partid} :: #{id&.text} :: #{title}"
110
119
  end
120
+
121
+ def sections_cleanup(x)
122
+ super
123
+ return unless @amd
124
+ x.xpath("//*[@inline-header]").each do |h|
125
+ h.delete('inline-header')
126
+ end
127
+ end
111
128
  end
112
129
  end
113
130
  end
@@ -5,110 +5,18 @@ require "json"
5
5
  require "pathname"
6
6
  require "open-uri"
7
7
  require "pp"
8
+ require_relative "front_id"
8
9
 
9
10
  module Asciidoctor
10
11
  module ISO
11
12
  class Converter < Standoc::Converter
12
- STAGE_ABBRS = {
13
- "00": "PWI",
14
- "10": "NWIP",
15
- "20": "WD",
16
- "30": "CD",
17
- "40": "DIS",
18
- "50": "FDIS",
19
- "60": "IS",
20
- "90": "(Review)",
21
- "95": "(Withdrawal)",
22
- }.freeze
23
-
24
- STAGE_NAMES = {
25
- "00": "Preliminary work item",
26
- "10": "New work item proposal",
27
- "20": "Working draft",
28
- "30": "Committee draft",
29
- "40": "Draft international standard",
30
- "50": "Final draft international standard",
31
- "60": "International standard",
32
- "90": "Review",
33
- "95": "Withdrawal",
34
- }.freeze
35
-
36
- def stage_abbr(stage, substage)
37
- return nil if stage.to_i > 60
38
- return "PRF" if stage == "60" && substage == "00"
39
- STAGE_ABBRS[stage.to_sym]
40
- end
41
-
42
- def stage_name(stage, substage)
43
- return "Proof" if stage == "60" && substage == "00"
44
- STAGE_NAMES[stage.to_sym]
45
- end
46
-
47
- def metadata_id(node, xml)
48
- iso_id(node, xml)
49
- node&.attr("tc-docnumber")&.split(/,\s*/)&.each do |n|
50
- xml.docidentifier(n, **attr_code(type: "iso-tc"))
51
- end
52
- xml.docnumber node&.attr("docnumber")
53
- end
54
-
55
- def iso_id(node, xml)
56
- return unless node.attr("docnumber")
57
- part, subpart = node&.attr("partnumber")&.split(/-/)
58
- dn = add_id_parts(node.attr("docnumber"), part, subpart)
59
- dn = id_stage_prefix(dn, node)
60
- xml.docidentifier dn, **attr_code(type: "iso")
61
- xml.docidentifier id_langsuffix(dn, node), **attr_code(type: "iso-with-lang")
62
- end
63
-
64
- def id_langsuffix(dn, node)
65
- lang = node.attr("language") || "en"
66
- suffix = case lang
67
- when "en" then "(E)"
68
- when "fr" then "(F)"
69
- else
70
- "(X)"
71
- end
72
- "#{dn} #{suffix}"
73
- end
74
-
75
13
  def metadata_ext(node, xml)
76
14
  super
77
15
  structured_id(node, xml)
78
- xml.stagename stage_name(get_stage(node), get_substage(node))
79
- end
80
-
81
- def structured_id(node, xml)
82
- return unless node.attr("docnumber")
83
- part, subpart = node&.attr("partnumber")&.split(/-/)
84
- xml.structuredidentifier do |i|
85
- i.project_number node.attr("docnumber"),
86
- **attr_code(part: part, subpart: subpart)
87
- end
88
- end
89
-
90
- def add_id_parts(dn, part, subpart)
91
- dn += "-#{part}" if part
92
- dn += "-#{subpart}" if subpart
93
- dn
94
- end
95
-
96
- def id_stage_abbr(stage, substage, node)
97
- IsoDoc::Iso::Metadata.new("en", "Latn", {}).
98
- status_abbrev(stage_abbr(stage, substage), substage, node.attr("iteration"),
99
- node.attr("draft"))
100
- end
101
-
102
- def id_stage_prefix(dn, node)
103
- stage = get_stage(node)
104
- substage = get_substage(node)
105
- if stage && (stage.to_i < 60)
106
- abbr = id_stage_abbr(stage, substage, node)
107
- dn = "/#{abbr} #{dn}" unless abbr.nil? || abbr.empty? # prefixes added in cleanup
108
- else
109
- dn += ":#{node.attr("copyright-year")}" if node.attr("copyright-year")
110
- end
111
- dn
16
+ xml.stagename stage_name(get_stage(node), get_substage(node),
17
+ node.attr("doctype"), node.attr("iteration"))
18
+ @amd && a = node.attr("updates-document-type") and
19
+ xml.updates_document_type a
112
20
  end
113
21
 
114
22
  def organization(org, orgname)
@@ -157,20 +65,11 @@ module Asciidoctor
157
65
  end
158
66
  end
159
67
 
160
- def get_stage(node)
161
- stage = node.attr("status") || node.attr("docstage") || "60"
162
- end
163
-
164
- def get_substage(node)
165
- stage = get_stage(node)
166
- node.attr("docsubstage") || ( stage == "60" ? "60" : "00" )
167
- end
168
-
169
68
  def metadata_status(node, xml)
170
69
  stage = get_stage(node)
171
70
  substage = get_substage(node)
172
71
  xml.status do |s|
173
- s.stage stage, **attr_code(abbreviation: stage_abbr(stage, substage))
72
+ s.stage stage, **attr_code(abbreviation: stage_abbr(stage, substage, node.attr("doctype")))
174
73
  s.substage substage
175
74
  node.attr("iteration") && (s.iteration node.attr("iteration"))
176
75
  end
@@ -205,12 +104,21 @@ module Asciidoctor
205
104
  end
206
105
  end
207
106
 
107
+ def title_amd(node, t, lang, at)
108
+ return unless node.attr("title-amendment-#{lang}")
109
+ t.title(**attr_code(at.merge(type: "title-amd"))) do |t1|
110
+ t1 << Asciidoctor::Standoc::Utils::asciidoc_sub(node.attr("title-amendment-#{lang}"))
111
+ end
112
+ end
113
+
208
114
  def title_full(node, t, lang, at)
209
115
  title = node.attr("title-main-#{lang}")
210
116
  intro = node.attr("title-intro-#{lang}")
211
117
  part = node.attr("title-part-#{lang}")
118
+ amd = node.attr("title-amendment-#{lang}")
212
119
  title = "#{intro} -- #{title}" if intro
213
120
  title = "#{title} -- #{part}" if part
121
+ title = "#{title} -- #{amd}" if amd && @amd
214
122
  t.title **attr_code(at.merge(type: "main")) do |t1|
215
123
  t1 << Asciidoctor::Standoc::Utils::asciidoc_sub(title)
216
124
  end
@@ -223,6 +131,7 @@ module Asciidoctor
223
131
  title_intro(node, xml, lang, at)
224
132
  title_main(node, xml, lang, at)
225
133
  title_part(node, xml, lang, at)
134
+ title_amd(node, xml, lang, at) if @amd
226
135
  end
227
136
  end
228
137
  end