isodoc 1.2.6 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +69 -0
  3. data/README.adoc +1 -3
  4. data/isodoc.gemspec +2 -1
  5. data/lib/isodoc-yaml/i18n-en.yaml +56 -0
  6. data/lib/isodoc-yaml/i18n-fr.yaml +64 -7
  7. data/lib/isodoc-yaml/i18n-zh-Hans.yaml +1 -0
  8. data/lib/isodoc/base_style/all.css +4 -0
  9. data/lib/isodoc/base_style/blocks.scss +2 -2
  10. data/lib/isodoc/base_style/reset.css +4 -0
  11. data/lib/isodoc/base_style/reset.scss +5 -0
  12. data/lib/isodoc/base_style/typography.scss +1 -1
  13. data/lib/isodoc/convert.rb +13 -98
  14. data/lib/isodoc/css.rb +95 -0
  15. data/lib/isodoc/function/inline.rb +0 -33
  16. data/lib/isodoc/function/inline_simple.rb +4 -1
  17. data/lib/isodoc/function/lists.rb +2 -1
  18. data/lib/isodoc/function/references.rb +8 -13
  19. data/lib/isodoc/function/section.rb +1 -1
  20. data/lib/isodoc/function/table.rb +10 -0
  21. data/lib/isodoc/function/to_word_html.rb +2 -2
  22. data/lib/isodoc/gem_tasks.rb +4 -0
  23. data/lib/isodoc/html_function/html.rb +1 -0
  24. data/lib/isodoc/html_function/mathvariant_to_plain.rb +82 -0
  25. data/lib/isodoc/html_function/postprocess.rb +41 -20
  26. data/lib/isodoc/i18n.rb +15 -2
  27. data/lib/isodoc/metadata.rb +28 -109
  28. data/lib/isodoc/metadata_contributor.rb +91 -0
  29. data/lib/isodoc/metadata_date.rb +6 -0
  30. data/lib/isodoc/presentation_function/bibdata.rb +79 -7
  31. data/lib/isodoc/presentation_function/block.rb +14 -9
  32. data/lib/isodoc/presentation_function/inline.rb +126 -22
  33. data/lib/isodoc/presentation_function/section.rb +9 -0
  34. data/lib/isodoc/presentation_xml_convert.rb +5 -0
  35. data/lib/isodoc/version.rb +1 -1
  36. data/lib/isodoc/word_convert.rb +0 -20
  37. data/lib/isodoc/word_function/body.rb +12 -0
  38. data/lib/isodoc/word_function/postprocess.rb +38 -80
  39. data/lib/isodoc/word_function/postprocess_cover.rb +55 -0
  40. data/lib/isodoc/word_function/table.rb +10 -0
  41. data/lib/isodoc/xref.rb +1 -0
  42. data/lib/isodoc/xref/xref_counter.rb +20 -9
  43. data/lib/isodoc/xref/xref_gen.rb +20 -2
  44. data/lib/isodoc/xref/xref_sect_gen.rb +1 -1
  45. data/spec/assets/html.scss +14 -0
  46. data/spec/assets/i18n.yaml +17 -9
  47. data/spec/isodoc/blocks_spec.rb +89 -241
  48. data/spec/isodoc/cleanup_spec.rb +0 -1
  49. data/spec/isodoc/footnotes_spec.rb +4 -5
  50. data/spec/isodoc/i18n_spec.rb +73 -38
  51. data/spec/isodoc/inline_spec.rb +177 -199
  52. data/spec/isodoc/lists_spec.rb +1 -1
  53. data/spec/isodoc/metadata_spec.rb +50 -7
  54. data/spec/isodoc/postproc_spec.rb +472 -11
  55. data/spec/isodoc/presentation_xml_spec.rb +584 -1
  56. data/spec/isodoc/ref_spec.rb +327 -12
  57. data/spec/isodoc/table_spec.rb +28 -0
  58. data/spec/isodoc/xref_spec.rb +162 -17
  59. data/spec/spec_helper.rb +2 -0
  60. metadata +22 -7
  61. data/.github/workflows/macos.yml +0 -42
  62. data/.github/workflows/ubuntu.yml +0 -62
  63. data/.github/workflows/windows.yml +0 -44
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcbc3f4f71f739273b06483080ad077fcda05b20f8eca96858300543b0fb2784
4
- data.tar.gz: f0c4a29519de6c22dbc47af2193d8f4ee0a2c925c5d0c9f58414813be28070ef
3
+ metadata.gz: bf37a37eb402d844a36b33e3911c67d3ebcbef7bf7f864dfc0e9f3a8aca7603c
4
+ data.tar.gz: cc3645b92e85d43e2c6e49cfce67cc13d0f656cf1c16d67247cb7053eceba394
5
5
  SHA512:
