Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include function code and documentation directly in content (via roles, directives, etc) #1885

Open
choldgraf opened this issue Mar 2, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@choldgraf
Copy link
Collaborator

Users often want to directly include the documentation and the raw source from a function, module, etc in their content. This allows them to write their own content before and after, and refer to functions in the same way that they'd like to refer to things like figures.

A design example of how to do this would be a directive like

```{api} modulename.functionname
:kind: function
:source: true
```

Implementation ideas

Sphinx has a few concepts that are similar to this, for example:

Sphinx autofunction, automodule, etc lets you insert functions into documentation with a Directive.

Sphinx autosummary will generate a collection of API docs by specifying a top-level module etc.

The Describing Code tutorial covers a lot of these concepts and is useful for inspiration.

Related issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant