Use cog to maintain --fmt list, closes #373

This commit is contained in:
Simon Willison 2022-01-09 09:48:48 -08:00
commit 148e9c7aee
4 changed files with 43 additions and 2 deletions

View file

@ -176,7 +176,41 @@ You can use the ``--fmt`` option to specify different table formats, for example
2 2 Pancakes
==== ===== ========
For a full list of table format options, run ``sqlite-utils query --help``.
Available ``--fmt`` options are:
.. [[[cog
import tabulate
cog.out("\n" + "\n".join('- ``{}``'.format(t) for t in tabulate.tabulate_formats) + "\n\n")
.. ]]]
- ``fancy_grid``
- ``fancy_outline``
- ``github``
- ``grid``
- ``html``
- ``jira``
- ``latex``
- ``latex_booktabs``
- ``latex_longtable``
- ``latex_raw``
- ``mediawiki``
- ``moinmoin``
- ``orgtbl``
- ``pipe``
- ``plain``
- ``presto``
- ``pretty``
- ``psql``
- ``rst``
- ``simple``
- ``textile``
- ``tsv``
- ``unsafehtml``
- ``youtrack``
.. [[[end]]]
This list can also be found by running ``sqlite-utils query --help``.
.. _cli_query_raw:

View file

@ -44,6 +44,10 @@ Then run ``make livehtml`` from the ``docs/`` directory to start a server on por
cd docs
make livehtml
The `cog <https://github.com/nedbat/cog>`__ tool is used to maintain portions of the documentation. You can run it like so::
cog -r docs/*.rst
.. _contributing_linting:
Linting and formatting