A couple of improvements, one major, the others not so much.
Optimize filename lookup
The previous algorithm walked the entire docs directory for every link in every file, which quite expectedly took a lot of time. This update makes a dict of the filenames to their respective absolute paths, making the lookup O(1) instead of O(N), where N is the amount of files.
This reduced the cumulative time spent in the plugin from 13 out of 19 seconds, to 0.24 out of 7.0 seconds, when running mkdocs build with cProfile on unitystation/unitystation-wiki, a wiki with ~86 pages.
Use the logging library
This makes the plugin use python's standard logging system and mkdocs' configuration of that, as shown in mkdocs/mkdocs#2082, fralau/mkdocs-mermaid2-plugin#18 and fralau/mkdocs_macros_plugin#41.
...and some other minor changes, check the commits for specifics
A couple of improvements, one major, the others not so much.
Optimize filename lookup The previous algorithm walked the entire docs directory for every link in every file, which quite expectedly took a lot of time. This update makes a dict of the filenames to their respective absolute paths, making the lookup O(1) instead of O(N), where N is the amount of files.
This reduced the cumulative time spent in the plugin from 13 out of 19 seconds, to 0.24 out of 7.0 seconds, when running
mkdocs build
with cProfile on unitystation/unitystation-wiki, a wiki with ~86 pages.Use the logging library This makes the plugin use python's standard logging system and mkdocs' configuration of that, as shown in mkdocs/mkdocs#2082, fralau/mkdocs-mermaid2-plugin#18 and fralau/mkdocs_macros_plugin#41.
...and some other minor changes, check the commits for specifics
This is all tested on unitystation/unitystation-wiki and it seemed to work just fine.
I know this is a little out of the blue, but I hope it is appreciated!