Skip to content

Commit

Permalink
Merge branch 'main' into fix/float_clausebefore
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Oct 22, 2023
2 parents a42825f + b198437 commit 95e991f
Show file tree
Hide file tree
Showing 27 changed files with 879 additions and 868 deletions.
4 changes: 4 additions & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
gem "metanorma", git: "https://github.com/metanorma/metanorma", branch: "fix/propagate_output_formats"



1 change: 1 addition & 0 deletions lib/metanorma/standoc/converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Converter
treeprocessor Metanorma::Standoc::ToDoInlineAdmonitionBlock
block Metanorma::Standoc::PlantUMLBlockMacro
block Metanorma::Standoc::PseudocodeBlockMacro
block_macro Metanorma::Standoc::ColumnBreakBlockMacro
end

include ::Asciidoctor::Converter
Expand Down
10 changes: 9 additions & 1 deletion lib/metanorma/standoc/isodoc.rng
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
these elements; we just want one namespace for any child grammars
of this.
-->
<!-- VERSION v1.2.5 -->
<!-- VERSION v1.2.6 -->
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<include href="reqt.rng"/>
<include href="basicdoc.rng">
Expand Down Expand Up @@ -1013,6 +1013,14 @@
</oneOrMore>
</element>
</define>
<define name="BasicBlock" combine="choice">
<ref name="columnbreak"/>
</define>
<define name="columnbreak">
<element name="columnbreak">
<empty/>
</element>
</define>
<define name="MultilingualRenderingType">
<choice>
<value>common</value>
Expand Down
9 changes: 9 additions & 0 deletions lib/metanorma/standoc/macros.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ def process(_document, reader)
end
end

class ColumnBreakBlockMacro < Asciidoctor::Extensions::BlockMacroProcessor
use_dsl
named :columnbreak

def process(parent, _reader, _attrs)
create_pass_block parent, "<columnbreak/>", {}, subs: nil
end
end

# refer https://github.com/asciidoctor/asciidoctor/blob/main/lib/asciidoctor/substitutors.rb
# Not using TreeProcessor because that is still too close to
# inline expressions being processed on access (e.g. titles)
Expand Down
1 change: 1 addition & 0 deletions lib/metanorma/standoc/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def html_path(file)
end

def output(isodoc_node, inname, outname, format, options = {})
options_preprocess(options)
case format
when :html
options = options
Expand Down
6 changes: 6 additions & 0 deletions lib/metanorma/standoc/ref_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ def fetch_ref(xml, code, year, **opts)
nil
end

def supply_ref_prefix(ret)
ret
end

def fetch_ref1(code, year, opts)
code = supply_ref_prefix(code)
if opts[:localfile]
@local_bibdb.get(code, opts[:localfile])
else @bibdb&.fetch(code, year, opts)
Expand All @@ -156,6 +161,7 @@ def unfetchable_ref_code?(ref)
end

