pdoc3 / pdoc

:snake: :arrow_right: :scroll: Auto-generate API documentation for Python projects
https://pdoc3.github.io/pdoc/
GNU Affero General Public License v3.0
1.12k stars 145 forks source link

Red Font for Text Inside Single and Double Quotes, Inside an Ordered List? #379

Closed windowshopr closed 2 years ago

windowshopr commented 2 years ago

I'm making some documentation on a genetic algorithm package that I've made, and I noticed that the text inside an ordered list:

  1. Makes some words bold randomly
  2. If preceded by a double or single quote, will turn the font red

Here is a snapshot of the output:

image

And here is that same snippet of code:

image

This is all within the very top """comment""" section of my source code. You'll notice I added the escape slash \ before each quote in the list in an effort to see if that would help, but I think it's a markdown/formatting thing, I'm just not sure how to fix it. The bolding thing seems weird too as I don't use ** around the words being bolded.

What can I do to fix this? Thanks!

kernc commented 2 years ago

The contents in question is obviously indented at least four spaces and thus interpreted as a verbatim code block which gets colored by HighlightJS (bold are keywords—curious what language was autodetected).

Your docstrings should render fine if you format them like so:


def foo():
    """
    Paragraph introducing a list:

    1. Something something.
       Continuation indented 3-spaces to match list item start.
    2. Something else ...
       ...
    """
    ...