sphinx-doc / sphinx-doc/sphinx
Customably extend jinja 2 template namespace
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
I'd like to propose a feature to extend the namespace available to jinja2 templates
Currently, the following are available (some only on classes or modules):
name
objname
fullname
objtype
module
class
underline
members
inherited_members
functions
classes
exceptions
methods
attributes
modules
The proposed feature would allow custom extensions of this namespace, base on a extend-autosummary-template-content event. A minimal use case would be the following template.
.. _templates/dataclass.rst
Is this dataclass frozen?
{{ frozen }}
More in the next message (this one was largely edited after further investigation from my side).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named in the issue. Begin by locating autosummary's template namespace and the proposed extend-autosummary-template-content event; done means a documented, usable way to add custom values such as frozen to the template namespace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100