asciidoctor-iso 0.9.9 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +7 -0
  3. data/README.adoc +49 -9
  4. data/asciidoctor-iso.gemspec +3 -3
  5. data/lib/asciidoctor-iso.rb +2 -0
  6. data/lib/asciidoctor/iso/base.rb +14 -0
  7. data/lib/asciidoctor/iso/blocks.rb +1 -1
  8. data/lib/asciidoctor/iso/cleanup.rb +2 -2
  9. data/lib/asciidoctor/iso/cleanup_ref.rb +1 -1
  10. data/lib/asciidoctor/iso/inline.rb +1 -1
  11. data/lib/asciidoctor/iso/macros.rb +54 -0
  12. data/lib/asciidoctor/iso/ref.rb +7 -2
  13. data/lib/asciidoctor/iso/validate.rb +8 -8
  14. data/lib/asciidoctor/iso/validate_requirements.rb +5 -5
  15. data/lib/asciidoctor/iso/version.rb +1 -1
  16. data/lib/isodoc/iso/html/header.html +206 -0
  17. data/lib/isodoc/iso/html/html_iso_intro.html +34 -0
  18. data/lib/isodoc/iso/html/html_iso_titlepage.html +34 -0
  19. data/lib/isodoc/iso/html/htmlstyle.scss +46 -0
  20. data/lib/isodoc/iso/html/isodoc.scss +696 -0
  21. data/lib/isodoc/iso/html/scripts.html +174 -0
  22. data/lib/isodoc/iso/html/style-human.scss +1277 -0
  23. data/lib/isodoc/iso/html/style-iso.scss +1257 -0
  24. data/lib/isodoc/iso/html/word_iso_intro.html +72 -0
  25. data/lib/isodoc/iso/html/word_iso_titlepage.html +62 -0
  26. data/lib/isodoc/iso/html/wordstyle.scss +1175 -0
  27. data/lib/isodoc/iso/html_convert.rb +136 -0
  28. data/lib/isodoc/iso/metadata.rb +107 -0
  29. data/lib/isodoc/iso/word_convert.rb +139 -0
  30. data/spec/asciidoctor-iso/isobib_cache_spec.rb +18 -4
  31. data/spec/asciidoctor-iso/macros_spec.rb +92 -1
  32. data/spec/asciidoctor-iso/validate_spec.rb +173 -144
  33. data/spec/assets/header.html +7 -0
  34. data/spec/assets/html.css +2 -0
  35. data/spec/assets/htmlcover.html +4 -0
  36. data/spec/assets/htmlintro.html +5 -0
  37. data/spec/assets/i18n.yaml +2 -0
  38. data/spec/assets/iso.doc +2312 -0
  39. data/spec/assets/iso.headless.html +33 -0
  40. data/spec/assets/iso.html +1388 -0
  41. data/spec/assets/iso.xml +8 -0
  42. data/spec/assets/rice_image1.png +0 -0
  43. data/spec/assets/scripts.html +3 -0
  44. data/spec/assets/std.css +2 -0
  45. data/spec/assets/word.css +2 -0
  46. data/spec/assets/wordcover.html +3 -0
  47. data/spec/assets/wordintro.html +4 -0
  48. data/spec/examples/103_01_02.html +247 -0
  49. data/spec/isodoc/i18n_spec.rb +642 -0
  50. data/spec/isodoc/iso_spec.rb +168 -0
  51. data/spec/isodoc/metadata_spec.rb +152 -0
  52. data/spec/isodoc/postproc_spec.rb +409 -0
  53. data/spec/isodoc/section_spec.rb +522 -0
  54. data/spec/isodoc/xref_spec.rb +1337 -0
  55. data/spec/spec_helper.rb +45 -0
  56. metadata +45 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cb66e36c45b81ea74df0f2f99014369c36ee1910425fbfe258034da6498b6de
4
- data.tar.gz: 5967537b4c5ecf61bc2cdf3a6ce85219df2f92b03caa447b6c0594b07300fc82
3
+ metadata.gz: 9f33d6a123eea911079343a47615fa26a433e777d3dcd57866711705b8fd02e8
4
+ data.tar.gz: c1bd60cc9ce1b4a164f112ab17a181fe3cf32a42f8d5e0a5efbecd26902a517a
5
5
  SHA512:
