Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML generation / carriage return lost for multi-lines docstring #179

Open
shazz opened this issue Oct 11, 2018 · 7 comments

Comments

Projects
None yet
4 participants
@shazz
Copy link

commented Oct 11, 2018

Hi,
I'm uisng the PEP 287 -- reStructuredText Docstring Format for my documentation like:

"""
This is a reST style.

:param param1: this is a first param
:param param2: this is a second param
:returns: this is a description of what is returned
:raises keyError: raises an exception
"""

and when generating the HTML pdoc, all the lines are merged in one long line instead of n lines (unless I had '\n' at the end of each line but...)

Thanks !

@kernc

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2018

Duplicate of #153.

@armant

This comment has been minimized.

Copy link

commented Oct 11, 2018

Please also note "Equally, I feel we should clearly not include support for reStructuredText, which is way too large and complicated." in #153.

@KyleKing

This comment has been minimized.

Copy link

commented Feb 22, 2019

What is the default Markdown style supported by pdoc?

Something like the below is garbled into one line. Adding two trailing spaces to each line works to force the line breaks, but requiring two spaces is unmaintainable and would conflict with remove trailing whitespace

def chooseBest(self, img, circles, manuallyAlign=True):
    """Return the circle with the best fit based on a multi-step procedure.

    img -- Numpy array
    circles -- List of tuples (x, y, r)
    manuallyAlign -- If True, implement the manual alignment step. Otherwise return best programmatic match

    """
    return

pdocoutput

@armant

This comment has been minimized.

Copy link

commented Feb 22, 2019

What is the default Markdown style supported by pdoc?

Something like the below is garbled into one line. Adding two trailing spaces to each line works to force the line breaks, but requiring two spaces is unmaintainable and would conflict with remove trailing whitespace

def chooseBest(self, img, circles, manuallyAlign=True):
    """Return the circle with the best fit based on a multi-step procedure.

    img -- Numpy array
    circles -- List of tuples (x, y, r)
    manuallyAlign -- If True, implement the manual alignment step. Otherwise return best programmatic match

    """
    return

pdocoutput

Personally, I hacked around this in css.mako:
p, pre { white-space: pre-wrap; }

@KyleKing

This comment has been minimized.

Copy link

commented Feb 22, 2019

Haha, I was trying to do the same since that's the easiest fix, but on my computer pdoc isn't recognizing the --template-dir argument nor the ~/.config/pdoc/* (#178). How did you set up your custom templates?

@armant

This comment has been minimized.

Copy link

commented Feb 22, 2019

That's weird,
pdoc *module_name* --html --overwrite --template-dir */path/to/template* --html-dir */path/to/html*
works for me.

@KyleKing

This comment has been minimized.

Copy link

commented Feb 22, 2019

Hmm, that doesn't work for me. Maybe it's a Windows issue? I don't want to hijack this issue, so I'll post any follow up to #178

Update: just a filename issue, see: #178 (comment)

@ysimonson ysimonson referenced a pull request that will close this issue Apr 5, 2019

Open

Handle newlines in docs #186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.