Mara-Li / mkdocs-ezlinked-plugin

Plugin for mkdocs which enables easier linking between pages
MIT License
6 stars 4 forks source link

Incorrect path doesn't stay incorrectly, but automatically is replaced with a different path #3

Open ooker777 opened 8 months ago

ooker777 commented 8 months ago

Let's say we have this mkdocs.yml:

site_name: test
plugins:
  - ezlinks:
        wikilinks: true

And this folder structure:

.
└── docs/
    ├── a/
    │   ├── a1/
    │   │   └── index.md
    │   └── index.md
    ├── b/
    │   └── index.md
    └── index.md

And in docs/a/index.md we have this path: [test](./a1/index.md).

The href output of site/a/index.html is href="a1/", which is correct.

However, if docs/a/a1/index.md doesn't exist, then depending on the case the result varies:

Case href output
Nothing is removed ../b/
docs/b/index.md is removed ../a1/index.md
docs/index.md is removed ../a1/index.md

I expect whatever the case is, the href output should always be ./a1/index.html Do you know why?

Mara-Li commented 8 months ago

I correct some path using JS, so it's maybe that ?

ooker777 commented 8 months ago

what do you mean? Do you mean that you have a hot fix in the plugin?

Mara-Li commented 8 months ago

Do you use my mkdocs template ? Because I use some JS in it to fix the plugin.

ooker777 commented 8 months ago

Ah I see. Yeah I use your template. Hmm, can a JS script call a Python script? Sure, it technically can via the shell, but if it's just a simple path correcting script why don't you just write it in JS natively?