Skip to content
This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Anchor tag links generated incorrectly #82

Closed
LinuxJedi opened this issue Nov 10, 2021 · 6 comments · Fixed by #92
Closed

Anchor tag links generated incorrectly #82

LinuxJedi opened this issue Nov 10, 2021 · 6 comments · Fixed by #92

Comments

@LinuxJedi
Copy link

If you have a heading that is something like "function my_function" then the anchor tag used by mkdocs and pandoc would be function-my_function but Doxybook2 generates the link function-my-function. The underscores get converted to dashes where they shouldn't be, so the links are broken.

@alandefreitas
Copy link

alandefreitas commented Jan 15, 2022

Any news on this? Can any kind of pre or post-processor help with this?

@terbshaeusser
Copy link
Contributor

In version 1.3.6 this is working without problems. I guess it was introduced with issue #63.
Would be nice if the user could choose the behavior via a configuration option.

@alandefreitas
Copy link

I don't think this has been fixed. I'm using version 1.4.0 in the workflow, and for a function such as wait_for_all, doxybook2 generates something like /futures/reference/Modules/group__waiting/#function-wait-for-all, which renders as this HTML with the link <a href="/futures/reference/Modules/group__waiting/#function-wait-for-all">...</a>.

If you look directly at the documentation, you'll see mkdocs generates the proper link on the sidebar, such as https://alandefreitas.github.io/futures/reference/Modules/group__waiting/#function-wait_for_all. The links in main table of functions only work in the docs because I included some js workaround to circumvent that problem temporarily.

@terbshaeusser
Copy link
Contributor

Sorry I meant that the problem was introduced with fixing issue #63.
Yes I also face the replacement problem with the latest version (1.4.0). But with 1.3.6 it was working.

@alandefreitas
Copy link

Oh... OK. I thought it was working since 1.3.6. Yep. That makes sense.

I'll have a look at #65, but I'll not downgrade for now because I'm afraid to break something else.

If this is unmaintained for a long time and PRs are not being reviewed, I'll probably just fork and fix it locally.

@LinuxJedi
Copy link
Author

I don't know if it helps people here, but I added this as a workaround in our docs build system:

perl -i -pe "s/(?<=md\#function\-)(.*)(?=\))/\$$1=~s#-#_#gr/ge" build/html/group* build/html/*8h*

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants