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

HTML Conversion issues #383

Closed newbbbiieee closed 2 years ago

newbbbiieee commented 2 years ago

Below is my sample code:

image

Output: When i used pdoc to see the documentation in text format, everything looks fine. Command: pdoc sample.py image

But when i try to generate the same in HTML format, xml elements are missing and also all the whitespaces are stripped out. Command: pdoc --html sample.py image

There is some basic concept im missing out here.. can you please let me know what im doing wrong... (Expectation is to have the same text format reflected in my html output)

Note: im using pdoc version 0.10.0

kernc commented 2 years ago

See that "2"? If you use your browser's inspector tool, you'll see the surrounding XML is there. Raw HTML (XML) is valid Markdown, so pdoc leaves it intact. If you want your XML code to show as an example code snippet in Markdown, either indent the code block with 4 spaces or (preferred) delimit it with fences and a language infostring.

Note, Markdown also has an extension specification for formatting tables.

newbbbiieee commented 2 years ago

Hi kernc, Thanks for the clarification. :)