6
- metadata.gz: 26da20f2117a447051df311f61145aa0f5841d78adad3ebfcef08b3c97208c353e19add9151f5eda043d27621822b4b09440bfe51aca92dad754452e7ad8ad2e
7
- data.tar.gz: 2cd75fbdd50c9858a0b1ed81d4f1a77e59cbdac4eccb315be14b06ff50a4a621d5f3bf7363c4940cfe9fcd9e1dfda224f4349e35202b1d82c1bdd7a66f5695aa
6
+ metadata.gz: b29a3b72d11cea8a6e8b4bc2f4cfbed276d475c92702facd1214177fc9452f04e90a842e7d7758519291264826f7a74d5894437148106ae631f6392a6830be8a
7
+ data.tar.gz: 48b79c7530f7a756d5646d99131d7ae57b3cb5434c6349e827f7dedc4082bb6332c18e80f617057b264db70e61a1ddc33db131e3406990a638ef24e43352b05f
@@ -8,6 +8,13 @@ rvm:
8
8
  before_install:
9
9
  - gem install bundler -v 1.16.1
10
10
  - unset _JAVA_OPTIONS
11
+ - wget "http://downloads.sourceforge.net/project/plantuml/plantuml.jar?r=&ts=1424308684&use_mirror=jaist" -O plantuml.jar
12
+ - sudo mkdir -p /opt/plantuml
13
+ - sudo cp plantuml.jar /opt/plantuml
14
+ - echo "#! /bin/sh" > plantuml.sh
15
+ - echo 'exec java -jar /opt/plantuml/plantuml.jar "$@"' >> plantuml.sh
16
+ - sudo install -m 755 -D plantuml.sh /usr/bin/plantuml
17
+ - plantuml -version
11
18
  matrix:
12
19
  allow_failures:
13
20
  - rvm: ruby-head
@@ -514,6 +514,38 @@ This generates the following ISO XML:
514
514
  </clause>
515
515
  --
516
516
 
517
+ === PlantUML
518
+
519
+ The http://plantuml.com[PlantUML] diagramming tool is integrated with Asciidoctor
520
+ in this gem, as a literal block with the style attribute `plantuml`:
521
+
522
+ [source,asciidoctor]
523
+ --
524
+ [plantuml]
525
+ ....
526
+ @startuml
527
+ Alice -> Bob: Authentication Request
528
+ Bob --> Alice: Authentication Response
529
+
530
+ Alice -> Bob: Another authentication Request
531
+ Alice <-- Bob: another authentication Response
532
+ @enduml
533
+ ....
534
+ --
535
+
536
+ The integration runs PlantUML for each such block, generating a PNG image.
537
+ The images are stored in the `plantuml` directory, and linked into the output
538
+ document in place of the PlantUML.
539
+
540
+ PlantUML needs to be installed by users separately, and accesssible from the
541
+ command line:
542
+
543
+ * `brew install plantuml` on MacOS.
544
+ * For Linux, link the PlantUML jar file into a command line executable; see
545
+ `.travis.yml` for an example.
546
+
547
+ If PlantUML is not installed locally, the source PlantUML is incorporated into
548
+ the output document as sourcecode.
517
549
 
518
550
  === Features not visible in HTML preview
519
551
 
@@ -623,17 +655,20 @@ identifier as the item label; e.g.
623
655
  By default, the `isobib` gem is used to look up the reference details for
624
656
  any item label prefixed with `ISO` on the ISO web site. The full bibliographic details
625
657
  of the item are screenscraped from the ISO site and inserted into the XML file
626
- (although only the title of the reference is used in rendering).
658
+ (although only the title of the reference is used in rendering). The
659
+ http://www.electropedia.org[Electropedia] termbank is queried in validation, to confirm
660
+ that the cited entries in Terms and Definitions are the same as what is cited online;
661
+ those queries are routed through the `iev` gem
627
662
 
628
663
  [[cache]]
629
664
  The results of all `isobib` searches done to date, across all documents,
630
- are cached in the global cache file `~/.relaton-bib.json`,
665
+ are cached in the global cache file `~/.relaton-bib.pstore`,
631
666
  so they do not need to be re-fetched each time a document is processed.
632
667
  (The web query takes a few seconds per reference.)
633
668
 
634
669
  The results of all `isobib` searches done to date for the current document
635
670
  (`filename.adoc`) are stored in the same directory as the current document,
636
- in the file `filename`.relaton.json. The local cache overrides entries in
671
+ in the file `{filename}.relaton.pstore`. The local cache overrides entries in
637
672
  the global cache, and can be manually edited. The local cache is only used
