Skip to content

Find a better caption for snippet in JSON docs generator. #1984

Closed

Description

@daspecster

Right now the tag label is being used for the example caption. So you get example captions that look like "get_object" and "save_row_to_table".

It would be nice to have more human readable captions.

See: #1775 (comment)

Activity

  1. added
    type: feature request
    on Jul 14, 2016
  2. tseaver commented on Jul 15, 2016

    @tseaver
    Contributor

    Rather than snarfing the docs/foo_snippets.py file, could this be done by pulling in the docs/foo_usage.rst file, or maybe the HTML rendered from it by Sphinx? The usage docs already have the "human-oriented" descriptions of the snippets, and presents them in a logical order, grouped into sections.

  3. daspecster commented on Jul 15, 2016

    @daspecster
    ContributorAuthor

    For the site framework, there are only two fields for examples.
    example = { 'caption': '', 'code': '' }

    I could parse the RST in this case I think. Docutils doesn't know what the literalinclude directive is though. So I would probably just manually parse it. I'll give it a go.

  4. tseaver commented on Jul 16, 2016

    @tseaver
    Contributor

    I would say that the implementation in #1775 is adequate for now. We can look at a better rst -> markdown story for the usage / narrative docs later.

  5. added a commit that references this issue on Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type: feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions