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

anchor tags in markdown output are not being resolved #389

Closed
nestorSag opened this issue Mar 14, 2022 · 2 comments · Fixed by #455
Closed

anchor tags in markdown output are not being resolved #389

nestorSag opened this issue Mar 14, 2022 · 2 comments · Fixed by #455
Labels
bug Something isn't working

Comments

@nestorSag
Copy link

I'm not sure whether this is a bug or simply I'm missing some configuration option, but if its the latter I can't find it so I apologise. I'm using the --pdf option to get a markdown document, but every section in it seems to have the same anchor tag, namely 'id' , for example one of the headers in the produced file is:

Method fit_tail_model {#id}

where the tag should be something like package.module.class.fit_tail_model instead of id .

Expected Behavior

producing a markdown file where anchor tags are resolved so that reference within the same document work

Actual Behavior

All tags seem to be set to a default string of 'id', so module/class/method links don't work. Strangely, for html outputs this works fine.

Steps to Reproduce

  1. pdoc3 --pdf -c latex_math=True mymodule > docs.md

Additional info

  • pdoc version: 0.10.0
@LauraLMann
Copy link

I think the problem is a typo in the pdf.mako file:
<%def name="title(level, string, id=None)">
<% id = f' {{#id}}' if id is not None else '' %>
${('#' * level) + ' ' + string + id}
</%def>
The "id" after the # on the second line above should also be in {} (so there would be three sets of {} on that line).
You can make this change in your own copy of pdf.mako, put your copy in a folder and run with it using:
pdoc3 --pdf --template-dir . It worked for me.

@nestorSag
Copy link
Author

That did the trick, thanks a lot!

Patrik112358 added a commit to Patrik112358/pdoc that referenced this issue Jan 5, 2025
original fix suggested by @LauraLMann in pdoc3#389 (comment)

Signed-off-by: Patrik Drozdík <patrik.drozdik@gmail.com>
kernc pushed a commit that referenced this issue Jan 8, 2025
original fix suggested by @LauraLMann in #389 (comment)

Signed-off-by: Patrik Drozdík <patrik.drozdik@gmail.com>
@kernc kernc closed this as completed in #455 Jan 8, 2025
@kernc kernc added the bug Something isn't working label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

3 participants