Closed HHHartmann closed 2 years ago
Actually I thought about the
$("div.section a[href^='" + relativePath + "']")
snippet. It selects everything that has a "/" in the third position. But reading your explanations it seems to be different.
What about if we only adapt links to ../../dev. Maybe check if there are other links to the sources or find a negative pattern that matches everything but "modules" and "lua-modules" But then there are md files in other places too which might get linked. Maybe apply the tweak only to urls that start with "../.." and do not end with "/", or better have nothing but an ancor (#) after the "/"
I'll take a look later this week I hope.
What about if we only adapt links to ../../dev.
Well, the tweak cannot be branch-dependent.
I was thinking about checking whether the link points to any of the dirs in the /docs folder. Those are the ones that the tweak must not be applied to as anything inside this dir is (correctly) managed by MkDocs.
Well done. Works as expected
Thanks for testing Gregor
See the link on https://nodemcu.readthedocs.io/en/dev/modules/node/#example_7
Expected behavior
point to https://nodemcu.readthedocs.io/en/dev/lua-modules/telnet/
Actual behavior
points to https://github.com/nodemcu/nodemcu-firmware/tree/dev/lua-modules/telnet/ which does not exist
Test code
The link is as follows: ../lua-modules/telnet.md
NOTE: links like ../../app/modules/node.c work as desired and point to https://github.com/nodemcu/nodemcu-firmware/tree/dev/app/modules/node.c
NodeMCU startup banner
N/A
Hardware
irrelevant
Prior discussion starts here: https://github.com/nodemcu/nodemcu-firmware/pull/3489#issuecomment-1008440889