add color and encoding table

This commit is contained in:
Patrick Kanzler 2023-07-29 01:26:07 +02:00
parent 1309976e6e
commit ed5a259ad0

View File

@ -4,6 +4,15 @@
{{ escape_rst(text) }} {{ escape_rst(text) }}
{{ escape_rst(text) | length * symbol }} {{ escape_rst(text) | length * symbol }}
{%- endmacro %} {%- endmacro %}
{% macro abort(error) %}
{{ None['[ERROR] ' ~ error][0] }}
{% endmacro %}
{% macro fill_line(text, total, symbol=' ') -%}
{%- if total < text|length -%}
{{- abort("Line cannot be filled: must be longer") -}}
{%- endif -%}
{{- text + ((total - text|length ) * symbol ) -}}
{%- endmacro %}
{{ '.. _printer-label-' + item + ':' }} {{ '.. _printer-label-' + item + ':' }}
@ -28,10 +37,18 @@ Fonts
.. todo:: list supported fonts (ID, Name, Columns) .. todo:: list supported fonts (ID, Name, Columns)
Colors Colors
^^^^^^ ^^^^^^
.. todo:: list supported colors (ID, Name) +------------------+----------------------------------------------------------------+
| ID | Color |
+==================+================================================================+
{% for id in printer.colors -%}
| {{ fill_line(escape_rst(id), 16) }} | {{ fill_line(escape_rst(printer.colors[id]), 62) }} |
+------------------+----------------------------------------------------------------+
{% endfor %}
Feature support Feature support
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
@ -57,8 +74,12 @@ starCommands clear
Text code pages Text code pages
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
todo example encoding: :ref:`encoding-label-CP3011` +------------------+----------------------------------------------------------------+
| ID | Encoding |
.. todo: list code pages (ID, Encoding, link to Encoding list) +==================+================================================================+
{% for id in printer.codePages -%}
| {{ fill_line(escape_rst(id), 16) }} | {{ fill_line(':ref:`encoding-label-'+printer.codePages[id]+'`', 62) }} |
+------------------+----------------------------------------------------------------+
{% endfor %}
{% endfor %} {% endfor %}