Skip to content

Commit

Permalink
https://github.com/metanorma/isodoc/issues/227
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis authored and ronaldtse committed Mar 6, 2024
1 parent 128f7ad commit 9eef675
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
23 changes: 17 additions & 6 deletions develop/topics/adopting-toolchain.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ The modules involve classes which rely on inheritance from other classes; the cu

In the case of `Metanorma::X` classes, the changes you will need to make involve the intermediate XML representation of your document, which is built up through Nokogiri Builder; e.g. adding different enums, or adding new elements. The adaptations in `Metanorma::Generic::Converter` are limited (and are almost all to do with reading in properties from a config file), and most projects can take them across as is.

The customizations needed for `Metanorma::Sample::Processor` are minor, and involve invoking methods specific to the gem for document generation.
The customizations needed for `Metanorma::Generic::Processor` are minor, and involve invoking methods specific to the gem for document generation.

The customizations needed for `Isodoc::Sample` are more extensive. Three base classes are involved:
The customizations needed for `Isodoc::Generic` are more extensive. Three base classes are involved:

* `Isodoc::Metadata` processes the metadata about the document stored
in `//bibdata`. This information typically ends up in the document
Expand Down Expand Up @@ -206,7 +206,7 @@ end
[source,ruby]
--
def version
"Metanorma::Sample #{Metanorma::Sample::VERSION}"
"Metanorma::Generic #{Metanorma::Generic::VERSION}"
end
--

Expand All @@ -226,11 +226,11 @@ end
def output(isodoc_node, outname, format, options={})
case format
when :html
IsoDoc::Sample::HtmlConvert.new(options).convert(outname, isodoc_node)
IsoDoc::Generic::HtmlConvert.new(options).convert(outname, isodoc_node)
when :doc
IsoDoc::Sample::WordConvert.new(options).convert(outname, isodoc_node)
IsoDoc::Generic::WordConvert.new(options).convert(outname, isodoc_node)
when :pdf
IsoDoc::Sample::PdfConvert.new(options).convert(outname, isodoc_node)
IsoDoc::Generic::PdfConvert.new(options).convert(outname, isodoc_node)
else
super
end
Expand Down Expand Up @@ -358,6 +358,7 @@ end
Initialise the HTML Converter:

* Set the default fonts for the HTML rendering, which will be used to populate the HTML CSS stylesheet.
Also add default font sizes [added in https://github.com/metanorma/isodoc/releases/tag/v1.3.0].

[source,ruby]
--
Expand All @@ -366,6 +367,11 @@ def default_fonts(options)
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
monospacefont: '"Space Mono",monospace'
monospacefont: '"Space Mono",monospace',
normalfontsize: "1.0em",
monospacefontsize: "0.8em",
smallerfontsize: "0.9em",
footnotefontsize: "0.8em"
}
end
--
Expand Down Expand Up @@ -397,6 +403,7 @@ end
--

* Set distinct default fonts and HTML assets for the Word rendering.
Also add default font sizes [added in https://github.com/metanorma/isodoc/releases/tag/v1.3.0].

[source,ruby]
--
Expand All @@ -406,6 +413,10 @@ class WordConvert < IsoDoc::WordConvert
bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Arial",sans-serif'),
headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Arial",sans-serif'),
monospacefont: '"Courier New",monospace'
normalfontsize: "12.0pt",
monospacefontsize: "11.0pt",
smallerfontsize: "10.0pt",
footnotefontsize: "9.0pt"
}
end

Expand Down
24 changes: 24 additions & 0 deletions develop/topics/simple-adoption.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,17 @@ default_doctype: "standard"
html_bodyfont: "Overpass",sans-serif
html_headerfont: "Overpass",sans-serif
html_monospacefont: "Space Mono",monospace
html_normalfontsize: "1.0em"
html_monospacefontsize: "0.8em"
html_smallerfontsize: "0.9em"
html_footnotefontsize: "0.8em"
word_bodyfont: "Arial",sans-serif
word_headerfont: "Arial",sans-serif
word_monospacefont: "Courier New",monospace
word_normalfontsize: "12.0pt"
word_monospacefontsize: "11.0pt"
word_smallerfontsize: "10.0pt"
word_footnotefontsize: "9.0pt"
termsdefs_titles:
- Terms and definitions
- Terms, definitions, symbols and abbreviated terms
Expand Down Expand Up @@ -213,12 +221,28 @@ doctypes:

`html_monospacefont`:: The default font to use in HTML output for monospace text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.4.4].

`html_normalfontsize`:: The font size to use in HTML output for body text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`html_monospacefontsize`:: The font size to use in HTML output for monospace text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`html_smallerfontsize`:: The font size to use in HTML output for smaller than body text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`html_footnotefontsize`:: The font size to use in HTML output for footnotes [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`word_bodyfont`:: The default font to use in DOC output for body text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.4.4].

`word_headerfont`:: The default font to use in DOC output for headers [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.4.4].

`word_monospacefont`:: The default font to use in DOC output for monospace text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.4.4].

`word_normalfontsize`:: The font size to use in DOC output for body text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`word_monospacefontsize`:: The font size to use in DOC output for monospace text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`word_smallerfontsize`:: The font size to use in DOC output for smaller than body text [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`word_footnotefontsize`:: The font size to use in DOC output for footnotes [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.8.0].

`metadata_extensions`:: A set of fields to be added to `bibdata/ext` for the document, as metadata. These can be entered in one of two formats:
** A list of single-value fields to add to `bibdata/ext` for the document, as metadata; they will be populated through document attributes with the same name [added in https://github.com/metanorma/metanorma-generic/releases/tag/v1.4.7]. For example,
+
Expand Down

0 comments on commit 9eef675

Please sign in to comment.