Intro
There are two ways to indicate the HTML headers in Markdown, the #
and underlining a word/sentence with something like -------
. In numpy docstrings (example here) we must use those multiple hyphens under lines like Parameters
and Returns
to have valid numpy documentation.
Problem
Here is the problem, the parsing library currently keys off those -------
to identify sections like Parameters
and Returns
(so you can't just remove them or you break the parser) however it passes the -------
on into the Markdown file. The result, is that a function entry reads like this:
foo{: #MyClass.foo}
def foo(self, bar: float = None) -> None
Some interesting information about the function foo
Parameters
foo: float
That big "Parameters" is a level 2 header, because it's underlined with ------
.
For reference, that API docs excerpt reads like this in the raw:
------
[**foo**](#MyClass.foo){: #MyClass.foo}
'''
python
def foo(self, bar: float = None) -> None
'''
Some interesting information about the function foo
Parameters
----------
foo: float
------
Here is what those big headers do the the sidebar navigation when I serve up the website:
Suggested Change
Strip the -------
lines out before copying the numpy docstrings into markdown.