ElektraInitiative / PermaplanT

https://www.permaplant.net
BSD 3-Clause "New" or "Revised" License
16 stars 13 forks source link

404 links in documentation when viewed with mdbook #506

Closed 4ydan closed 1 year ago

4ydan commented 1 year ago

Steps to Reproduce the Problem

cargo install mdbook mdbook-mermaid
cargo install --git https://github.com/ElektraInitiative/mdbook-generate-summary mdbook-generate-summary
mdbook serve --open

Expected Result

Navigate to the proper markdown

Actual Result

image

System Information

And

Basically all of these need to be fixed image

Weird to make it work offline in markdown and as mdbook, maybe replacing /doc/ with ../ might do the fix for most of these.

markus2330 commented 1 year ago

Thank you, great findings! I can reproduce that these links are dead. backend was moved (now in doc/backend), the database/hierarchy.md seems to be some limitation of mdbook (seems like mdbook doesn't support absolute links).

Let us try out the link checker mdbook provides, maybe it would avoid such problems in future once we have it as part of CI.

4ydan commented 1 year ago

What do we think about a pre-commit hook solution to checking if the links work? Or is it maybe to inconsistent?

markus2330 commented 1 year ago

If the mdbook link-checker solution is not working easily, it could be much better than nothing, depending on how similar the checks to what mdbook allows are (e.g. absolute links should be prohibited, as they don't work with mdbook afaik).

Imho broken links that lead to existing files not included in mdbook are not terribly problematic, people can open the file via some other way. (Of course the non-plus-ultra variant is if these links go to the repo, like implemented in libelektra.)