orbikm / mkdocs-ezlinks-plugin

Plugin for mkdocs which enables easier linking between pages
MIT License
34 stars 17 forks source link

Error when trying to use ezlinks #14

Closed Andre601 closed 3 years ago

Andre601 commented 3 years ago

When I try to use ezlinks do I get the following error on mkdocs serve: https://paste.helpch.at/rileqagejo.sql

I use MkDocs 1.1 just downloaded the plugin today (in the past 30 minutes) and also use Material for MkDocs v7 alongside all the dependencies it downloads

orbikm commented 3 years ago

Hmm. It looks possibly related to the version of python you're using (maybe also with what i specified on PyPi too)

The problem is (I believe) that you're using a python from before the introduction of the walrus operator, which was not available until python 3.8.

It is a simple change to avoid using the walrus operator, which I will put together and publish asap.

orbikm commented 3 years ago

I pushed the fixes into mainline. I'm prepping a release right now.

As soon as version 0.1.7 is released, it will include the changes.

orbikm commented 3 years ago

The release is live @ https://github.com/orbikm/mkdocs-ezlinks-plugin/releases/tag/v_0.1.7 and https://pypi.org/project/mkdocs-ezlinks-plugin/

Please install the latest version, and let me know if you are still experiencing issues.

Thanks for taking the time to report the issue!

Andre601 commented 3 years ago

The plugin loads now, thanks for the fix. But I now encounter a rather weird behaviour, where the expansion doesn't seem to recognize a page properly.

In my case is it happening with a button, where instead of linking to the right page, the link is handled like as if the plugin isn't installed (Is treated as relative to the current page). What makes it even more weird is, that the same link on a different place in the page is actually working as expected, despite being the exact same format.

Here's the part that confuses me:

<!--
        "general" is a page within the same directory (docs/github/)
        The page where this happens in is called issues-pull-requests
-->

!!! pages "Pages" <!-- "pages" is a custom admonition type -->
    [:brands-github: General](general){: .md-button } <!-- This link is treated as relative (github/issues-pull-requests/general) -->

# Issues/Pull Requests
This page lists all features that can be used across all issues and Pull requests on GitHub.

!!! info "Note"
    Issues and Pull requests support all [general features](general). <!-- This link is treated as it should (github/general) -->
Andre601 commented 3 years ago

Note: Adding .md makes it behave normal again.

I have a guess too: This started happening after I edited an image-link to also only be the image-name.extension format... Maybe this made the plugin get confused in a way?

orbikm commented 3 years ago

Interesting. I will take a look at this issue. Can you please create a new issue, with essentially your comment above? It would help me track the issue a bit more.