doxybook2 icon indicating copy to clipboard operation
doxybook2 copied to clipboard

Anchor tag links generated incorrectly

Open LinuxJedi opened this issue 4 years ago • 6 comments

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.

LinuxJedi avatar Nov 10 '21 12:11 LinuxJedi

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

alandefreitas avatar Jan 15 '22 04:01 alandefreitas

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.

terbshaeusser avatar Mar 11 '22 18:03 terbshaeusser

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.

alandefreitas avatar Mar 11 '22 18:03 alandefreitas

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.

terbshaeusser avatar Mar 11 '22 18:03 terbshaeusser

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.

alandefreitas avatar Mar 11 '22 20:03 alandefreitas

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*

LinuxJedi avatar Mar 11 '22 21:03 LinuxJedi