metanorma-mpfd 0.3.11 → 0.3.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b3db8aa497e6fac24229ffb6b252499e7be2055d84b4df3cb3860497baa6fb6
4
- data.tar.gz: a4fdc8195fdfa3d148515b274d4feca2a44c8d8d13900ae69d53c3fa96eecece
3
+ metadata.gz: bccaa9f5879bfab9212afa8d7dae9e3080abe74612afa7c8bf1a7e822301c3a8
4
+ data.tar.gz: 98adbc60f0095aa69d39c0bd34b63ffd250f6cd9a33a73e39e0947bcf8bcdadf
5
5
  SHA512:
6
- metadata.gz: 16a1c149d4cacf47c2f7a01e8384a58b4f8ed2fe2301ffa2cdcc806c415ca61e5537983ca1bebb5796072d3e872bb9f459365e32b909b9dbfb263ef1bcbac349
7
- data.tar.gz: ec5bc05411887ee6811268045e4971005c18a77f7ae0020a2a47ceca535ce2ae64c7b64fa9db5aa401abdd7e3fa4e715cf03449378c6494faaaaca1cc6fb9329
6
+ metadata.gz: 2dca1ca21055f6493b73b49c0722356c05666201e2886751b31f9e9d2be526f1e67dcf8900a73b30b089be3d1e75f22c0b07d857fa6f1fec4dd86d69ba8cb7f1
7
+ data.tar.gz: ae1b5dd0cd743a614d6159d041e78f86c4ccbe0c8e05cc78827c6cf2b3e7f2241c8031cef7772d4f3a76cb8a31e60300de66ed24a9dfae289711b2d6c8bfeae1
@@ -15,7 +15,7 @@ module Asciidoctor
15
15
  #
16
16
  class Converter < Standoc::Converter
17
17
  XML_ROOT_TAG = "mpfd-standard".freeze
18
- XML_NAMESPACE = "https://www.metanorma.com/ns/mpfd".freeze
18
+ XML_NAMESPACE = "https://www.metanorma.org/ns/mpfd".freeze
19
19
 
20
20
  register_for "mpfd"
21
21
 
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.com/ns/mpfd" xmlns="http://relaxng.org/ns/structure/1.0">
2
+ <grammar ns="https://www.metanorma.org/ns/mpfd" xmlns="http://relaxng.org/ns/structure/1.0">
3
3
  <!--
4
4
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
5
  we cannot have a new default namespace: we will end up with a grammar with two different
@@ -31,34 +31,6 @@ module Asciidoctor
31
31
  end
32
32
  end
33
33
 
34
- def section(node)
35
- a = section_attributes(node)
36
- noko do |xml|
37
- case sectiontype(node)
38
- when "introduction" then introduction_parse(a, xml, node)
39
- when "terms and definitions"
40
- @term_def = true
41
- term_def_parse(a, xml, node, true)
42
- @term_def = false
43
- when "symbols and abbreviated terms"
44
- symbols_parse(a, xml, node)
45
- when "bibliography" then bibliography_parse(a, xml, node)
46
- else
47
- if @term_def then term_def_subclause_parse(a, xml, node)
48
- elsif @biblio then bibliography_parse(a, xml, node)
49
- elsif node.attr("style") == "bibliography"
50
- bibliography_parse(a, xml, node)
51
- elsif node.attr("style") == "abstract"
52
- abstract_parse(a, xml, node)
53
- elsif node.attr("style") == "appendix" && node.level == 1
54
- annex_parse(a, xml, node)
55
- else
56
- clause_parse(a, xml, node)
57
- end
58
- end
59
- end.join("\n")
60
- end
61
-
62
34
  def term_def_title(_toplevel, node)
63
35
  return node.title
64
36
  end
@@ -70,21 +42,21 @@ module Asciidoctor
70
42
  preface.add_child introduction.remove if introduction
71
43
  terms = x.at("//sections/clause[descendant::terms]") || x.at("//terms")
72
44
  preface.add_child terms.remove if terms
73
- x.xpath("//clause[@preface]").each do |c|
74
- c.delete("preface")
75
- preface.add_child c.remove
76
- end
45
+ move_clauses_into_preface(x, preface)
46
+ acknowledgements = x.at("//acknowledgements")
47
+ preface.add_child acknowledgements.remove if acknowledgements
77
48
  end
78
49
 
79
50
  def make_preface(x, s)
80
- if x.at("//foreword | //introduction | //terms | //abstract | //clause[@preface]")
51
+ if x.at("//foreword | //introduction | //terms | //acknowledgements |"\
52
+ "//abstract[not(ancestor::bibitem)] | //clause[@preface]")
81
53
  preface = s.add_previous_sibling("<preface/>").first
82
54
  move_sections_into_preface(x, preface)
55
+ make_abstract(x, s)
83
56
  end
84
57
  end
85
58
 
86
59
  def clause_parse(attrs, xml, node)
87
- attrs[:preface] = true if node.attr("style") == "preface"
88
60
  attrs[:guidance] = true if node.role == "guidance"
89
61
  attrs[:container] = true if node.role == "container"
90
62
  super
@@ -5,14 +5,6 @@ require "fileutils"
5
5
  module IsoDoc
6
6
  module Mpfd
7
7
  module BaseConvert
8
- #def convert1(docxml, filename, dir)
9
- # FileUtils.cp html_doc_path("logo.jpg"), File.join(@localdir, "logo.jpg")
10
- # FileUtils.cp html_doc_path('mpfa-logo-no-text@4x.png'), File.join(@localdir, "mpfa-logo-no-text@4x.png")
11
- # @files_to_delete << File.join(@localdir, "logo.jpg")
12
- # @files_to_delete << File.join(@localdir, "mpfa-logo-no-text@4x.png")
13
- # super
14
- #end
15
-
16
8
  def metadata_init(lang, script, labels)
17
9
  @meta = Metadata.new(lang, script, labels)
18
10
  end
@@ -54,7 +46,7 @@ module IsoDoc
54
46
 
55
47
  SECTIONS_XPATH =
56
48
  "//foreword | //introduction | //preface/terms | //preface/clause | //annex | "\
57
- "//sections/clause | //bibliography/references | "\
49
+ "//sections/clause | //bibliography/references | //acknowledgements | "\
58
50
  "//bibliography/clause".freeze
59
51
 
60
52
  def terms_defs(isoxml, out, num)
@@ -39,7 +39,7 @@ module IsoDoc
39
39
  set(:doctype, t)
40
40
  end
41
41
 
42
- def status_abbr(status)
42
+ def stage_abbr(status)
43
43
  case status
44
44
  when "working-draft" then "wd"
45
45
  when "committee-draft" then "cd"
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Mpfd
3
- VERSION = "0.3.11"
3
+ VERSION = "0.3.13"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-mpfd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.13
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-02-08 00:00:00.000000000 Z
11
+ date: 2020-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities