kdeldycke/click-extra

Hide `click:example` blocks

Opened this issue · 3 comments

i managed to import my complex click app with click:example through a simple import as"

.. click:example::
    from myapp.cli import cli as myapp

.. click:run::
    invoke(myapp, args=["--help"])

how can i hide the 'click:example' in the generated doc, I only need the output ?

That's a great feature to have. For the moment Click Extra rely on Pallets-Sphinx-Themes and heavily patch it.

I think at one point we'll have to remove that dependency on Pallets-Sphinx-Themes and embed in-place the code implementing the .. click:example:: and .. click:run:: directive. This will gives us the freedom to add more features and as the nice side effect of removing dependencies.

Note that I already proposed to @davidism and @stephenfin to move the implementation to sphinx-click:

Another advantage of having our own implementation in Click Extra is we would be able to implement support for a MyST-friendly syntax: https://kdeldycke.github.io/click-extra/sphinx.html#usage (i.e. get rid of the {eval-rst} wrapper).