You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2023/02/15 13:13:00 UTC
[jira] [Comment Edited] (DOXIA-696) Inconsistent anchors between toc macro and headers
[ https://issues.apache.org/jira/browse/DOXIA-696?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17689086#comment-17689086 ]
Michael Osipov edited comment on DOXIA-696 at 2/15/23 1:12 PM:
---------------------------------------------------------------
Now here is the deal and I don't consider this as a bug, rather an inconsistency or imcompatibility.
Generated TOC:
{noformat}
160 <ul>
161 <li><a href="#Important_Notice:_Plugin_Naming_Convention_and_Apache_Maven_Trademark">Important Notic
162 <li><a href="#Your_First_Plugin">Your First Plugin</a>
163 <ul>
164 <li><a href="#Your_First_Mojo">Your First Mojo</a></li>
165 <li><a href="#A_Simple_Mojo">A Simple Mojo</a></li>
166 <li><a href="#Project_Definition">Project Definition</a></li>
167 <li><a href="#Building_a_Plugin">Building a Plugin</a></li></ul></li>
168 <li><a href="#Executing_Your_First_Mojo">Executing Your First Mojo</a>
169 <ul>
170 <li><a href="#Shortening_the_Command_Line">Shortening the Command Line</a></li>
171 <li><a href="#Attaching_the_Mojo_to_the_Build_Lifecycle">Attaching the Mojo to the Build Lifecycle</
172 <li><a href="#Mojo_archetype">Mojo archetype</a></li>
173 <li><a href="#Parameters">Parameters</a>
174 <ul>
175 <li><a href="#Defining_Parameters_Within_a_Mojo">Defining Parameters Within a Mojo</a></li>
176 <li><a href="#Configuring_Parameters_in_a_Project">Configuring Parameters in a Project</a></li></ul>
177 <li><a href="#Using_Setters">Using Setters</a></li>
178 <li><a href="#Resources">Resources</a></li></ul>
{noformat}
Doxia automatically derives the IDs, it expected that a Sink is used to produce them with the same algorithm.
The new HTML content:
{noformat}
osipovmi@deblndw011x:~/var/Projekte/maven-site (plugin-dev-refresh *=)
$ grep id= ./target/site/guides/plugin/guide-java-plugin-development.html
<div id="banner">
<div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div>
<div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div>
<div id="breadcrumbs">
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-12-11</li>
<header id="leftColumn" class="span2">
<div id="poweredBy">
<main id="bodyColumn" class="span10" >
{noformat}
As you can see, no IDs set, the IDs you mention are from JS. The Markdown parser/sink need to handle this event and properly produce ids or anchors for this.
was (Author: michael-o):
Now here is the deal and I don't consider this as a bug, rather an inconsistency or imcompatibility.
Generated TOC:
{noformat}
160 <ul>
161 <li><a href="#Important_Notice:_Plugin_Naming_Convention_and_Apache_Maven_Trademark">Important Notic
162 <li><a href="#Your_First_Plugin">Your First Plugin</a>
163 <ul>
164 <li><a href="#Your_First_Mojo">Your First Mojo</a></li>
165 <li><a href="#A_Simple_Mojo">A Simple Mojo</a></li>
166 <li><a href="#Project_Definition">Project Definition</a></li>
167 <li><a href="#Building_a_Plugin">Building a Plugin</a></li></ul></li>
168 <li><a href="#Executing_Your_First_Mojo">Executing Your First Mojo</a>
169 <ul>
170 <li><a href="#Shortening_the_Command_Line">Shortening the Command Line</a></li>
171 <li><a href="#Attaching_the_Mojo_to_the_Build_Lifecycle">Attaching the Mojo to the Build Lifecycle</
172 <li><a href="#Mojo_archetype">Mojo archetype</a></li>
173 <li><a href="#Parameters">Parameters</a>
174 <ul>
175 <li><a href="#Defining_Parameters_Within_a_Mojo">Defining Parameters Within a Mojo</a></li>
176 <li><a href="#Configuring_Parameters_in_a_Project">Configuring Parameters in a Project</a></li></ul>
177 <li><a href="#Using_Setters">Using Setters</a></li>
178 <li><a href="#Resources">Resources</a></li></ul>
{noformat}
Doxia automatically deduces the IDs, it expected that a Sink is used to produce them with the same algorithm.
The new HTML content:
{noformat}
osipovmi@deblndw011x:~/var/Projekte/maven-site (plugin-dev-refresh *=)
$ grep id= ./target/site/guides/plugin/guide-java-plugin-development.html
<div id="banner">
<div class="pull-left"><a href="https://www.apache.org/" id="bannerLeft"><img src="../../images/apache-maven-project.png" alt="Apache Maven Site" style="" /></a></div>
<div class="pull-right"><a href="../.././" id="bannerRight"><img src="../../images/maven-logo-black-on-white.png" alt="" style="" /></a></div>
<div id="breadcrumbs">
<li id="publishDate" class="pull-right"><span class="divider">|</span> Last Published: 2022-12-11</li>
<header id="leftColumn" class="span2">
<div id="poweredBy">
<main id="bodyColumn" class="span10" >
{noformat}
As you can see, no IDs set, the IDs you mention are from JS. The Markdown parser/sink need to handle this event and properly produce ids or anchors for this.
> Inconsistent anchors between toc macro and headers
> --------------------------------------------------
>
> Key: DOXIA-696
> URL: https://issues.apache.org/jira/browse/DOXIA-696
> Project: Maven Doxia
> Issue Type: Bug
> Reporter: Slawomir Jaranowski
> Priority: Major
>
> 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)