638
673
  if the `:local-cache:` document attribute is set.
639
674
 
@@ -646,6 +681,11 @@ Any entry in the cache that corresponds to an undated ISO reference fetches its
646
681
  from the latest available entry on the ISO web site. If the entry is more than 60
647
682
  days old, it is refetched.
648
683
 
684
+ The results of all `iev` searches done to date across all documents are cached
685
+ in the global cache fule `~/iev.pstore`, and the results of all `iev` searches
686
+ done to date for the current document are stored in the same directory as the
687
+ current document, in the file `(filename).iev.pstore`.
688
+
649
689
  == Document Attributes
650
690
 
651
691
  The gem relies on Asciidoctor document attributes to provide necessary
@@ -660,14 +700,14 @@ Can be used as a command-line option (like all other document attributes):
660
700
  `:flush-caches:`:: If set, delete and reinitialise the <<cache,cache>> of `isobib` searches
661
701
  for ISO references from the ISO web site.
662
702
 
663
- `:no-isobib:`:: If set, do not use the `isobib` gem functionality to look up
664
- ISO references online, nor the <<cache,cache>> of `isobib` searches.
703
+ `:no-isobib:`:: If set, do not use the `isobib` or `iev` gem functionality to look up
704
+ ISO and IEV references online, nor the <<cache,cache>> of `isobib` and `iev` searches.
665
705
 
666
- `:no-isobib-cache:`:: If set, use the `isobib` gem functionality to look up
667
- ISO references online, but do not use the <<cache,cache>> of `isobib` searches.
706
+ `:no-isobib-cache:`:: If set, use the `isobib` and `iev` gem functionality to look up
707
+ ISO and IEV references online, but do not use the <<cache,cache>> of `isobib` and `iev` searches.
668
708
 
669
- `:local-cache:`:: Use the local isobib search cache to override the global isobib search
670
- cache.
709
+ `:local-cache:`:: Use the local isobib and iev search caches to override the global isobib and iev search
710
+ caches.
671
711
 
672
712
  `:i18nyaml:`:: Name of YAML file of internationalisation text, to use instead
673
713
  of the built-in English, French or Chinese text used to label parts of the document
@@ -25,16 +25,16 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.files = `git ls-files`.split("\n")
27
27
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
28
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
28
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
29
29
 
30
30
  spec.add_dependency "asciidoctor", "~> 1.5.7"
31
31
  spec.add_dependency "ruby-jing"
32
32
  spec.add_dependency "isodoc", ">= 0.8"
33
- spec.add_dependency "iev", "~> 0.1.0"
33
+ spec.add_dependency "iev", "~> 0.2.0"
34
34
  spec.add_dependency "relaton", "~> 0.1.3"
35
35
 
36
36
  spec.add_development_dependency "bundler", "~> 1.15"
37
- spec.add_development_dependency "byebug", "~> 9.1"
37
+ spec.add_development_dependency "byebug"
38
38
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
39
39
  spec.add_development_dependency "guard", "~> 2.14"
40
40
  spec.add_development_dependency "guard-rspec", "~> 4.7"
@@ -1,6 +1,8 @@
1
1
  require "asciidoctor" unless defined? Asciidoctor::Converter
2
2
  require_relative "asciidoctor/iso/converter"
3
3
  require_relative "asciidoctor/iso/version"
4
+ require_relative "isodoc/iso/html_convert"
5
+ require_relative "isodoc/iso/word_convert"
4
6
  require "asciidoctor/extensions"
5
7
 
6
8
  if defined? Metanorma
@@ -16,6 +16,7 @@ module Asciidoctor
16
16
  inline_macro Asciidoctor::ISO::AltTermInlineMacro
17
17
  inline_macro Asciidoctor::ISO::DeprecatedTermInlineMacro
18
18
  inline_macro Asciidoctor::ISO::DomainTermInlineMacro
19
+ block Asciidoctor::ISO::PlantUMLBlockMacro
19
20
  end
20
21
 
21
22
  def content(node)
@@ -75,6 +76,7 @@ module Asciidoctor
75
76
  @no_isobib = node.attr("no-isobib")
76
77
  @bibdb = nil
77
78
  init_bib_caches(node)
79
+ init_iev_caches(node)
78
80
  end
79
81
 
80
82
  def init_bib_caches(node)
@@ -89,6 +91,18 @@ module Asciidoctor
89
91
  @bibdb = Relaton::Db.new(globalname, localname) unless @no_isobib
90
92
  end
