[
https://issues.apache.org/jira/browse/DOXIASITETOOLS-320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17789820#comment-17789820
]
Michael Osipov commented on DOXIASITETOOLS-320:
-----------------------------------------------
I moved this to Doxia Sitetools and like to split into and report because here
are two issues mixed which to not correlate:
1. DOXIASITETOOLS-266 removed the auto anchor generation because it had its
issues ([~kwin]), I am not saying that it is wrong creating them, but it was
broken the way it was, IMHO.
2. As said, the achor id style generated by anchorjs is not compatible with
Doxia anchor id style, how could it be?
Things we need to do/understand/clarify: Doxia itself does not create any
anchors unless you explicitly instruct it..and this is logically correct. Even
if you use the TOC macro this says nothing whether the target of the links
exist or not. It assumes that they are created by some means. Doxia can
logically be used outside of Maven land. Now, Doxia Sitetools comes on top and
is used by the Maven Site Plugin which by convenience does the auto style, but
*not* by standalone invocation of reporting plugins.
My expectations for autolinking on the Maven side:
* It is clearly documented, or at best a Maven Site Plugin parameter can toggle
it
* It applies to {{<hX>}} elements only
* It will not create a new anchor if one with the same id already exists
(collision detection) and/or print warning if one is detected (and dropped)
* It will be placed in a way that when jumped to the heading does not disappear
* It will contain the entire text from starting to closing tag ({{hX/text()}}
in XPath terms)
* It will play nice with {{AbstactMavenReport#startSection()}} (standalone vs.
site invocation)
My expectations for autolinking on the Skin side (anchorjs):
* The algorithm would customizable by a function argument
* It will not create a new anchor if one with the same id already exists
(collision detection)
[~kwin], WDYT? Do you want to take the previous code a foundation to start? Do
you want to fork anchorjs or raise an improvement request?
Maybe something completely else?
> Inconsistent anchors between toc macro and headers
> --------------------------------------------------
>
> Key: DOXIASITETOOLS-320
> URL: https://issues.apache.org/jira/browse/DOXIASITETOOLS-320
> Project: Maven Doxia Sitetools
> Issue Type: Bug
> Components: Site renderer
> Reporter: Slawomir Jaranowski
> Priority: Critical
>
> In markdown document add:
> {code:java}
> <!-- MACRO{toc|fromDepth=2} -->
> {code}
> Then anchors generated by toc macro looks like: {{#Your_First_Mojo}}
> and anchors generated by skin looks like: {{#your-first-plugin}}
> - Doxia Site Renderer 2.0.0-M4
> - Fluido Skin 1.11.1
> Tested on Maven main site without more investigate.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)