From 17354f8391f989ba53460a7587548cc082af9783 Mon Sep 17 00:00:00 2001 From: Nick Nicholas Date: Sat, 31 Aug 2024 01:46:31 +1000 Subject: [PATCH] Use JIS not ISO rendering of references: https://github.com/relaton/relaton-render/issues/52 --- Gemfile.devel | 1 + lib/isodoc/plateau/init.rb | 9 ++- .../plateau/presentation_xml_convert.rb | 4 - lib/metanorma/plateau/basicdoc.rng | 77 +++++++++++++++++-- lib/metanorma/plateau/biblio.rng | 4 +- lib/metanorma/plateau/isodoc.rng | 3 + lib/metanorma/plateau/reqt.rng | 3 + spec/isodoc/blocks_spec.rb | 4 - spec/isodoc/table_spec.rb | 4 - 9 files changed, 88 insertions(+), 21 deletions(-) create mode 100644 Gemfile.devel diff --git a/Gemfile.devel b/Gemfile.devel new file mode 100644 index 0000000..e1c0692 --- /dev/null +++ b/Gemfile.devel @@ -0,0 +1 @@ +gem "metanorma-jis", git: "https://github.com/metanorma/metanorma-jis", branch: "main" diff --git a/lib/isodoc/plateau/init.rb b/lib/isodoc/plateau/init.rb index 7bcde7b..fb998dd 100644 --- a/lib/isodoc/plateau/init.rb +++ b/lib/isodoc/plateau/init.rb @@ -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 diff --git a/lib/isodoc/plateau/presentation_xml_convert.rb b/lib/isodoc/plateau/presentation_xml_convert.rb index b64772c..347ef5a 100644 --- a/lib/isodoc/plateau/presentation_xml_convert.rb +++ b/lib/isodoc/plateau/presentation_xml_convert.rb @@ -79,10 +79,6 @@ def ol_depth(node) @iso.ol_depth(node) end - def bibliography_bibitem_number(docxml) - super - end - include Init end end diff --git a/lib/metanorma/plateau/basicdoc.rng b/lib/metanorma/plateau/basicdoc.rng index 149ad92..bad967a 100644 --- a/lib/metanorma/plateau/basicdoc.rng +++ b/lib/metanorma/plateau/basicdoc.rng @@ -1000,14 +1000,14 @@ - - + + - - - - + + + + @@ -1031,6 +1031,13 @@ + + + + + + + @@ -1046,6 +1053,13 @@ + + + + + + + @@ -1060,6 +1074,13 @@ + + + + + + + @@ -1090,13 +1111,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1107,6 +1157,21 @@ + + + + + + + + + + + + + + + diff --git a/lib/metanorma/plateau/biblio.rng b/lib/metanorma/plateau/biblio.rng index da6961a..7d8f7ab 100644 --- a/lib/metanorma/plateau/biblio.rng +++ b/lib/metanorma/plateau/biblio.rng @@ -1204,7 +1204,9 @@ - + + + diff --git a/lib/metanorma/plateau/isodoc.rng b/lib/metanorma/plateau/isodoc.rng index e630480..4835b17 100644 --- a/lib/metanorma/plateau/isodoc.rng +++ b/lib/metanorma/plateau/isodoc.rng @@ -662,6 +662,9 @@ LatexMath + + + diff --git a/lib/metanorma/plateau/reqt.rng b/lib/metanorma/plateau/reqt.rng index 3f835c8..3d591b2 100644 --- a/lib/metanorma/plateau/reqt.rng +++ b/lib/metanorma/plateau/reqt.rng @@ -66,6 +66,9 @@ + + + diff --git a/spec/isodoc/blocks_spec.rb b/spec/isodoc/blocks_spec.rb index 8d4af8c..9404a4d 100644 --- a/spec/isodoc/blocks_spec.rb +++ b/spec/isodoc/blocks_spec.rb @@ -112,9 +112,7 @@ - Cereals and cereal products - ISO 712 ISO 712 @@ -190,9 +188,7 @@

ISO 712, - Cereals and cereal products -