Thursday, 3 October 2019

More consistent Sphinx themes

Consider the following function

# in mymodule.py:

def myfunc(num,mystring):
    """
    replicates a string

    :param num: a positive integer
    :param mystring: a string
    :return: string concatenated with itself num times

    :Example:
        >>> num = 3
        >>> mystring = "lol"
        >>> myfunc(num, mystring)
        "lollollol"
    """
    return num*mystring

If I use Sphinx to generate code from my docstring, it looks like this (I'm using the default theme haiku this time, without many changes in the rst or conf.py file):

enter image description here

Are there any themes -or any other workarounds- that resolve the problems that I indicated with colors?

I tried different ones, and none worked, but I couldn't get any of the points 1.-4. to work.

EDIT The idea is that I don't want to edit the HTML, which is way to cumbersome. I want to make changes only to conf.py and index.rst files in my Sphinx docs directory in order to make the mentioned changes.



from More consistent Sphinx themes

No comments:

Post a Comment