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 [[document.pdf#page=1]] #5

Open
Zic0-91 opened this issue Oct 30, 2024 · 0 comments
Open

Add support for [[document.pdf#page=1]] #5

Zic0-91 opened this issue Oct 30, 2024 · 0 comments

Comments

@Zic0-91
Copy link

Zic0-91 commented Oct 30, 2024

Hello,

Could you add the support for direct access to a specified page of a .pdf document ?

Given a pdf page number is specified into the link : [[document.pdf#page=1]],
When mkdocs generate the site
Then the generated link should be ``http://site/document.pdf#page=1`

With the current version, the plugin remove the = from the html link : http://site/document.pdf#page1.

Note:
This seems to be due to the following code : RoamLinkReplacer.gfm_anchor

Proposal:

    def gfm_anchor(self, title):
        """Convert to gfw title / anchor
        see: https://gist.github.com/asabaylus/3071099#gistcomment-1593627"""
        if title:
            title = title.strip().lower()
            title = re.sub(r'[^\w\u4e00-\u9fff\-\= ]', "", title)
            title = re.sub(r' +', "-", title)
            return title
        else:
            return ""
```

Best regards
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

1 participant