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.13k stars 145 forks source link

pandoc crashes with pdoc output #224

Closed veenstrajelmer closed 4 years ago

veenstrajelmer commented 4 years ago

When generating markdown output with pdoc, one of the suggested options to convert this to pdf is with pandoc. However, due to one line in the output md file, pandoc crashes with the following error:

Error producing PDF.
! Missing number, treated as zero.
<to be read again>
                   \protect
l.1790 ...ter}\rule{0.5\linewidth}{\linethickness}

This line contains only '-----', without any header in the line above. Would it be possible to remove this from the code?: https://github.com/pdoc3/pdoc/blob/21d1f49141c5fe3bd7927bae1ee2fc4739fac480/pdoc/templates/pdf.mako#L171

kernc commented 4 years ago

That's supposed to be a horizontal rule for final footer separation.

Screenshot_2020-06-30_13-52-13

I think you're seeing this bug https://github.com/jgm/pandoc/issues/5801, fixed in https://github.com/jgm/pandoc/commit/d9db76dcf40d1930ad15317d76fd2c90d9114801. Have you tried upgrading pandoc?

veenstrajelmer commented 4 years ago

I did update pandoc already, so that should not be it. However, given your feedback, it seems to be a pandoc issue, not pdoc, right?

kernc commented 4 years ago

Given your error line exactly matches what of it was fixed in https://github.com/jgm/pandoc/commit/d9db76dcf40d1930ad15317d76fd2c90d9114801, I think that should be it.

Can you confirm using the correct, pip-updated pandoc as opposed to some stale local version?

$ which pandoc
$ pandoc --version
kernc commented 4 years ago

Ah, pandoc is not a Python package! :laughing: See updating instructions here: https://pandoc.org/installing.html

veenstrajelmer commented 4 years ago

Hmm ok, I installed it via pip, but that might not be maintained then? I might look for other md to pdf converters instead, or use it as is with the manual step of removing that one line from the md file.

kernc commented 4 years ago

I installed it via pip, but that might not be maintained then?

pandoc is not by default a Python package. The package installed with pip is just a Python wrapper.

The conversion should work well with the latest pandoc release: https://github.com/jgm/pandoc/releases/tag/2.10