restructuredtext

Use lark to analyze reST markup language like sections

Use lark to analyze reST markup language like sections Question: I would like to define one basic grammar such as to start to work with lark. Here is my M(not)WE. from lark import Lark GRAMMAR = r""" ?start: _NL* (day_heading)* day_heading : "==" _NL day_nb _NL "==" _NL+ (paragraph _NL)* day_nb : /d{2}/ paragraph : …

Total answers: 1

How do you specify return type on a callable parameter with reST docstring?

How do you specify return type on a callable parameter with reST docstring? Question: Here’s a working example with type hinting where I can annotate the parameter that it takes an int and a string and returns a boolean: from typing import Callable def func(another_func: Callable[[int, str], bool]): pass The relevant part is -> bool …

Total answers: 1

Change the title in index.rst generated by Sphinx AutoAPI

Change the title in index.rst generated by Sphinx AutoAPI Question: I am looking for a way to rename the title in index.rst. AutoAPI generates a documentation of modules inside a directory ..docssource_autoapi with index.rst file as follows: API Reference ============= This page contains auto-generated API reference documentation [#f1]_. .. toctree:: :titlesonly: /_autoapi/moduleA/index /_autoapi/moduleB/index .. [#f1] …

Total answers: 1

how to make 2 columns with sphinx

how to make 2 columns with sphinx Question: I want to make multiple columns on my documentation. Globally, i would like to do something similar as this homepage, where there is 3 columns : one with current release, one with news & updates, and Basics. When i search on google about multiple columns in Sphinx, …

Total answers: 5

Python Sphinx include directive: ignore the header from included file

Python Sphinx include directive: ignore the header from included file Question: I found .. include:: directive very useful for text reuse: the same parts could be inserted in different documents. But there is a problem with header levels. For example, if I have part.rst with second level header part.rst Header level 2 —————- My text …

Total answers: 2

Include my markdown README into Sphinx

Include my markdown README into Sphinx Question: I would like to include my project’s README.md into my Sphinx documentation like in Can sphinx link to documents that are not located in directories below the root document? – which is that in the resulting Sphinx html documentation I click on a link in the table of …

Total answers: 7

Python docstrings to GitHub README.md

Python docstrings to GitHub README.md Question: How do I transcode Python documentation strings to a GitHub readme.md file? Even though it seems like something everyone does, I cannot seem to get a decent solution and I am assuming it should be easy, so it seems unlikely folks are going throw two converters… What I have …

Total answers: 5

Multi-line description of a parameter description in python docstring

Multi-line description of a parameter description in python docstring Question: So, reStructuredText is the recommended way for Python code documentation, if you try hard enough, you can find in the sphinx documentation how to normalize your function signature documentation. All given examples are single-line, but what if a parameter description is multi-line like the following …

Total answers: 5

How to make PyPi description Markdown work?

How to make PyPi description Markdown work? Question: I uploaded a package to PyPi using: python setup.py register -r pypi python setup.py sdist upload -r pypi I’m trying to modify the description, I wrote (please don’t edit the formatting of the following piece of code, I made it on purpose to demonstrate my problem): **my …

Total answers: 8

How to include a local table of contents into Sphinx doc?

How to include a local table of contents into Sphinx doc? Question: How to include a local table of contents into Sphinx doc? I tried .. toc:: But that doesn’t seem to have any effect: nothing is inserted in the document. Basically I need links to the sections in the current page to be placed …

Total answers: 2