Sphinx extension to support docstrings in Numpy format
Build a CLI that renders a Python object's NumPy-style docstring to reStructuredText while supporting custom templates and fallback signature inference.
value and scale=1.0 parameters, the rendered output includes a (value, scale=1.0) signature derived from the docstring metadata. @testCustom Docstring Layout. @test__text_signature__="(self, value, /, *, scale)", the rendered signature omits positional-only prefix clutter and shows (self, value, *, scale) without duplicated module prefixes. @test--output path, the CLI writes the rendered docstring to that file and returns the path; parent directories are created if they do not exist. @test@generates
def render_docstring(target: str, template_path: str | None = None, enable_inference: bool = False) -> str:
"""Render the target object's docstring to reStructuredText using an optional custom template."""
def render_to_file(target: str, output_path: str, template_path: str | None = None, enable_inference: bool = False) -> str:
"""Render the target docstring and write it to output_path, returning the written path."""
def main(argv: list[str] | None = None) -> int:
"""CLI entrypoint accepting --target, --template, --output, and --infer-signature flags."""Parses NumPy-style docstrings, infers call signatures when inspection fails, and renders reStructuredText with customizable templates.
tessl i tessl/pypi-numpydoc@1.9.0evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9