diff --git a/lib/metanorma/standoc/init.rb b/lib/metanorma/standoc/init.rb index ad3c9e1e..07240cd1 100644 --- a/lib/metanorma/standoc/init.rb +++ b/lib/metanorma/standoc/init.rb @@ -6,7 +6,7 @@ module Base def init(node) init_vars init_misc(node) - init_processing(node) + init_processing(node) # feeds init_i18n init_log(node) init_image(node) init_reqt(node) @@ -39,12 +39,13 @@ def init_misc(node) @embed_hdr = node.attr("embed_hdr") @embed_id = node.attr("embed_id") @document_scheme = document_scheme(node) - @xrefstyle = node.attr("xrefstyle") @source_linenums = node.attr("source-linenums-option") == "true" @default_doctype = "standard" end def init_processing(node) + @localdir = Metanorma::Utils::localdir(node) + @xrefstyle = node.attr("xrefstyle") @novalid = node.attr("novalid") @smartquotes = node.attr("smartquotes") != "false" @sourcecode_markup_start = node.attr("sourcecode-markup-start") || "{{{" @@ -100,7 +101,6 @@ def init_output(node) File.basename(node.attr("docfile"))&.gsub(/\.adoc$/, "") else "" end - @localdir = Metanorma::Utils::localdir(node) @output_dir = outputdir node end @@ -109,7 +109,9 @@ def init_i18n(node) @script = node.attr("script") || Metanorma::Utils.default_script(node.attr("language")) @locale = node.attr("locale") - @isodoc = isodoc(@lang, @script, @locale, node.attr("i18nyaml")) + i18nyaml = node.attr("i18nyaml") + i18nyaml &&= File.join(@localdir, i18nyaml) + @isodoc = isodoc(@lang, @script, @locale, i18nyaml) @i18n = @isodoc.i18n end diff --git a/lib/metanorma/standoc/render.rb b/lib/metanorma/standoc/render.rb index 4781231b..19096794 100644 --- a/lib/metanorma/standoc/render.rb +++ b/lib/metanorma/standoc/render.rb @@ -2,12 +2,14 @@ module Metanorma module Standoc module Base def html_extract_attributes(node) + i18nyaml = node.attr("i18nyaml") + i18nyaml &&= File.join(@localdir, i18nyaml) { script: node.attr("script"), bodyfont: node.attr("body-font"), headerfont: node.attr("header-font"), monospacefont: node.attr("monospace-font"), - i18nyaml: node.attr("i18nyaml"), + i18nyaml: i18nyaml, scope: node.attr("scope"), htmlstylesheet: node.attr("htmlstylesheet"), htmlstylesheet_override: node.attr("htmlstylesheet-override"), @@ -48,12 +50,14 @@ def pdf_converter(node) end def doc_extract_attributes(node) + i18nyaml = node.attr("i18nyaml") + i18nyaml &&= File.join(@localdir, i18nyaml) attrs = { script: node.attr("script"), bodyfont: node.attr("body-font"), headerfont: node.attr("header-font"), monospacefont: node.attr("monospace-font"), - i18nyaml: node.attr("i18nyaml"), + i18nyaml: i18nyaml, scope: node.attr("scope"), wordstylesheet: node.attr("wordstylesheet"), wordstylesheet_override: node.attr("wordstylesheet-override"),