Skip to content

Commit

Permalink
update spacing in html output
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenpieters committed Aug 23, 2023
1 parent f85c8c3 commit 2dd9e0f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions data/templates/html/rules.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
.Rules {
counter-reset: rule_counter;
list-style: none;
line-height: 1.5em;
}

.SubType {
Expand All @@ -29,6 +30,7 @@
.SubRules {
counter-reset: sub_rule_counter;
list-style: none;
line-height: 1.5em;
}

.Chapter:before {
Expand Down Expand Up @@ -75,6 +77,12 @@
font-style: italic;
}

.Examples {
font-style: italic;
list-style: none;
line-height: 1.5em;
}

.TimingStructureList {
counter-reset: timing_structure_l1;
}
Expand Down
6 changes: 6 additions & 0 deletions rules_doc_generator/model/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 += '<ol class="Examples">'
for example in self.examples:
result += example.to_html(config, id_map)
result += '</ol>'
return result

def to_latex(self, config: Config, id_map: RefDict) -> str:
Expand Down Expand Up @@ -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 += '<ol class="Examples">'
for example in self.examples:
result += example.to_html(config, id_map)
result += '</ol>'
return result

def to_latex(self, config: Config, id_map: RefDict) -> str:
Expand Down Expand Up @@ -149,8 +153,10 @@ def to_html(self, config: Config, id_map: RefDict) -> str:
result += '<ol class="SubRules">'
if self.snippet:
result += f'<p>{self.snippet.to_html(config, id_map)}</p>'
result += '<ol class="Examples">'
for example in self.examples:
result += example.to_html(config, id_map)
result += '</ol>'
for rule in self.rules:
result += f'<li class="SubRule" id="{rule.id}">{rule.to_html(config, id_map)}</li>'
result += '</ol>'
Expand Down
2 changes: 1 addition & 1 deletion rules_doc_generator/model/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class Example:
new: bool

def to_html(self, config: Config, id_map: RefDict) -> str:
return f'<p class="Example">Example: {self.text.to_html(config, id_map)}</p>'
return f'<li class="Example">Example: {self.text.to_html(config, id_map)}</li>'

def to_latex(self, config: Config, id_map: RefDict) -> str:
result = r'\emph{'
Expand Down

0 comments on commit 2dd9e0f

Please sign in to comment.