Tweak sheet number output

This commit is contained in:
Daniel Rojas 2021-03-27 23:47:23 +01:00
parent 24585ae441
commit 1a41faf187
2 changed files with 5 additions and 4 deletions

View File

@ -254,7 +254,7 @@
<td><!-- %revisions_3_name% --></td>
<td class="company" colspan="3" rowspan="3"><!-- %company% --></td>
<td class="partno" colspan="2" rowspan="3"><!-- %pn% --></td>
<td class="sheetno" rowspan="2"><!-- %sheet_current% --></td>
<td class="sheetno" rowspan="2">Sheet<br /><!-- %sheet_current% --></td>
</tr>
<tr>
<td class="revno"><!-- %revisions_2% --></td>
@ -267,7 +267,7 @@
<td><!-- %revisions_1_changelog% --></td>
<td><!-- %revisions_1_date% --></td>
<td><!-- %revisions_1_name% --></td>
<td class="sheetno"><!-- %sheet_total% --></td>
<td class="sheetno">of <!-- %sheet_total% --></td>
</tr>
<tr>
<td>Rev</td>

View File

@ -61,14 +61,15 @@ def generate_html_output(filename: Union[str, Path], bom_list: List[List[str]],
# insert generator
html = html.replace('<!-- %generator% -->', f'{APP_NAME} {__version__} - {APP_URL}')
# insert other metadata
if metadata:
html = html.replace(f'"sheetsize_default"', '"{}"'.format(metadata.get('template',{}).get('sheetsize', ''))) # include quotes so no replacement happens within <style> definition
# TODO: handle multi-page documents
html = html.replace('<!-- %sheet_current% -->', 'Sheet<br />1')
html = html.replace('<!-- %sheet_total% -->', 'of 1')
html = html.replace('<!-- %sheet_current% -->', '1')
html = html.replace('<!-- %sheet_total% -->', '1')
# fill out other generic metadata
for item, contents in metadata.items():