Skip to content

Commit

Permalink
version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Dec 19, 2022
1 parent 3d58f96 commit 3bf40eb
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 107 deletions.
2 changes: 0 additions & 2 deletions Gemfile.devel

This file was deleted.

6 changes: 4 additions & 2 deletions lib/isodoc/iec/word_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,19 @@ def word_cleanup(docxml)
super
end

def make_tr_attr(cell, row, totalrows, header)
def make_tr_attr(cell, row, totalrows, header, bordered)
ret = super
css_class =
cell.name == "th" || header ? "TABLE-col-heading" : "TABLE-cell"
ret.merge(class: css_class)
end

def tr_parse(node, out, ord, totalrows, header)
c = node.parent.parent["class"]
bordered = %w(modspec).include?(c) || !c
out.tr do |r|
node.elements.each do |td|
attrs = make_tr_attr(td, ord, totalrows - 1, header)
attrs = make_tr_attr(td, ord, totalrows - 1, header, bordered)
attrs[:class] = "TABLE-col-heading" if header
r.send td.name, **attr_code(attrs) do |entry|
td.children.each { |n| parse(n, entry) }
Expand Down
12 changes: 11 additions & 1 deletion lib/metanorma/iec/isodoc.rng
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,11 @@
<ref name="MultilingualRenderingType"/>
</attribute>
</optional>
<optional>
<attribute name="linenums">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<ref name="tname"/>
</optional>
Expand Down Expand Up @@ -1238,6 +1243,11 @@
</define>
<define name="concept">
<element name="concept">
<optional>
<attribute name="bold">
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="ital">
<data type="boolean"/>
Expand Down Expand Up @@ -2653,7 +2663,7 @@
<value>full</value>
<value>short</value>
<value>id</value>
<value>modspec</value>
<text/>
</choice>
</define>
<define name="erefTypeWithConnective">
Expand Down
2 changes: 1 addition & 1 deletion lib/metanorma/iec/version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Metanorma
module Iec
VERSION = "2.2.0".freeze
VERSION = "2.2.1".freeze
end
end

10 changes: 5 additions & 5 deletions spec/isodoc/i18n_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<title>Foreword</title>
<p id="A">This is a preamble</p>
</foreword>
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">Introduction</title><clause id="C" inline-header="false" obligation="informative">
<title depth="2">0.1<tab/>Introduction Subsection</title>
</clause>
<p>This is patent boilerplate</p>
Expand Down Expand Up @@ -159,7 +159,7 @@
</div>
<br/>
<div class="Section3" id="B">
<h1 class="IntroTitle">0&#160; Introduction</h1>
<h1 class="IntroTitle">Introduction</h1>
<div id="C"><h2>0.1&#160; Introduction Subsection</h2>
</div>
Expand Down Expand Up @@ -312,7 +312,7 @@
<title>Foreword</title>
<p id="A">This is a preamble</p>
</foreword>
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">Introduction</title><clause id="C" inline-header="false" obligation="informative">
<title depth="2">0.1<tab/>Introduction Subsection</title>
</clause>
<p>This is patent boilerplate</p>
Expand Down Expand Up @@ -464,7 +464,7 @@
<title>Foreword</title>
<p id="A">This is a preamble</p>
</foreword>
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">Introduction</title><clause id="C" inline-header="false" obligation="informative">
<title depth="2">0.1<tab/>Introduction Subsection</title>
</clause>
<p>This is patent boilerplate</p>
Expand Down Expand Up @@ -531,7 +531,7 @@
</div>
<br/>
<div class="Section3" id="B">
<h1 class="IntroTitle">0&#160; Introduction</h1>
<h1 class="IntroTitle">Introduction</h1>
<div id="C"><h2>0.1&#160; Introduction Subsection</h2>
</div>
Expand Down
2 changes: 1 addition & 1 deletion spec/isodoc/postproc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@
<a name='samplecode' id='samplecode'/>
<tbody>
<tr>
<td style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;" class="TABLE-cell">
<td style="border-top:solid windowtext 1.5pt;mso-border-top-alt:solid windowtext 1.5pt;border-bottom:solid windowtext 1.5pt;mso-border-bottom-alt:solid windowtext 1.5pt;page-break-after:auto;" class="TABLE-cell">
<p class="CODE-TableCell"><a name="B" id="B"></a>puts "Hello, world."</p>
</td>
</tr>
Expand Down
114 changes: 22 additions & 92 deletions spec/isodoc/ref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,105 +231,35 @@
</p>
</div>
#{IEC_TITLE1}
<div>
<h1>1&#xa0; Normative References</h1>
<p>
The following documents are referred to in the text in such a way that
some or all of their content constitutes requirements of this
document. For dated references, only the edition cited applies. For
undated references, the latest edition of the referenced document
(including any amendments) applies.
</p>
<p id='ISO712' class='NormRef'>
[110], ISO 712,
<i>Cereals and cereal products</i>
</p>
<p id='ISO16634' class='NormRef'>
ISO 16634:-- (all parts)
<a class='FootnoteRef' href='#fn:1'>
<sup>1</sup>
</a>
,
<i>Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</i>
</p>
<p id='ISO20483' class='NormRef'>
ISO 20483:2013-2014,
<i>Cereals and pulses</i>
</p>
<p id='ref1' class='NormRef'>
ICC 167,
<span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
.
<i>
Determination of the protein content in cereal and cereal products
for food and animal feeding stuffs according to the Dumas combustion
method
</i>
(see
<a href='http://www.icc.or.at'>http://www.icc.or.at</a>
)
</p>
<div class='Note'>
<p>
<span class='note_label'>NOTE</span>
&#xa0; This is an annotation of ISO 20483:2013-2014
</p>
<div>
<h1>1  Normative References</h1>
<p>The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
<p id="ISO712" class="NormRef">[110], ISO 712, <i><span class="stddocTitle">Cereals and cereal products</span></i></p>
<p id="ISO16634" class="NormRef">ISO 16634:-- (all parts)<a class="FootnoteRef" href="#fn:1"><sup>1</sup></a>, <i><span class="stddocTitle">Cereals, pulses, milled cereal products, oilseeds and animal feeding stuffs</span></i></p>
<p id="ISO20483" class="NormRef">ISO 20483:2013-2014, <i><span class="stddocTitle">Cereals and pulses</span></i></p>
<p id="ref1" class="NormRef">ICC 167, <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
<div class="Note">
<p><span class="note_label">NOTE</span>  This is an annotation of ISO 20483:2013-2014</p>
</div>
<p id='zip_ffs' class='NormRef'>[5] Title 5</p>
<p id="zip_ffs" class="NormRef">[5] Title 5</p>
</div>
<br/>
<div>
<h1 class='Section3'>Bibliography</h1>
<p id='ISBN' class='Biblio'>
[1]&#xa0;
<i>Chemicals for analytical laboratory use</i>
. n.p.: n.d.
</p>
<p id='ISSN' class='Biblio'>
[2]&#xa0;
<i>Instruments for analytical laboratory use</i>
. n.d.
</p>
<div class='Note'>
<p>
<span class='note_label'>NOTE</span>
&#xa0; This is an annotation of document ISSN.
</p>
<h1 class="Section3">Bibliography</h1>
<p id="ISBN" class="Biblio">[1]  <i>Chemicals for analytical laboratory use</i>. n.p.: n.d.</p>
<p id="ISSN" class="Biblio">[2]  <i>Instruments for analytical laboratory use</i>. n.d.</p>
<div class="Note">
<p><span class="note_label">NOTE</span>  This is an annotation of document ISSN.</p>
</div>
<div class='Note'>
<p>
<span class='note_label'>NOTE</span>
&#xa0; This is another annotation of document ISSN.
</p>
<div class="Note">
<p><span class="note_label">NOTE</span>  This is another annotation of document ISSN.</p>
</div>
<p id='ISO3696' class='Biblio'>
[3]&#xa0; ISO 3696,
<i>Water for analytical laboratory use</i>
</p>
<p id='ref10' class='Biblio'>
[4]&#xa0;
<span style='font-variant:small-caps;'>Standard No I.C.C 167</span>
.
<i>
Determination of the protein content in cereal and cereal products
for food and animal feeding stuffs according to the Dumas combustion
method
</i>
(see
<a href='http://www.icc.or.at'>http://www.icc.or.at</a>
)
</p>
<p id='ref11' class='Biblio'>
[5]&#xa0; IETF RFC 10,
<i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
</p>
<p id='ref12' class='Biblio'>
Citn&#xa0; IETF RFC 20, CitationWorks. 2019.
<i>How to cite a reference</i>
.
</p>
<p id="ISO3696" class="Biblio">[3]  ISO 3696, <i><span class="stddocTitle">Water for analytical laboratory use</span></i></p>
<p id="ref10" class="Biblio">[4]  <span style="font-variant:small-caps;">Standard No I.C.C 167</span>. <i>Determination of the protein content in cereal and cereal products for food and animal feeding stuffs according to the Dumas combustion method</i> (see <a href="http://www.icc.or.at">http://www.icc.or.at</a>)</p>
<p id="ref11" class="Biblio">[5]  IETF RFC 10, <i><span class="stddocTitle">Internet Calendaring and Scheduling Core Object Specification (iCalendar)</span></i></p>
<p id="ref12" class="Biblio">Citn  IETF RFC 20, CitationWorks. 2019. <i>How to cite a reference</i>.</p>
</div>
<aside id='fn:1' class='footnote'>
<aside id="fn:1" class="footnote">
<p>Under preparation. (Stage at the time of publication ISO/DIS 16634)</p>
</aside>
</div>
Expand Down
6 changes: 3 additions & 3 deletions spec/isodoc/section_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<title>Foreword</title>
<p id="A">This is a preamble</p>
</foreword>
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">0<tab/>Introduction</title><clause id="C" inline-header="false" obligation="informative">
<introduction id="B" obligation="informative" displayorder="2"><title depth="1">Introduction</title><clause id="C" inline-header="false" obligation="informative">
<title depth="2">0.1<tab/>Introduction Subsection</title>
</clause>
<p>This is patent boilerplate</p>
Expand Down Expand Up @@ -156,7 +156,7 @@
</div>
<br/>
<div class="Section3" id="B">
<h1 class="IntroTitle">0&#160; Introduction</h1>
<h1 class="IntroTitle">Introduction</h1>
<div id="C">
<h2>0.1&#160; Introduction Subsection</h2>
</div>
Expand Down Expand Up @@ -233,7 +233,7 @@
</div>
<p><br clear="all" style="mso-special-character:line-break;page-break-before:always"/></p>
<div class="Section3" id="B">
<h1 class="IntroTitle">0<span style="mso-tab-count:1">&#160; </span>Introduction</h1>
<h1 class="IntroTitle">Introduction</h1>
<div id="C">
<h2>0.1<span style="mso-tab-count:1">&#160; </span>Introduction Subsection</h2>
</div>
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def xmlpp(xml)
XSL
Nokogiri::XSLT(xsl).transform(Nokogiri::XML(xml, &:noblanks))
.to_xml(indent: 2, encoding: "UTF-8")
.gsub(%r{<fetched>[^<]+</fetched>}, "<fetched/>")
.gsub(%r{ schema-version="[^"]+"}, "")
end

OPTIONS = [backend: :iec, header_footer: true, agree_to_terms: true].freeze
Expand Down

0 comments on commit 3bf40eb

Please sign in to comment.