Mara-Li / mkdocs-ezlinked-plugin

Plugin for mkdocs which enables easier linking between pages
MIT License
7 stars 5 forks source link

Expecting `[[./a/index]]` to return `<a href="a/"`, get `<a href="a/index"` #2

Open ooker777 opened 1 year ago

ooker777 commented 1 year ago

With this mkdocs.yml:

site_name: test
plugins:
  - ezlinks:
        wikilinks: true

And this folder structure:

docs/ 
├── index.md 
└── a/ 
    └── index.md

After the build we will have:

site/ 
├── index.html
└── a/ 
    └── index.html

If in docs/index.md you have this content:

[[a/index]]
[[a/index.md]]
[[./a/index]]
[[./a/index.md]]

Then in site/index.html the html will be:

| docs/index.md    | site/index.html                                    | Correct? |
| ---------------- | -------------------------------------------------- | -------- |
| [[a/index]]      | <a href="a/" title="a/index">a/index</a>           | ✔        |
| [[a/index.md]]   | <a href="a/" title="a/index.md">a/index.md</a>     | ✔        |
| [[./a/index]]    | <a href="a/index" title="./a/index">./a/index</a>  | ❌       |
| [[./a/index.md]] | <a href="a/" title="./a/index.md">./a/index.md</a> | ✔        |

At the same time Mkdocs will notice this:

INFO    -  Doc file 'index.md' contains an
           unrecognized relative link
           'a/index', it was left as is. Did  
           you mean 'a/index.md'?

Do you think all of them should all convert to <a href="./a" or even <a href="./a/index.html"?

Mara-Li commented 1 year ago

I will try to fix this. But the code of ezlinks is pretty difficult to understand.

ooker777 commented 1 year ago

since we are only working with wikilinks, why don't you choose another mkdocs plugin that can handle wikilinks and be bug-free?

Mara-Li commented 1 year ago
  1. Because they are not
  2. Because some of my other plugin relies on it
ooker777 commented 1 year ago

What are those plugins?

Mara-Li commented 1 year ago

The javascripts relies on it for the not found & all things I do to it