6
- metadata.gz: 5eb17f999c954a1185f60807f5c9b4dcdde33391fd95546d51dca4a00aee8d742736155313153a5007205d06d189c5ee69b39152db57478669e54e7622fde568
7
- data.tar.gz: e0122186b16428b61c7009d7c8560ab12de531a8ec3bac56e58e89528f4a2a0acd2e1ab4ce4453919f7ed2707e7724037175852a3dc148a53bb0eef63aa5f695
6
+ metadata.gz: 83bfcc73e86c73c9373bf9b42170ebc58c4ae50e4a0789cacddefa05c5b80fe1c59559e3abde2071e79aa3fd839d7844b3c0145ca89ed09b9d6d7e09b1e03de9
7
+ data.tar.gz: 11fbb6a5a6a19eadae64d22dd032185eaed46a1dd007f188e26cc73153e75ceb16ec3c64c8613c8dc05e0263fafab98655287e23993c34ebcf815096dca50bda
@@ -0,0 +1,69 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
+ runs-on: ${{ matrix.os }}
15
+ continue-on-error: ${{ matrix.experimental }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ ruby: [ '2.6', '2.5', '2.4' ]
20
+ os: [ ubuntu-latest, windows-latest, macos-latest ]
21
+ experimental: [ false ]
22
+ include:
23
+ - ruby: '2.7'
24
+ os: 'ubuntu-latest'
25
+ experimental: true
26
+ - ruby: '2.7'
27
+ os: 'windows-latest'
28
+ experimental: true
29
+ - ruby: '2.7'
30
+ os: 'macos-latest'
31
+ experimental: true
32
+ steps:
33
+ - uses: actions/checkout@master
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: ${{ matrix.ruby }}
38
+
39
+ - uses: actions/cache@v2
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
48
+
49
+ - name: Install Inkscape macOS
50
+ if: matrix.os == 'macos-latest'
51
+ run: |
52
+ brew cask install inkscape
53
+ inkscape --version
54
+
55
+ - name: Install Inkscape Ubuntu
56
+ if: matrix.os == 'ubuntu-latest'
57
+ run: |
58
+ sudo add-apt-repository ppa:inkscape.dev/stable
59
+ sudo apt update
60
+ sudo apt install inkscape
61
+ inkscape --version
62
+
63
+ - name: Install Inkscape Windows
64
+ if: matrix.os == 'windows-latest'
65
+ run: |
66
+ choco install --no-progress -y inkscape
67
+ inkscape --version
68
+
69
+ - run: bundle exec rake
@@ -1,9 +1,7 @@
1
1
  = isodoc: Processor to generate HTML/Word from Metanorma XML
2
2
 
3
3
  image:https://img.shields.io/gem/v/isodoc.svg["Gem Version", link="https://rubygems.org/gems/isodoc"]
4
- image:https://github.com/metanorma/isodoc/workflows/ubuntu/badge.svg["Ubuntu Build Status", link="https://github.com/metanorma/isodoc/actions?query=workflow%3Aubuntu"]
5
- image:https://github.com/metanorma/isodoc/workflows/macos/badge.svg["OSX Build Status", link="https://github.com/metanorma/isodoc/actions?query=workflow%3Amacos"]
6
- image:https://github.com/metanorma/isodoc/workflows/windows/badge.svg["Windows Build Status", link="https://github.com/metanorma/isodoc/actions?query=workflow%3Awindows"]
4
+ image:https://github.com/metanorma/isodoc/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/isodoc/actions?query=workflow%3Arake"]
7
5
  image:https://codeclimate.com/github/metanorma/isodoc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/isodoc"]
8
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/isodoc.svg["Pull Requests", link="https://github.com/metanorma/isodoc/pulls"]
9
7
  image:https://img.shields.io/github/commits-since/metanorma/isodoc/latest.svg["Commits since latest",link="https://github.com/metanorma/isodoc/releases"]
@@ -35,8 +35,9 @@ Gem::Specification.new do |spec|
35
35
  spec.add_dependency "uuidtools"
36
36
  spec.add_dependency "html2doc", "~> 1.0.0"
37
37
  spec.add_dependency "liquid"
38
+ spec.add_dependency "twitter_cldr"
38
39
  spec.add_dependency "roman-numerals"
39
- spec.add_dependency "metanorma", "~> 1.1.0"
40
+ spec.add_dependency "metanorma", "~> 1.2.0"
40
41
  spec.add_dependency "relaton-cli"
41
42
 
42
43
  spec.add_development_dependency "rake", "~> 13.0"
@@ -36,6 +36,7 @@ external_terms_boilerplate: |
36
36
  internal_external_terms_boilerplate: |
37
37
  <p>For the purposes of this document, the terms and definitions
38
38
  given in % and the following apply.</p>
39
+ term_defined_in: "[term defined in %]"
39
40
  note: NOTE
40
41
  note_xref: Note
41
42
  termnote: Note % to entry
@@ -96,3 +97,58 @@ locality: {
96
97
  note: Note,
97
98
  formula: Formula
98
99
  }
100
+ inflection:
101
+ Clause:
102
+ sg: Clause
103
+ pl: Clauses
104
+ Annex:
105
+ sg: Annex
106
+ pl: Annexes
107
+ Appendix:
108
+ sg: Appendix
109
+ pl: Appendixes
110
+ Note:
111
+ sg: Note
112
+ pl: Notes
113
+ "Note % to entry":
114
+ sg: Note % to entry
115
+ pl: Notes % to entry
116
+ List:
117
+ sg: List
118
+ pl: Lists
119
+ Figure:
120
+ sg: Figure
121
+ pl: Figures
122
+ Formula:
123
+ sg: Formula
124
+ pl: Formulas
125
+ Table:
126
+ sg: Table
127
+ pl: Tables
128
+ Requirement:
129
+ sg: Requirement
130
+ pl: Requirements
131
+ Recommendation:
132
+ sg: Recommendation
133
+ pl: Recommendations
134
+ Permission:
135
+ sg: Permission
136
+ pl: Permissions
137
+ Example:
138
+ sg: Example
139
+ pl: Examples
140
+ Part:
141
+ sg: Part
142
+ pl: Parts
143
+ Section:
144
+ sg: Section
145
+ pl: Sections
146
+ Paragraph:
147
+ sg: Paragraph
148
+ pl: Paragraphs
149
+ Chapter:
150
+ sg: Chapter
151
+ pl: Chapters
152
+ Page:
153
+ sg: Page
154
+ pl: Pages
@@ -1,5 +1,5 @@
1
1
  term_def_boilerplate:
2
- scope: Domaine d'application
2
+ scope: Domaine dapplication
3
3
  symbolsabbrev: Symboles et termes abrégés
4
4
  abbrev: Termes abrégés
5
5
  symbols: Symboles
@@ -18,20 +18,21 @@ clause: Article
18
18
  annex: Annexe
19
19
  appendix: Appendice
20
20
  no_terms_boilerplate: |
21
- <p>Aucun terme n'est defini dans le présent document.</p>
21
+ <p>Aucun terme nest defini dans le présent document.</p>
22
22
  internal_terms_boilerplate: |
23
- <p>Pour les besoins du présent document, les termes et définitions suivants s'appliquent.</p>
23
+ <p>Pour les besoins du présent document, les termes et définitions suivants sappliquent.</p>
24
24
  norm_with_refs_pref:
25
- Les documents suivants cités dans le texte constituent, pour tout ou partie de leur contenu, des exigences du présent document. Pour les références datées, seule l’édition citée s'applique. Pour les références non datées, la dernière édition du document de référence s'applique (y compris les éventuels amendements).
25
+ Les documents suivants cités dans le texte constituent, pour tout ou partie de leur contenu, des exigences du présent document. Pour les références datées, seule l’édition citée sapplique. Pour les références non datées, la dernière édition du document de référence sapplique (y compris les éventuels amendements).
26
26
  norm_empty_pref:
27
27
  Le présent document ne contient aucune référence normative.
28
28
  external_terms_boilerplate: |
29
- <p>Pour les besoins du présent document, les termes et définitions de % s'appliquent.</p>
29
+ <p>Pour les besoins du présent document, les termes et définitions de % sappliquent.</p>
30
30
  internal_external_terms_boilerplate: |
31
- <p>Pour les besoins du présent document, les termes et définitions de % ainsi que les suivants, s'appliquent.</p>
31
+ <p>Pour les besoins du présent document, les termes et définitions de % ainsi que les suivants, sappliquent.</p>
32
+ term_defined_in: "[terme défini dans %]"
32
33
  note: NOTE
33
34
  note_xref: Note
34
- termnote: Note % à l'article
35
+ termnote: Note % à larticle
35
36
  figure: Figure
36
37
  formula: Formule
37
38
  inequality: Formule
@@ -89,3 +90,59 @@ locality: {
89
90
  note: Note,
90
91
  formula: Formule
91
92
  }
93
+ inflection:
94
+ Clause:
95
+ sg: Article
96
+ pl: Articles
97
+ Annex:
98
+ sg: Annexe
99
+ pl: Annexes
100
+ Appendix:
101
+ sg: Appendice
102
+ pl: Appendices
103
+ Note:
104
+ sg: Note
105
+ pl: Notes
106
+ "Note % à l’article":
107
+ sg: Note % à l’article
108
+ pl: Notes % à l’article
109
+ List:
110
+ sg: Liste
111
+ pl: Listes
112
+ Figure:
113
+ sg: Figure
114
+ pl: Figures
115
+ Formula:
116
+ sg: Formule
117
+ pl: Formules
118
+ Table:
119
+ sg: Tableau
120
+ pl: Tableaux
121
+ Requirement:
122
+ sg: Exigence
123
+ pl: Exigences
124
+ Recommendation:
125
+ sg: Recommandation
126
+ pl: Recommandations
127
+ Permission:
128
+ sg: Autorisation
129
+ pl: Autorisations
130
+ Example:
131
+ sg: Exemple
132
+ pl: Exemples
133
+ Part:
134
+ sg: Partie
135
+ pl: Parties
136
+ Section:
137
+ sg: Section
138
+ pl: Sections
139
+ Paragraph:
140
+ sg: Alinéa
141
+ pl: Alinéas
142
+ Chapter:
143
+ sg: Chapitre
144
+ pl: Chapitres
145
+ Page:
146
+ sg: Page
147
+ pl: Pages
148
+
@@ -31,6 +31,7 @@ external_terms_boilerplate: |
31
31
  <p>% 界定的术语和定义适用于本文件。</p>
32
32
  internal_external_terms_boilerplate: |
33
33
  <p>% 界定的以及下列术语和定义适用于本文件。</p>
34
+ term_defined_in: "〖术语于%中定义〗"
34
35
  note: 注
35
36
  note_xref: 注
36
37
  termnote: 注%
@@ -104,6 +104,10 @@ b, strong {
104
104
  div.document-stage-band, div.document-type-band {
105
105
  background-color: #333333; }
106
106
 
107
+ a.FootnoteRef + a.FootnoteRef:before {
108
+ content: ", ";
109
+ vertical-align: super; }
110
+
107
111
  #standard-band {
108
112
  background-color: #0AC442; }
109
113
 
@@ -50,7 +50,7 @@
50
50
  }
51
51
 
52
52
  background-color: $colorBg;
53
- font-size: 0.8em;
53
+ font-size: $monospacefontsize;
54
54
  line-height: 1.6em;
55
55
  padding: 1.5em;
56
56
  margin: 2em 0 1em 0;
@@ -68,7 +68,7 @@
68
68
  }
69
69
 
70
70
  background-color: $colorBg;
71
- font-size: 0.8em;
71
+ font-size: $monospacefontsize;
72
72
  line-height: 1.6em;
73
73
  padding: 1.5em;
74
74
  margin: 2em 0 1em 0;
@@ -103,3 +103,7 @@ b, strong {
103
103
 
104
104
  div.document-stage-band, div.document-type-band {
105
105
  background-color: #333333; }
106
+
107
+ a.FootnoteRef + a.FootnoteRef:before {
108
+ content: ", ";
109
+ vertical-align: super; }
@@ -127,3 +127,8 @@ b, strong {
127
127
  div.document-stage-band, div.document-type-band {
128
128
  background-color: #333333;
129
129
  }
130
+
131
+ a.FootnoteRef + a.FootnoteRef:before {
132
+ content: ", ";
133
+ vertical-align: super;
134
+ }
@@ -56,7 +56,7 @@
56
56
 
57
57
  &, th, td {
58
58
  border: $border;
59
- font-size: 0.95em;
59
+ font-size: 0.95em; // NN 20201115: ??? normalfontsize - 0.05?
60
60
  }
61
61
  th, td {
62
62
  padding: 1em;
@@ -3,6 +3,7 @@ require "isodoc/common"
3
3
  require "fileutils"
4
4
  require "tempfile"
5
5
  require_relative "i18n"
6
+ require_relative "css"
6
7
 
7
8
  module IsoDoc
8
9
  class Convert < ::IsoDoc::Common
@@ -17,6 +18,10 @@ module IsoDoc
17
18
  # wordcoverpage: Cover page for Word
18
19
  # htmlintropage: Introductory page for HTML
19
20
  # wordintropage: Introductory page for Word
21
+ # normalfontsize: Font size for body text
22
+ # smallerfontsize: Font size for smaller than body text
23
+ # monospacefontsize: Font size for monospace font
24
+ # footnotefontsize: Font size for footnotes
20
25
  # i18nyaml: YAML file for internationalisation of text
21
26
  # ulstyle: list style in Word CSS for unordered lists
22
27
  # olstyle: list style in Word CSS for ordered lists
@@ -25,8 +30,10 @@ module IsoDoc
25
30
  # monospace: font to use for monospace text
26
31
  # suppressheadingnumbers: suppress heading numbers for clauses
27
32
  # scripts: Scripts file for HTML
28
- # scripts_pdf: Scripts file for PDF
33
+ # scripts_pdf: Scripts file for PDF (not used in XSLT PDF)
29
34
  # datauriimage: Encode images in HTML output as data URIs
35
+ # break_up_urls_in_tables: whether to insert spaces in URLs in tables
36
+ # every 40-odd chars
30
37
  def initialize(options)
31
38
  @libdir ||= File.dirname(__FILE__)
32
39
  options.merge!(default_fonts(options)) do |_, old, new|
@@ -46,6 +53,10 @@ module IsoDoc
46
53
  @wordcoverpage = options[:wordcoverpage]
47
54
  @htmlintropage = options[:htmlintropage]
48
55
  @wordintropage = options[:wordintropage]
56
+ @normalfontsize = options[:normalfontsize]
57
+ @smallerfontsize = options[:smallerfontsize]
58
+ @monospacefontsize = options[:monospacefontsize]
59
+ @footnotefontsize = options[:footnotefontsize]
49
60
  @scripts = options[:scripts]
50
61
  @scripts_pdf = options[:scripts_pdf]
51
62
  @i18nyaml = options[:i18nyaml]
@@ -80,75 +91,10 @@ module IsoDoc
80
91
  @fn_bookmarks = {}
81
92
  end
82
93
 
83
- # Check if already compiled version(.css) exists,
84
- # if not, return original scss file. During release
85
- # we compile scss into css files in order to not depend on scss
86
- def precompiled_style_or_original(stylesheet_path)
87
- # Already have compiled stylesheet, use it
88
- return stylesheet_path if stylesheet_path.nil? ||
89
- File.extname(stylesheet_path) == '.css'
90
-
91
- basename = File.basename(stylesheet_path, '.*')
92
- compiled_path = File.join(File.dirname(stylesheet_path),
93
- "#{basename}.css")
94
- return stylesheet_path unless File.file?(compiled_path)
95
-
96
- compiled_path
97
- end
98
-
99
- # run this after @meta is populated
100
- def populate_css
101
- @htmlstylesheet = generate_css(@htmlstylesheet_name, true)
102
- @wordstylesheet = generate_css(@wordstylesheet_name, false)
103
- @standardstylesheet = generate_css(@standardstylesheet_name, false)
104
- end
105
-
106
94
  def tmpimagedir_suffix
107
95
  '_images'
108
96
  end
109
97
 
110
- def default_fonts(_options)
111
- {
112
- bodyfont: 'Arial',
113
- headerfont: 'Arial',
114
- monospacefont: 'Courier'
115
- }
116
- end
117
-
118
- # none for this parent gem, but will be populated in child gems
119
- # which have access to stylesheets &c; e.g.
120
- # {
121
- # htmlstylesheet: html_doc_path("htmlstyle.scss"),
122
- # htmlcoverpage: html_doc_path("html_rsd_titlepage.html"),
123
- # htmlintropage: html_doc_path("html_rsd_intro.html"),
124
- # scripts: html_doc_path("scripts.html"),
125
- # wordstylesheet: html_doc_path("wordstyle.scss"),
126
- # standardstylesheet: html_doc_path("rsd.scss"),
127
- # header: html_doc_path("header.html"),
128
- # wordcoverpage: html_doc_path("word_rsd_titlepage.html"),
129
- # wordintropage: html_doc_path("word_rsd_intro.html"),
130
- # ulstyle: l3
131
- # olstyle: l2
132
- # }
133
- def default_file_locations(_options)
134
- {}
135
- end
136
-
137
- def fonts_options
138
- {
139
- 'bodyfont' => options[:bodyfont] || 'Arial',
140
- 'headerfont' => options[:headerfont] || 'Arial',
141
- 'monospacefont' => options[:monospacefont] || 'Courier'
142
- }
143
- end
144
-
145
- def scss_fontheader
146
- b = options[:bodyfont] || 'Arial'
147
- h = options[:headerfont] || 'Arial'
148
- m = options[:monospacefont] || 'Courier'
149
- "$bodyfont: #{b};\n$headerfont: #{h};\n$monospacefont: #{m};\n"
150
- end
151
-
152
98
  def html_doc_path(*file)
153
99
  file.each do |f|
154
100
  ret = File.join(@libdir, File.join('html', f))
@@ -157,37 +103,6 @@ module IsoDoc
157
103
  nil
158
104
  end
159
105
 
160
- def convert_scss(filename, stylesheet)
161
- require 'sassc'
162
- require 'isodoc/sassc_importer'
163
-
164
- [File.join(Gem.loaded_specs['isodoc'].full_gem_path,
165
- 'lib', 'isodoc'),
166
- File.dirname(filename)].each do |name|
167
- SassC.load_paths << name
168
- end
169
- SassC::Engine.new(scss_fontheader + stylesheet, syntax: :scss,
170
- importer: SasscImporter)
171
- .render
172
- end
173
-
174
- def generate_css(filename, stripwordcss)
175
- return nil if filename.nil?
176
-
177
- filename = precompiled_style_or_original(filename)
178
- stylesheet = File.read(filename, encoding: 'UTF-8')
179
- stylesheet = populate_template(stylesheet, :word)
180
- stylesheet.gsub!(/(\s|\{)mso-[^:]+:[^;]+;/m, '\\1') if stripwordcss
181
- if File.extname(filename) == '.scss'
182
- stylesheet = convert_scss(filename, stylesheet)
183
- end
184
- Tempfile.open([File.basename(filename, '.*'), 'css'],
185
- encoding: 'utf-8') do |f|
186
- f.write(stylesheet)
187
- f
188
- end
189
- end
190
-
191
106
  def convert1(docxml, filename, dir)
192
107
  @xrefs.parse docxml
193
108
  noko do |xml|
@@ -242,7 +157,7 @@ module IsoDoc
242
157
  FileUtils.rm_rf dir
243
158
  end
244
159
 
245
- def middle_clause
160
+ def middle_clause(docxml = nil)
246
161
  "//clause[parent::sections][not(@type = 'scope')]"\
247
162
  '[not(descendant::terms)]'
248
163
  end