Skip to content

Commit

Permalink
Use JIS not ISO rendering of references: relaton/relaton-render#52
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Aug 30, 2024
1 parent f3a9413 commit 17354f8
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 21 deletions.
1 change: 1 addition & 0 deletions Gemfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gem "metanorma-jis", git: "https://github.com/metanorma/metanorma-jis", branch: "main"
9 changes: 7 additions & 2 deletions lib/isodoc/plateau/init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ def metadata_init(lang, script, locale, labels)

def xref_init(lang, script, _klass, labels, options)
@xrefs = Xref.new(lang, script,
HtmlConvert.new(language: lang, script: script),
HtmlConvert.new(language: lang, script:),
labels, options)
end

def i18n_init(lang, script, locale, i18nyaml = nil)
@i18n = I18n.new(lang, script, locale: locale,
@i18n = I18n.new(lang, script, locale:,
i18nyaml: i18nyaml || @i18nyaml)
end

def bibrenderer(options = {})
::Relaton::Render::JIS::General.new(options.merge(language: @lang,
i18nhash: @i18n.get))
end
end
end
end
4 changes: 0 additions & 4 deletions lib/isodoc/plateau/presentation_xml_convert.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ def ol_depth(node)
@iso.ol_depth(node)
end

def bibliography_bibitem_number(docxml)
super
end

include Init
end
end
Expand Down
77 changes: 71 additions & 6 deletions lib/metanorma/plateau/basicdoc.rng
Original file line number Diff line number Diff line change
Expand Up @@ -1000,14 +1000,14 @@
<define name="PureTextElement">
<choice>
<text/>
<ref name="em"/>
<ref name="strong"/>
<ref name="pure_em"/>
<ref name="pure_strong"/>
<ref name="sub"/>
<ref name="sup"/>
<ref name="tt"/>
<ref name="underline"/>
<ref name="strike"/>
<ref name="smallcap"/>
<ref name="pure_tt"/>
<ref name="pure_underline"/>
<ref name="pure_strike"/>
<ref name="pure_smallcap"/>
<ref name="br"/>
</choice>
</define>
Expand All @@ -1031,6 +1031,13 @@
</zeroOrMore>
</element>
</define>
<define name="pure_em">
<element name="em">
<zeroOrMore>
<ref name="PureTextElement"/>
</zeroOrMore>
</element>
</define>
<define name="strong">
<element name="strong">
<zeroOrMore>
Expand All @@ -1046,6 +1053,13 @@
</zeroOrMore>
</element>
</define>
<define name="pure_strong">
<element name="strong">
<zeroOrMore>
<ref name="PureTextElement"/>
</zeroOrMore>
</element>
</define>
<define name="tt">
<element name="tt">
<zeroOrMore>
Expand All @@ -1060,6 +1074,13 @@
</zeroOrMore>
</element>
</define>
<define name="pure_tt">
<element name="tt">
<zeroOrMore>
<ref name="PureTextElement"/>
</zeroOrMore>
</element>
</define>
<define name="keyword">
<element name="keyword">
<zeroOrMore>
Expand Down Expand Up @@ -1090,13 +1111,42 @@
<zeroOrMore>
<choice>
<ref name="PureTextElement"/>
<ref name="stem"/>
<ref name="eref"/>
<ref name="xref"/>
<ref name="hyperlink"/>
<ref name="index"/>
<ref name="index-xref"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="pure_strike">
<element name="strike">
<zeroOrMore>
<ref name="PureTextElement"/>
</zeroOrMore>
</element>
</define>
<define name="underline">
<element name="underline">
<optional>
<attribute name="style"/>
</optional>
<zeroOrMore>
<choice>
<ref name="PureTextElement"/>
<ref name="stem"/>
<ref name="eref"/>
<ref name="xref"/>
<ref name="hyperlink"/>
<ref name="index"/>
<ref name="index-xref"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="pure_underline">
<element name="underline">
<optional>
<attribute name="style"/>
Expand All @@ -1107,6 +1157,21 @@
</element>
</define>
<define name="smallcap">
<element name="smallcap">
<zeroOrMore>
<choice>
<ref name="PureTextElement"/>
<ref name="stem"/>
<ref name="eref"/>
<ref name="xref"/>
<ref name="hyperlink"/>
<ref name="index"/>
<ref name="index-xref"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="pure_smallcap">
<element name="smallcap">
<zeroOrMore>
<ref name="PureTextElement"/>
Expand Down
4 changes: 3 additions & 1 deletion lib/metanorma/plateau/biblio.rng
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,9 @@
<optional>
<ref name="formattedref"/>
</optional>
<ref name="btitle"/>
<oneOrMore>
<ref name="btitle"/>
</oneOrMore>
<optional>
<ref name="bplace"/>
</optional>
Expand Down
3 changes: 3 additions & 0 deletions lib/metanorma/plateau/isodoc.rng
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,9 @@
<value>LatexMath</value>
</choice>
</attribute>
<optional>
<attribute name="number-format"/>
</optional>
<attribute name="block">
<data type="boolean"/>
</attribute>
Expand Down
3 changes: 3 additions & 0 deletions lib/metanorma/plateau/reqt.rng
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@
<ref name="MultilingualRenderingType"/>
</attribute>
</optional>
<optional>
<attribute name="class"/>
</optional>
<optional>
<ref name="reqtitle"/>
</optional>
Expand Down
4 changes: 0 additions & 4 deletions spec/isodoc/blocks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,7 @@
</title>
<bibitem id="ISO712" type="standard">
<formattedref>
<em>
<span class="stddocTitle">Cereals and cereal products</span>
</em>
</formattedref>
<docidentifier type="ISO">ISO 712</docidentifier>
<docidentifier scope="biblio-tag">ISO 712</docidentifier>
Expand Down Expand Up @@ -190,9 +188,7 @@
</h1>
<p id="ISO712" class="NormRef">
ISO 712,
<i>
<span class="stddocTitle">Cereals and cereal products</span>
</i>
</p>
</div>
<aside id="fn:1" class="footnote">
Expand Down
4 changes: 0 additions & 4 deletions spec/isodoc/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@
</title>
<bibitem id="ISO712" type="standard">
<formattedref>
<em>
<span class="stddocTitle">Cereals and cereal products</span>
</em>
</formattedref>
<docidentifier type="ISO">ISO 712</docidentifier>
<docidentifier scope="biblio-tag">ISO 712</docidentifier>
Expand Down Expand Up @@ -350,9 +348,7 @@
</h1>
<p id="ISO712" class="NormRef">
ISO 712,
<i>
<span class="stddocTitle">Cereals and cereal products</span>
</i>
</p>
</div>
</div>
Expand Down

0 comments on commit 17354f8

Please sign in to comment.