fralau / mkdocs-macros-plugin

Create richer and more beautiful pages in MkDocs, by using variables and calls to macros in the markdown code.
https://mkdocs-macros-plugin.readthedocs.io
Other
335 stars 51 forks source link

edit button on readthedocs points to wrong url #88

Closed CrispyDrone closed 3 years ago

CrispyDrone commented 3 years ago

Hello,

I think #87 will require a documentation fix.

For example on the tips and tricks page there's a section that shows how to create a button, which states:

def define_env(env):

    # import the predefined macro
    fix_url = env.variables.fix_url # make relative urls point to root

    @env.macro
    def button(label, url):
        "Add a button"
        url = fix_url(url)
        HTML = """<a class='button' href="%s">%s</a>"""
        return HTML % (url, label)

the env.variables.fix_url will need to be changed to env.macros.fix_url.

I wanted to create a pull request for this using the edit button of the website, but the url returns a 404. Clicking on the pencil sends me to https://github.com/fralau/mkdocs_macros_plugin/edit/master/docs/tips.md while the actual page is at https://github.com/fralau/mkdocs_macros_plugin/edit/master/webdoc/docs/tips.md.

I believe adding edit_uri: edit/master/webdoc/docs/ to the mkdocs.yml file will fix this issue.

fralau commented 3 years ago

Fixed with #91

fralau commented 3 years ago

For info, this is a fix to the documentation, in the webdoc directory!