def fetch_ref_async(ref, idx, res)
ref[:code] &&= supply_ref_prefix(ref[:code])
if unfetchable_ref_code?(ref)
res << [ref, idx, nil]
idx += 1
Expand Down
3 changes: 3 additions & 0 deletions spec/metanorma/macros_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
date:[2012-03-04,%a-%b%s]
date:[2012-03-04]
columnbreak::[]
[bibliography]
== Bibliography
* [[[ref1,XYZ 123]]] _Title_
Expand Down Expand Up @@ -44,6 +46,7 @@
<span class='category'>text</span>
<date format="%a-%b%s" value="2012-03-04"/>
<date format="%F" value="2012-03-04"/>
<columnbreak/>
</foreword>
</preface>
<sections> </sections>
Expand Down
30 changes: 15 additions & 15 deletions spec/metanorma/refs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1299,23 +1299,23 @@
<references id="_" normative="true" obligation="informative">
<title>Normative references</title>
<p id="_">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>
<bibitem id="iso123" type="proceedings">
<bibitem id="iso123" type="proceedings">
<fetched/>
<title format="text/plain" language="en" script="Latn">Definition of the unit of time (second)</title>
<uri type="citation" language="en" script="Latn">https://www.bipm.org/en/committees/ci/cipm/46-1956/resolution-1</uri>
<uri type="citation" language="fr" script="Latn">https://www.bipm.org/fr/committees/ci/cipm/46-1956/resolution-1</uri>
<uri type="src" language="en" script="Latn">https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/main/cipm/meetings-en/meeting-46.yml</uri>
<uri type="src" language="fr" script="Latn">https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/main/cipm/meetings-fr/meeting-46.yml</uri>
<uri type="pdf">https://www.bipm.org/documents/20126/17315032/CIPM46.pdf/31124ce6-06d5-4981-7c93-a49484479053</uri>
<docidentifier type="BIPM" primary="true">CIPM RES 1 (1956)</docidentifier>
<docidentifier type="BIPM" primary="true" language="en" script="Latn">CIPM RES 1 (1956, E)</docidentifier>
<docidentifier type="BIPM" primary="true" language="fr" script="Latn">CIPM RES 1 (1956, F)</docidentifier>
<docidentifier type="BIPM-long" language="en" script="Latn">CIPM Resolution 1 (1956)</docidentifier>
<docidentifier type="BIPM-long" language="fr" script="Latn">Résolution 1 du CIPM (1956)</docidentifier>
<docidentifier type="BIPM-long">CIPM Resolution 1 (1956) / Résolution 1 du CIPM (1956)</docidentifier>
<docnumber>CIPM RES 1 (1956)</docnumber>
<title format="text/plain" language="en" script="Latn">Adoption of “degree Celsius”</title>
<uri type="citation" language="en" script="Latn">https://www.bipm.org/en/committees/ci/cipm/42-1948/resolution-</uri>
<uri type="citation" language="fr" script="Latn">https://www.bipm.org/fr/committees/ci/cipm/42-1948/resolution-</uri>
<uri type="src" language="en" script="Latn">https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/main/cipm/meetings-en/meeting-42.yml</uri>
<uri type="src" language="fr" script="Latn">https://raw.githubusercontent.com/metanorma/bipm-data-outcomes/main/cipm/meetings-fr/meeting-42.yml</uri>
<uri type="pdf">https://www.bipm.org/documents/20126/17315032/CIPM42.pdf/7f36bfaa-e84b-a7fa-650a-edf6c3de1b46</uri>
<docidentifier type="BIPM" primary="true">CIPM RES (1948)</docidentifier>
<docidentifier type="BIPM" primary="true" language="en" script="Latn">CIPM RES (1948, E)</docidentifier>
<docidentifier type="BIPM" primary="true" language="fr" script="Latn">CIPM RES (1948, F)</docidentifier>
<docidentifier type="BIPM-long" language="en" script="Latn">CIPM Resolution (1948)</docidentifier>
<docidentifier type="BIPM-long" language="fr" script="Latn">Résolution du CIPM (1948)</docidentifier>
<docidentifier type="BIPM-long">CIPM Resolution (1948) / Résolution du CIPM (1948)</docidentifier>
<docnumber>CIPM RES (1948)</docnumber>
<date type="published">
<on>1956-10-06</on>
<on>1948-10-22</on>
</date>
<contributor>
<role type="publisher"/>
Expand Down
50 changes: 25 additions & 25 deletions spec/vcr_cassettes/bipm.yml

Large diffs are not rendered by default.

162 changes: 81 additions & 81 deletions spec/vcr_cassettes/bsi16341.yml

Large diffs are not rendered by default.

164 changes: 82 additions & 82 deletions spec/vcr_cassettes/dated_iso_ref_joint_iso_iec.yml

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions spec/vcr_cassettes/dated_iso_ref_joint_iso_iec1.yml

Large diffs are not rendered by default.

Loading

0 comments on commit 95e991f

Please sign in to comment.