mara-li / mkdocs-ezlinked-plugin Goto Github PK
View Code? Open in Web Editor NEWThis project forked from orbikm/mkdocs-ezlinks-plugin
Plugin for mkdocs which enables easier linking between pages
License: MIT License
This project forked from orbikm/mkdocs-ezlinks-plugin
Plugin for mkdocs which enables easier linking between pages
License: MIT License
Hello there,
Thanks for this fork that fixes my issues.
I would advise to rename your fork, so the plugin name is different, to give it more visibility. Because it can't be found without help, and it definitely deserves to be visible.
Publishing Obsidian Vault to mkdocs is a game changer to me.
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"
?
[[Democracy Analysis Project - Links | Links]]
will look for '../democracy-analysis-project---links-'
but was expecting '../democracy-analysis-project---links'
.
Should be easy to deal with by trimming spaces before processing.
At the moment this is my workaround
[[Democracy Analysis Project - Links| Links]]
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?
The Pypi website (https://pypi.org/project/mkdocs-ezlinked-plugin/) shows version 0.3.3 (without #1 fixed), but this repository shows 0.3.4 (with #1 fixed). Is it related to https://github.com/Lisandra-dev/mkdocs-ezlinked-plugin/blob/d56ee44e9bfac99f10cbec9552a1a42778bfd29a/setup.py#L6, which is still on 0.3.3?
Hello, there is a DeprecationWarning
from warning_filter
:
INFO - DeprecationWarning: warning_filter doesn't do anything since MkDocs 1.2 and will be removed soon. All messages on the `mkdocs` logger get counted automatically.
File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/mkdocs_ezlinks_plugin/plugin.py", line 5, in <module>
from mkdocs.utils import warning_filter
File "/opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/mkdocs/utils/__init__.py", line 453, in __getattr__
warnings.warn(
Related issue: fralau/mkdocs-macros-plugin#173
Environment
mkdocs==1.5.3
mkdocs-material==9.4.5
mkdocs-git-revision-date-localized-plugin==1.2.0
mkdocs-ezlinked-plugin==0.3.3
mkdocs-callouts==1.9.1
Let's say we have this mkdocs.yml
:
site_name: test
plugins:
ย - ezlinks:
ย ย ย ย wikilinks: true
And this folder structure:
docs/
โโโ index.md
โโโ รก.md
And in index.md
we have this content:
Path has already been encoded: [./%C3%A1%20.md](./%C3%A1%20.md)
Path isn't encoded: [./รก.md](./รก.md)
The output index.html
would be:
Path has already been encoded: <a href="%25C3%25A1%2520.md">./%C3%A1%20.md</a>
Path isn't encoded: <a href="%C3%A1/">./รก.md</a>
If the index.md
is renamed to something else, says a.md
, then a.html
would be:
Path has already been encoded: <a href="%25C3%25A1%2520.md">./%C3%A1%20.md</a>
Path isn't encoded: <a href="../%C3%A1/">./รก.md</a>
The correct case in any case should be <a href="./%C3%A1/">./%C3%A1/.md</a>
or at least <a href="รก/">./รก.md</a>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.