Skip to content

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

Description

@Zic0-91

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions