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

Add support for permalink #22

Closed
JanoschDeurer opened this issue Sep 23, 2020 · 4 comments
Closed

Add support for permalink #22

JanoschDeurer opened this issue Sep 23, 2020 · 4 comments

Comments

@JanoschDeurer
Copy link

Material for mkdocs supports the permalink markdown extension as described here:
https://squidfunk.github.io/mkdocs-material/setup/setting-up-navigation/#table-of-contents

It would be great to have support for that in the pdf, in the sense that when a link points to the anchor like this

[My subsection](#mysubsection)

it is correctly resolved.

@orzih
Copy link
Owner

orzih commented Sep 23, 2020

permalink is the effect of mouse over. Materials for mkdocs is set to hide them when printing, see here.
I think it's because printed paper becomes noisy. What do you think about it?

And now, this plugin is remove all permalink

# remove 'headerlink' if exists.
for a in article.select('a.headerlink'):
a.decompose()

@JanoschDeurer
Copy link
Author

Yes, you are right there should not be anything shown in the pdf. However I think it would be nice if the links would still work.

@orzih
Copy link
Owner

orzih commented Sep 26, 2020

Does that mean a direct link from the browser?
I think only limited browsers such as Acrobat Reader(plugin), Firefox support it.

Also, the output PDF already contains a link point to the element with 'id' attribute (no permalink option required).
However, the link point name will be changed to accommodate a single PDF.

eg. https://example.com/pdf/document.pdf#setup/setting-up-navigation/:permalink

<dt><code id="setup/setting-up-navigation/:permalink">permalink</code></dt>

Please check the output HTML using the debug_html option.

@JanoschDeurer
Copy link
Author

I think this was an error on my side, with the update of #21 most of the links to anchors on the same site are working. I currently think that it is not related to permalink. I'll investigate further and provide an example mkdocs when I figure out the problem. Thanks again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants