From 2dd9e0fa93e7ea021d03dfd3994e6f893a0908e0 Mon Sep 17 00:00:00 2001 From: rubenpieters Date: Wed, 23 Aug 2023 21:25:31 +0200 Subject: [PATCH] update spacing in html output --- data/templates/html/rules.css | 8 ++++++++ rules_doc_generator/model/section.py | 6 ++++++ rules_doc_generator/model/text.py | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/data/templates/html/rules.css b/data/templates/html/rules.css index 5649de2..81055a5 100644 --- a/data/templates/html/rules.css +++ b/data/templates/html/rules.css @@ -20,6 +20,7 @@ .Rules { counter-reset: rule_counter; list-style: none; + line-height: 1.5em; } .SubType { @@ -29,6 +30,7 @@ .SubRules { counter-reset: sub_rule_counter; list-style: none; + line-height: 1.5em; } .Chapter:before { @@ -75,6 +77,12 @@ font-style: italic; } +.Examples { + font-style: italic; + list-style: none; + line-height: 1.5em; +} + .TimingStructureList { counter-reset: timing_structure_l1; } diff --git a/rules_doc_generator/model/section.py b/rules_doc_generator/model/section.py index 5bd2323..531ef47 100644 --- a/rules_doc_generator/model/section.py +++ b/rules_doc_generator/model/section.py @@ -78,8 +78,10 @@ class SubRule: def to_html(self, config: Config, id_map: RefDict) -> str: result = self.format_text.to_html(config, id_map) + result += '
    ' for example in self.examples: result += example.to_html(config, id_map) + result += '
' return result def to_latex(self, config: Config, id_map: RefDict) -> str: @@ -109,8 +111,10 @@ class Rule: def to_html(self, config: Config, id_map: RefDict) -> str: result = self.format_text.to_html(config, id_map) + result += '
    ' for example in self.examples: result += example.to_html(config, id_map) + result += '
' return result def to_latex(self, config: Config, id_map: RefDict) -> str: @@ -149,8 +153,10 @@ def to_html(self, config: Config, id_map: RefDict) -> str: result += '
    ' if self.snippet: result += f'

    {self.snippet.to_html(config, id_map)}

    ' + result += '
      ' for example in self.examples: result += example.to_html(config, id_map) + result += '
    ' for rule in self.rules: result += f'
  1. {rule.to_html(config, id_map)}
  2. ' result += '
' diff --git a/rules_doc_generator/model/text.py b/rules_doc_generator/model/text.py index 23411a9..98f0e67 100644 --- a/rules_doc_generator/model/text.py +++ b/rules_doc_generator/model/text.py @@ -187,7 +187,7 @@ class Example: new: bool def to_html(self, config: Config, id_map: RefDict) -> str: - return f'

Example: {self.text.to_html(config, id_map)}

' + return f'
  • Example: {self.text.to_html(config, id_map)}
  • ' def to_latex(self, config: Config, id_map: RefDict) -> str: result = r'\emph{'