click-contrib / sphinx-click

A Sphinx plugin to automatically document click-based applications
MIT License
212 stars 57 forks source link

Titles from docstrings not showing #63

Closed jackmoody11 closed 4 years ago

jackmoody11 commented 4 years ago

I have a click command that looks like the following:

import click

@click.command()
@click.option('--name', help='Name to say hello to.', required=True, type=str)
def hello(name):
    """Prints hello to name given.

    Examples
    ----------

    .. code::bash

      my_cli hello --name "Jack"
    """
    print("Hello", name)

The example code is showing up in my docs, but the title ("Examples" in this case) isn't. I was wondering why this is happening? Typically, I can use reStructured Text in my docstrings to document my code.

Thanks for your help! I appreciate your work on this project!

stephenfin commented 4 years ago

I hadn't expected people to want to do this, though I suppose there's no reason not to support it. This is resolved in 2.4.0. Let me know if you have any issues with it.