From 561f251fb872b1051335d79d137bd37e8d976245 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Thu, 11 Apr 2024 20:45:20 +1000 Subject: [PATCH 1/2] rspec --- spec/isodoc/postproc_word_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/isodoc/postproc_word_spec.rb b/spec/isodoc/postproc_word_spec.rb index c00ab12d..db91576a 100644 --- a/spec/isodoc/postproc_word_spec.rb +++ b/spec/isodoc/postproc_word_spec.rb @@ -698,7 +698,7 @@ -

Output wavelength μm

+

Output wavelength μm

Predictive wavelengths From 9acc9588eee9fd056564832b75bef0a25e6751e7 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Tue, 16 Apr 2024 21:09:48 +1000 Subject: [PATCH 2/2] Exclude Table of Contents headings from bare docuemnts (no prefatory material): https://github.com/metanorma/iso-10303-srl/issues/41 --- lib/isodoc/function/section.rb | 13 ++--- spec/isodoc/postproc_spec.rb | 88 +++++++++++++++++----------------- 2 files changed, 50 insertions(+), 51 deletions(-) diff --git a/lib/isodoc/function/section.rb b/lib/isodoc/function/section.rb index 2f34a9cd..5fc96114 100644 --- a/lib/isodoc/function/section.rb +++ b/lib/isodoc/function/section.rb @@ -152,6 +152,7 @@ def preface_normal(clause, out) end def table_of_contents(clause, out) + @bare and return page_break(out) out.div **attr_code(preface_attrs(clause)) do |div| clause_name(clause, clause.at(ns("./title")), div, @@ -194,32 +195,28 @@ def preface_block(block, out) end def copyright_parse(node, out) - return if @bare - + @bare and return out.div class: "boilerplate-copyright" do |div| node.children.each { |n| parse(n, div) } end end def license_parse(node, out) - return if @bare - + @bare and return out.div class: "boilerplate-license" do |div| node.children.each { |n| parse(n, div) } end end def legal_parse(node, out) - return if @bare - + @bare and return out.div class: "boilerplate-legal" do |div| node.children.each { |n| parse(n, div) } end end def feedback_parse(node, out) - return if @bare - + @bare and return out.div class: "boilerplate-feedback" do |div| node.children.each { |n| parse(n, div) } end diff --git a/spec/isodoc/postproc_spec.rb b/spec/isodoc/postproc_spec.rb index faad847e..4be4a5e5 100644 --- a/spec/isodoc/postproc_spec.rb +++ b/spec/isodoc/postproc_spec.rb @@ -366,7 +366,9 @@ olstyle: "l2" }, ).convert("test", <<~INPUT, false) - + + TOC +

These results are based on a study carried out on three different types of kernel.

@@ -377,35 +379,35 @@ html.xpath("//script").each(&:remove) expect(strip_guid(xmlpp(html.to_xml))) .to be_equivalent_to <<~OUTPUT - -
- /* an empty html cover page */ -
-
-
- /* an empty html intro page */ -
-
-
- + +
+ /* an empty html cover page */ +
+
+
+ /* an empty html intro page */ +

-
-

Antaŭparolo

-
-

  These results are based on a study carried out on three different types of kernel.

+
+ +
+
+

Antaŭparolo

+
+

  These results are based on a study carried out on three different types of kernel.

+
-
-
- - OUTPUT + + + OUTPUT end it "populates HTML ToC" do FileUtils.rm_f "test.doc" FileUtils.rm_f "test.html" - IsoDoc::HtmlConvert.new({htmlintropage: "spec/assets/htmlintro.html"}) + IsoDoc::HtmlConvert.new({ htmlintropage: "spec/assets/htmlintro.html" }) .convert("test", <<~INPUT, false) Foreword @@ -425,26 +427,26 @@ .at("//div[@id = 'toc']") expect(strip_guid(xmlpp(html.to_xml))) .to be_equivalent_to xmlpp(<<~OUTPUT) -
- -
- OUTPUT +
+ +
+ OUTPUT end it "reorders footnote numbers in HTML" do