add first draft of printer profile listing

This commit is contained in:
Patrick Kanzler 2023-07-27 23:26:29 +02:00 committed by Patrick Kanzler
parent 09a598883c
commit 8222c1e587
6 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,20 @@
{% 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 %}
{{ draw_with_underline(printer.name) }}
{{ escape_rst(printer.notes) }}
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) }}
====================== ================================================================
{% endfor %}

View File

@ -42,6 +42,7 @@ extensions = [
"sphinx.ext.todo", "sphinx.ext.todo",
"sphinx.ext.graphviz", "sphinx.ext.graphviz",
"sphinx.ext.inheritance_diagram", "sphinx.ext.inheritance_diagram",
"sphinxcontrib.datatemplates",
"sphinxcontrib.spelling", "sphinxcontrib.spelling",
] ]
@ -54,7 +55,7 @@ suppress_warnings = [
todo_include_todos = True todo_include_todos = True
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"] templates_path = ["_templates", "capability_templates"]
# The suffix of source filenames. # The suffix of source filenames.
source_suffix = ".rst" source_suffix = ".rst"

View File

@ -15,6 +15,7 @@ Content
user/installation user/installation
user/methods user/methods
user/printers user/printers
user/available-profiles
user/raspi user/raspi
user/todo user/todo
user/usage user/usage

View File

@ -10,3 +10,4 @@ sphinxcontrib-spelling>=7.2.0
python-barcode>=0.11.0,<1 python-barcode>=0.11.0,<1
importlib-metadata importlib-metadata
importlib_resources importlib_resources
sphinxcontrib.datatemplates

View File

@ -0,0 +1,10 @@
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)
.. datatemplate:json:: ../../capabilities-data/dist/capabilities.json
:template: capabilities-template.jinja

View File

@ -32,6 +32,7 @@ deps = sphinx>=3.0.0
setuptools_scm setuptools_scm
python-barcode python-barcode
sphinxcontrib-spelling>=7.2.0 sphinxcontrib-spelling>=7.2.0
sphinxcontrib.datatemplates
sphinx_rtd_theme sphinx_rtd_theme
commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html