91
93
 
94
+ def init_iev_caches(node)
95
+ unless (@no_isobib_cache || @no_isobib)
96
+ globalname = ievcache_name(true)
97
+ localname = ievcache_name(false) if node.attr("local-cache")
98
+ if node.attr("flush-caches")
99
+ system("rm -f #{globalname}") unless globalname.nil?
100
+ system("rm -f #{localname}") unless localname.nil?
101
+ end
102
+ end
103
+ @iev = Iev::Db.new(globalname, localname) unless @no_isobib
104
+ end
105
+
92
106
  def default_fonts(node)
93
107
  b = node.attr("body-font") ||
94
108
  (node.attr("script") == "Hans" ? '"SimSun",serif' :
@@ -35,7 +35,7 @@ module Asciidoctor
35
35
 
36
36
  def sidebar_attrs(node)
37
37
  date = node.attr("date") || Date.today.iso8601.gsub(/\+.*$/, "")
38
- date += "T00:00:00Z" unless /T/.match? date
38
+ date += "T00:00:00Z" unless /T/.match date
39
39
  {
40
40
  reviewer: node.attr("reviewer") || node.attr("source") || "(Unknown)",
41
41
  id: Utils::anchor_or_uuid(node),
@@ -203,7 +203,7 @@ module Asciidoctor
203
203
  def empty_text_before_first_element(x)
204
204
  x.children.each do |c|
205
205
  if c.text?
206
- return false if /\S/.match?(c.text)
206
+ return false if /\S/.match(c.text)
207
207
  end
208
208
  return true if c.element?
209
209
  end
@@ -212,7 +212,7 @@ module Asciidoctor
212
212
 
213
213
  def strip_initial_space(x)
214
214
  if x.children[0].text?
215
- if !/\S/.match?(x.children[0].text)
215
+ if !/\S/.match(x.children[0].text)
216
216
  x.children[0].remove
217
217
  else
218
218
  x.children[0].content = x.children[0].text.gsub(/^ /, "")
@@ -90,7 +90,7 @@ module Asciidoctor
90
90
 
91
91
  def format_ref(ref, isopub)
92
92
  return ref if isopub
93
- return "[#{ref}]" if /^\d+$/.match?(ref) && !/^\[.*\]$/.match?(ref)
93
+ return "[#{ref}]" if /^\d+$/.match(ref) && !/^\[.*\]$/.match(ref)
94
94
  ref
95
95
  end
96
96
 
@@ -93,7 +93,7 @@ module Asciidoctor
93
93
 
94
94
  def stem_parse(text, xml)
95
95
  if /&lt;([^:>&]+:)?math(\s+[^>&]+)?&gt; |
96
- <([^:>&]+:)?math(\s+[^>&]+)?>/x.match? text
96
+ <([^:>&]+:)?math(\s+[^>&]+)?>/x.match text
97
97
  math = HTMLEntities.new.encode(text, :basic, :hexadecimal).
98
98
  gsub(/&amp;gt;/, ">").gsub(/\&amp;lt;/, "<").gsub(/&amp;amp;/, "&").
99
99
  gsub(/&gt;/, ">").gsub(/&lt;/, "<").gsub(/&amp;/, "&")
@@ -37,5 +37,59 @@ module Asciidoctor
37
37
  %{<domain>#{out}</domain>}
38
38
  end
39
39
  end
40
+
41
+ class PlantUMLBlockMacroBackend
42
+ # https://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby
43
+ def self.plantuml_installed?
44
+ cmd = "plantuml"
45
+ exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
46
+ ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
47
+ exts.each do |ext|
48
+ exe = File.join(path, "#{cmd}#{ext}")
49
+ return exe if File.executable?(exe) && !File.directory?(exe)
50
+ end
51
+ end
52
+ nil
53
+ end
54
+
55
+ def self.generate_file parent, reader
56
+ src = reader.source
57
+ reader.lines.first.sub(/\s+$/, "") != "@startuml" or
58
+ src = "@startuml\n#{src}\n@enduml\n"
59
+ filename = parent.document.reader.lineno
60
+ system "mkdir -p plantuml"
61
+ File.open("plantuml/#{filename}.pml", "w") { |f| f.write src }
62
+ system "plantuml plantuml/#{filename}.pml"
63
+ filename
64
+ end
65
+
66
+ def self.generate_attrs attrs
67
+ through_attrs = %w(id align float title role width height alt).
68
+ inject({}) do |memo, key|
69
+ memo[key] = attrs[key] if attrs.has_key? key
70
+ memo
71
+ end
72
+ end
73
+ end
74
+
75
+ class PlantUMLBlockMacro < Asciidoctor::Extensions::BlockProcessor
76
+ use_dsl
77
+ named :plantuml
78
+ on_context :literal
79
+ parse_content_as :raw
80
+
81
+ def process(parent, reader, attrs)
82
+ if PlantUMLBlockMacroBackend.plantuml_installed?
83
+ filename = PlantUMLBlockMacroBackend.generate_file parent, reader
84
+ through_attrs = PlantUMLBlockMacroBackend.generate_attrs attrs
85
+ through_attrs["target"] = "plantuml/#{filename}.png"
86
+ create_image_block parent, through_attrs
87
+ else
88
+ warn "PlantUML not installed"
89
+ # attrs.delete(1) : remove the style attribute
90
+ create_listing_block parent, reader.source, attrs.reject { |k, v| k == 1 }
91
+ end
92
+ end
93
+ end
40
94
  end
41
95
  end
@@ -93,7 +93,7 @@ module Asciidoctor
93
93
  t.formattedref **{ format: "application/x-isodoc+xml" } do |i|
94
94
  i << ref_normalise_no_format(m[:text])
95
95
  end
96
- t.docidentifier(/^\d+$/.match?(m[:code]) ? "[#{m[:code]}]" : m[:code])
96
+ t.docidentifier(/^\d+$/.match(m[:code]) ? "[#{m[:code]}]" : m[:code])
97
97
  end
98
98
  end
99
99
 
@@ -103,7 +103,7 @@ module Asciidoctor
103
103
  Utils::warning(node, "no anchor on reference", item)
104
104
  return
105
105
  end
106
- unless m[:code] && /^\d+$/.match?(m[:code])
106
+ unless m[:code] && /^\d+$/.match(m[:code])
107
107
  ref = fetch_ref xml, m[:code],
108
108
  m.named_captures.has_key?("year") ? m[:year] : nil, {}
109
109
  return use_my_anchor(ref, m[:anchor]) if ref
@@ -177,6 +177,11 @@ module Asciidoctor
177
177
  global ? "#{Dir.home}/.relaton-bib.pstore" :
178
178
  "#{@filename}.relaton.pstore"
179
179
  end
180
+
181
+ def ievcache_name(global)
182
+ global ? "#{Dir.home}/.iev.pstore" :
183
+ "#{@filename}.iev.pstore"
184
+ end
180
185
  end
181
186
  end
182
187
  end
@@ -53,11 +53,11 @@ module Asciidoctor
53
53
  doctypes = /International\sStandard | Technical\sSpecification |
54
54
  Publicly\sAvailable\sSpecification | Technical\sReport | Guide /xi
55
55
  title_main_en = root.at("//title-main[@language='en']")
56
- if !title_main_en.nil? && doctypes.match?(title_main_en.text)
56
+ if !title_main_en.nil? && doctypes.match(title_main_en.text)
57
57
  warn "Main Title may name document type"
58
58
  end
59
59
  title_intro_en = root.at("//title-intro[@language='en']")
60
- if !title_intro_en.nil? && doctypes.match?(title_intro_en.text)
60
+ if !title_intro_en.nil? && doctypes.match(title_intro_en.text)
61
61
  warn "Title Intro may name document type"
62
62
  end
63
63
  end
@@ -124,7 +124,7 @@ module Asciidoctor
124
124
  root.xpath("//xref").each do |t|
125
125
  # does not deal with preceding text marked up
126
126
  preceding = t.at("./preceding-sibling::text()[last()]")
127
- next unless !preceding.nil? && /\bsee\s*$/mi.match?(preceding)
127
+ next unless !preceding.nil? && /\bsee\s*$/mi.match(preceding)
128
128
  (target = root.at("//*[@id = '#{t['target']}']")) || next
129
129
  if target&.at("./ancestor-or-self::*[@obligation = 'normative']")
130
130
  warn "ISO: 'see #{t['target']}' is pointing to a normative section"
@@ -135,7 +135,7 @@ module Asciidoctor
135
135
  def see_erefs_validate(root)
136
136
  root.xpath("//eref").each do |t|
137
137
  preceding = t.at("./preceding-sibling::text()[last()]")
138
- next unless !preceding.nil? && /\bsee\s*$/mi.match?(preceding)
138
+ next unless !preceding.nil? && /\bsee\s*$/mi.match(preceding)
139
139
  target = root.at("//*[@id = '#{t['bibitemid']}']")
140
140
  if target.at("./ancestor::references"\
141
141
  "[title = 'Normative References']")
@@ -146,7 +146,7 @@ module Asciidoctor
146
146
 
147
147
  def locality_erefs_validate(root)
148
148
  root.xpath("//eref[locality]").each do |t|
149
- unless /:[ ]?\d+{4}$/.match? t["citeas"]
149
+ unless /:[ ]?\d+{4}$/.match t["citeas"]
150
150
  warn "ISO: undated reference #{t['citeas']} should not contain "\
151
151
  "specific elements"
152
152
  end
@@ -154,7 +154,7 @@ module Asciidoctor
154
154
  end
155
155
 
156
156
  def termdef_warn(text, re, term, msg)
157
- re.match?(text) && warn("ISO style: #{term}: #{msg}")
157
+ re.match(text) && warn("ISO style: #{term}: #{msg}")
158
158
  end
159
159
 
160
160
  def termdef_style(xmldoc)
@@ -172,10 +172,10 @@ module Asciidoctor
172
172
 
173
173
  def iev_validate(xmldoc)
174
174
  xmldoc.xpath("//term").each do |t|
175
- /^IEV($|\s|:)/.match? t&.at(".//origin/@citeas")&.text or next
175
+ /^IEV($|\s|:)/.match(t&.at(".//origin/@citeas")&.text) or next
176
176
  pref = t.xpath("./preferred").inject([]) { |m, x| m << x&.text&.downcase }
177
177
  locality = t.xpath(SOURCELOCALITY)&.text or next
178
- iev = Iev.get(locality, xmldoc&.at("//language")&.text || "en") or next
178
+ iev = @iev.fetch(locality, xmldoc&.at("//language")&.text || "en") or next
179
179
  pref.include?(iev.downcase) or
180
180
  warn %(Term "#{pref[0]}" does not match IEV #{locality} "#{iev}")
181
181
  end
@@ -25,7 +25,7 @@ module Asciidoctor
25
25
 
26
26
  def requirement(text)
27
27
  text.split(/\.\s+/).each do |t|
28
- return t if REQUIREMENT_RE.match? t
28
+ return t if REQUIREMENT_RE.match t
29
29
  end
30
30
  nil
31
31
  end
@@ -43,7 +43,7 @@ module Asciidoctor
43
43
 
44
44
  def recommendation(text)
45
45
  text.split(/\.\s+/).each do |t|
46
- return t if RECOMMENDATION_RE.match? t
46
+ return t if RECOMMENDATION_RE.match t
47
47
  end
48
48
  nil
49
49
  end
@@ -62,7 +62,7 @@ module Asciidoctor
62
62
 
63
63
  def permission(text)
64
64
  text.split(/\.\s+/).each do |t|
65
- return t if PERMISSION_RE.match? t
65
+ return t if PERMISSION_RE.match t
66
66
  end
67
67
  nil
68
68
  end
@@ -81,13 +81,13 @@ module Asciidoctor
81
81
  Regexp::IGNORECASE)
82
82
 
83
83
  def possibility(text)
84
- text.split(/\.\s+/).each { |t| return t if POSSIBILITY_RE.match? t }
84
+ text.split(/\.\s+/).each { |t| return t if POSSIBILITY_RE.match t }
85
85
  nil
86
86
  end
87
87
 
88
88
  def external_constraint(text)
89
89
  text.split(/\.\s+/).each do |t|
90
- return t if /\b(must)\b/xi.match? t
90
+ return t if /\b(must)\b/xi.match t
91
91
  end
92
92
  nil
93
93
  end
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module ISO
3
- VERSION = "0.9.9".freeze
3
+ VERSION = "0.10.0".freeze
4
4
  end
5
5
  end
@@ -0,0 +1,206 @@
1
+ <html xmlns:v="urn:schemas-microsoft-com:vml"
2
+ xmlns:o="urn:schemas-microsoft-com:office:office"
3
+ xmlns:w="urn:schemas-microsoft-com:office:word"
4
+ xmlns:m="http://schemas.microsoft.com/office/2004/12/omml"
5
+ xmlns:mv="http://macVmlSchemaUri" xmlns="http://www.w3.org/TR/REC-html40">
6
+
7
+ <head>
8
+ <meta name=Title content="">
9
+ <meta name=Keywords content="">
10
+ <meta http-equiv=Content-Type content="text/html; charset=utf-8">
11
+ <meta name=ProgId content=Word.Document>
12
+ <meta name=Generator content="Microsoft Word 15">
13
+ <meta name=Originator content="Microsoft Word 15">
14
+ <link id=Main-File rel=Main-File href="../{{ filename }}.html">
15
+ <!--[if gte mso 9]><xml>
16
+ <o:shapedefaults v:ext="edit" spidmax="2049"/>
17
+ </xml><![endif]-->
18
+ </head>
19
+
20
+ <body lang=EN link=blue vlink="#954F72">
21
+
22
+ <div style='mso-element:footnote-separator' id=fs>
23
+
24
+ <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
25
+ normal'><span lang=EN-GB><span style='mso-special-character:footnote-separator'><![if !supportFootnotes]>
26
+
27
+ <hr align=left size=1 width="33%">
28
+
29
+ <![endif]></span></span></p>
30
+
31
+ </div>
32
+
33
+ <div style='mso-element:footnote-continuation-separator' id=fcs>
34
+
35
+ <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
36
+ normal'><span lang=EN-GB><span style='mso-special-character:footnote-continuation-separator'><![if !supportFootnotes]>
37
+
38
+ <hr align=left size=1>
39
+
40
+ <![endif]></span></span></p>
41
+
42
+ </div>
43
+
44
+ <div style='mso-element:endnote-separator' id=es>
45
+
46
+ <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
47
+ normal'><span lang=EN-GB><span style='mso-special-character:footnote-separator'><![if !supportFootnotes]>
48
+
49
+ <hr align=left size=1 width="33%">
50
+
51
+ <![endif]></span></span></p>
52
+
53
+ </div>
54
+
55
+ <div style='mso-element:endnote-continuation-separator' id=ecs>
56
+
57
+ <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
58
+ normal'><span lang=EN-GB><span style='mso-special-character:footnote-continuation-separator'><![if !supportFootnotes]>
59
+
60
+ <hr align=left size=1>
61
+
62
+ <![endif]></span></span></p>
63
+
64
+ </div>
65
+
66
+ <div style='mso-element:header' id=eha>
67
+
68
+ <p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
69
+ mso-line-height-rule:exactly'><span lang=EN-GB>{{ docnumber }}:{{ docyear }}(E){{ draftinfo }}</span></p>
70
+
71
+ </div>
72
+
73
+ <div style='mso-element:header' id=ha>
74
+
75
+ <p class=MsoHeader style='margin-bottom:18.0pt'><span lang=EN-GB
76
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt;font-weight:normal'>©
77
+ {{ agency }}&nbsp;{{ docyear }}&nbsp;– All rights reserved</span><span lang=EN-GB
78
+ style='font-weight:normal'><o:p></o:p></span></p>
79
+
80
+ </div>
81
+
82
+ <div style='mso-element:footer' id=efa>
83
+
84
+ <p class=MsoFooter style='margin-top:12.0pt;line-height:12.0pt;mso-line-height-rule:
85
+ exactly'><!--[if supportFields]><b style='mso-bidi-font-weight:normal'><span
86
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
87
+ style='mso-element:field-begin'></span><span
88
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
89
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span></b><![endif]--><b
90
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
91
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!--[if supportFields]><b
92
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
93
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
94
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
95
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>©
96
+ {{ agency }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
97
+
98
+ </div>
99
+
100
+ <div style='mso-element:header' id=eh2>
101
+
102
+ <p class=MsoHeader align=left style='text-align:left;line-height:12.0pt;
103
+ mso-line-height-rule:exactly'><span lang=EN-GB>{{ docnumber }}:{{ docyear }}(E){{ draftinfo }}</span></p>
104
+
105
+ </div>
106
+
107
+ <div style='mso-element:header' id=h2>
108
+
109
+ <p class=MsoHeader align=right style='text-align:right;line-height:12.0pt;
110
+ mso-line-height-rule:exactly'><span lang=EN-GB>{{ docnumber }}:{{ docyear }}(E){{ draftinfo }}</span></p>
111
+
112
+ </div>
113
+
114
+ <div style='mso-element:footer' id=ef2>
115
+
116
+ <p class=MsoFooter style='line-height:12.0pt;mso-line-height-rule:exactly'><!--[if supportFields]><span
117
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
118
+ style='mso-element:field-begin'></span><span
119
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
120
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
121
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
122
+ style='mso-no-proof:yes'>ii</span></span><!--[if supportFields]><span
123
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
124
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
125
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span style='mso-tab-count:
126
+ 1'>                                                                                                                                                                           </span>©
127
+ {{ agency }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
128
+
129
+ </div>
130
+
131
+ <div style='mso-element:footer' id=f2>
132
+
133
+ <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
134
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }}&nbsp;{{ docyear }}&nbsp;– All
135
+ rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                          </span></span><!--[if supportFields]><span
136
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
137
+ style='mso-element:field-begin'></span> PAGE<span style='mso-spacerun:yes'>  
138
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
139
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
140
+ style='mso-no-proof:yes'>iii</span></span><!--[if supportFields]><span
141
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
142
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-GB
143
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
144
+
145
+ </div>
146
+
147
+ <div style='mso-element:footer' id=ef3>
148
+
149
+ <p class=MsoFooter style='margin-top:12.0pt;line-height:12.0pt;mso-line-height-rule:
150
+ exactly'><!--[if supportFields]><b style='mso-bidi-font-weight:normal'><span
151
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
152
+ style='mso-element:field-begin'></span><span
153
+ style='mso-spacerun:yes'> </span>PAGE<span style='mso-spacerun:yes'>  
154
+ </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span></b><![endif]--><b
155
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
156
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>2</span></span></b><!--[if supportFields]><b
157
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
158
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
159
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><span
160
+ style='mso-tab-count:1'>                                                                                                                                                                           </span>©
161
+ {{ agency }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
162
+
163
+ </div>
164
+
165
+ <div style='mso-element:footer' id=f3>
166
+
167
+ <p class=MsoFooter style='line-height:12.0pt'><span lang=EN-GB
168
+ style='font-size:10.0pt;mso-bidi-font-size:11.0pt'>© {{ agency }}&nbsp;{{ docyear }}&nbsp;– All
169
+ rights reserved<span style='mso-tab-count:1'>                                                                                                                                                                           </span></span><!--[if supportFields]><b
170
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
171
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-begin'></span>
172
+ PAGE<span style='mso-spacerun:yes'>   </span>\* MERGEFORMAT <span
173
+ style='mso-element:field-separator'></span></span></b><![endif]--><b
174
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
175
+ mso-bidi-font-size:11.0pt'><span style='mso-no-proof:yes'>3</span></span></b><!--[if supportFields]><b
176
+ style='mso-bidi-font-weight:normal'><span lang=EN-GB style='font-size:10.0pt;
177
+ mso-bidi-font-size:11.0pt'><span style='mso-element:field-end'></span></span></b><![endif]--><span
178
+ lang=EN-GB style='font-size:10.0pt;mso-bidi-font-size:11.0pt'><o:p></o:p></span></p>
179
+
180
+ </div>
181
+
182
+ <div style='mso-element:footer' id=f4>
183
+
184
+ <p class=MsoFooter><b style='mso-bidi-font-weight:normal'><span>ICS {{ ics }}<o:p></o:p></span></b></p>
185
+
186
+ <p class=MsoFooter style='margin-top:0cm'><span lang=EN-AU style='font-size:
187
+ 10.0pt;mso-ansi-language:EN-AU'>Price based on </span><!--[if supportFields]><span
188
+ lang=EN-AU style='font-size:10.0pt;mso-ansi-language:EN-AU'><span
189
+ style='mso-element:field-begin'></span><span style='mso-spacerun:yes'> </span>NUMPAGES<span
190
+ style='mso-spacerun:yes'>  </span>\* MERGEFORMAT <span style='mso-element:field-separator'></span></span><![endif]--><span
191
+ lang=EN-AU style='font-size:10.0pt;mso-ansi-language:EN-AU'><span
192
+ style='mso-no-proof:yes'>26</span></span><!--[if supportFields]><span
193
+ lang=EN-AU style='font-size:10.0pt;mso-ansi-language:EN-AU'><span
194
+ style='mso-element:field-end'></span></span><![endif]--><span lang=EN-AU
195
+ style='font-size:10.0pt;mso-ansi-language:EN-AU'> pages<o:p></o:p></span></p>
196
+
197
+ <p class=MsoFooter><span lang=EN-AU style='font-size:10.0pt;'>©
198
+ {{ agency }}&nbsp;{{ docyear }}&nbsp;– All rights reserved<o:p></o:p></span></p>
199
+
200
+ </div>
201
+
202
+
203
+
204
+ </body>
205
+
206
+ </html>