{% for item in data.profiles %} {% set printer = data.profiles[item] %} {% macro draw_with_underline(text, symbol='-') -%} {{ escape_rst(text) }} {{ escape_rst(text) | length * symbol }} {%- 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 + ':' }} {{ draw_with_underline(printer.name) }} {{ escape_rst(printer.notes) }} You can select this profile in python-escpos with this identifier: ``{{ item }}``. (Set parameter to `profile='{{ item }}'`.) Basic information ^^^^^^^^^^^^^^^^^ ====================== ================================================================ Name {{ escape_rst(printer.name|default('Unknown')) }} Vendor {{ escape_rst(printer.vendor|default('Unknown')) }} Media width (mm) {{ escape_rst(printer.media.width.mm|default('Unknown')|string) }} Media width (pixels) {{ escape_rst(printer.media.width.pixels|default('Unknown')|string) }} DPI {{ escape_rst(printer.media.dpi|default('Unknown')|string) }} ====================== ================================================================ Fonts ^^^^^ .. todo:: list supported fonts (ID, Name, Columns) Colors ^^^^^^ +------------------+----------------------------------------------------------------+ | ID | Color | +==================+================================================================+ {% for id in printer.colors -%} | {{ fill_line(escape_rst(id), 16) }} | {{ fill_line(escape_rst(printer.colors[id]), 62) }} | +------------------+----------------------------------------------------------------+ {% endfor %} Feature support ^^^^^^^^^^^^^^^ .. todo:: list features (parse table) ================ ======= barcodeA check barcodeB check bitImageColumn check bitImageRaster check graphics check highDensity check paperFullCut check paperPartCut check pdf417Code check pulseBel clear pulseStandard check qrCode check starCommands clear ================ ======= Text code pages ^^^^^^^^^^^^^^^ +------------------+----------------------------------------------------------------+ | ID | Encoding | +==================+================================================================+ {% for id in printer.codePages -%} | {{ fill_line(escape_rst(id), 16) }} | {{ fill_line(':ref:`encoding-label-'+printer.codePages[id]+'`', 62) }} | +------------------+----------------------------------------------------------------+ {% endfor %} {% endfor %}