diff --git a/doc/capability_templates/capabilities-template-encoding.jinja b/doc/capability_templates/capabilities-template-encoding.jinja new file mode 100644 index 0000000..1b204cc --- /dev/null +++ b/doc/capability_templates/capabilities-template-encoding.jinja @@ -0,0 +1,28 @@ +{% for item in data.encodings %} +{% set encoding = data.encodings[item] %} +{% macro draw_with_underline(text, symbol='-') -%} +{{ escape_rst(text) }} +{{ escape_rst(text) | length * symbol }} +{%- endmacro %} + +{{ '.. _encoding-label-' + item + ':' }} + +{{ draw_with_underline(encoding.name) }} + +{{ escape_rst(encoding.notes) }} + +Mapping Information +^^^^^^^^^^^^^^^^^^^ + +====================== ================================================================ +identifier {{ escape_rst(item) }} +Name {{ escape_rst(encoding.name|default('Unknown')) }} +Iconv Name {{ escape_rst(encoding.iconv|default('Unknown')) }} +``python_encode`` Name {{ escape_rst(encoding.python_encode|default('Unknown')) }} +====================== ================================================================ + +{% if encoding.data is defined %} +{{ draw_with_underline('Code page data', symbol='^') }} +{{ encoding.data }} +{% endif %} +{% endfor %} \ No newline at end of file diff --git a/doc/capability_templates/capabilities-template.jinja b/doc/capability_templates/capabilities-template.jinja index db0ab0e..e30f701 100644 --- a/doc/capability_templates/capabilities-template.jinja +++ b/doc/capability_templates/capabilities-template.jinja @@ -4,10 +4,13 @@ {{ escape_rst(text) }} {{ escape_rst(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 }}`. +You can select this profile in python-escpos with this identifier: ``{{ item }}``. Basic information ^^^^^^^^^^^^^^^^^ @@ -54,6 +57,8 @@ starCommands clear Text code pages ^^^^^^^^^^^^^^^ +todo example encoding: :ref:`encoding-label-CP3011` + .. todo: list code pages (ID, Encoding, link to Encoding list) {% endfor %} \ No newline at end of file diff --git a/doc/printer_profiles/available-encodings.rst b/doc/printer_profiles/available-encodings.rst index c748ef6..7cb2941 100644 --- a/doc/printer_profiles/available-encodings.rst +++ b/doc/printer_profiles/available-encodings.rst @@ -1,3 +1,6 @@ Available Encodings ------------------- :Last Reviewed: 2023-07-27 + +.. datatemplate:json:: ../../capabilities-data/dist/capabilities.json + :template: capabilities-template-encoding.jinja \ No newline at end of file diff --git a/doc/printer_profiles/available-profiles.rst b/doc/printer_profiles/available-profiles.rst index 2789dce..4d9ab05 100644 --- a/doc/printer_profiles/available-profiles.rst +++ b/doc/printer_profiles/available-profiles.rst @@ -2,10 +2,14 @@ Available Profiles ------------------ :Last Reviewed: 2023-07-27 -.. todo:: explain capabilities -.. todo:: explain usage -.. todo:: give hints on how to sideload and improve profiles (profile that is bundled with release can be replaced) -.. todo:: Idea: move this to another chapter and create for each printer a page? +The following list describes which printer profiles are +available in this release. +The existence of a profile is a hint, but no guarantee +that this printer actually can be controlled by this library. + +If you find any issues with the described capabilities, +please open an issue in the +`ESC/POS printer database `_. .. datatemplate:json:: ../../capabilities-data/dist/capabilities.json :template: capabilities-template.jinja diff --git a/doc/printer_profiles/capabilities.rst b/doc/printer_profiles/capabilities.rst index 03f569e..4b341df 100644 --- a/doc/printer_profiles/capabilities.rst +++ b/doc/printer_profiles/capabilities.rst @@ -1,3 +1,11 @@ Capabilities ------------ :Last Reviewed: 2023-07-27 + +Since the used command set often differs between printers, +a model for supporting different printers is implemented. +This feature is called `capabilities`. + +.. todo:: explain capabilities +.. todo:: explain usage +.. todo:: give hints on how to sideload and improve profiles (profile that is bundled with release can be replaced)