From 39eff73d6035c57ba19f1c8ff3a58aa1ccc63145 Mon Sep 17 00:00:00 2001 From: ltheussl Date: Sat, 10 Sep 2005 19:44:04 +0000 Subject: [PATCH] Add an optional id tag to sub/sections, so they can be referenced git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@280036 13f79535-47bb-0310-9956-ffa450edef68 --- xdoc/src/plugin-resources/site.jsl | 38 +++++++++++++++++++-------- xdoc/xdocs/changes.xml | 1 + xdoc/xdocs/index.xml | 41 ++++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 11 deletions(-) diff --git a/xdoc/src/plugin-resources/site.jsl b/xdoc/src/plugin-resources/site.jsl index ffa28c46..4adfed34 100644 --- a/xdoc/src/plugin-resources/site.jsl +++ b/xdoc/src/plugin-resources/site.jsl @@ -453,7 +453,8 @@ @@ -485,7 +493,8 @@
- + + @@ -504,12 +513,19 @@ - - - - -

${_sectionName}

+ + + + + + + + + +
+ +

${_sectionName}

diff --git a/xdoc/xdocs/changes.xml b/xdoc/xdocs/changes.xml index 9919e619..68d3c5b8 100644 --- a/xdoc/xdocs/changes.xml +++ b/xdoc/xdocs/changes.xml @@ -27,6 +27,7 @@ + Add an optional id tag to sub/sections, so they can be referenced. Add a property to override navigation.xml. Show organization in header even if logo not set. Ampersands in navigation.xml being escaped twice. diff --git a/xdoc/xdocs/index.xml b/xdoc/xdocs/index.xml index 7a681447..f1aae2b4 100644 --- a/xdoc/xdocs/index.xml +++ b/xdoc/xdocs/index.xml @@ -74,6 +74,47 @@

XDoc automatically adds the "External Link" icon and tooltip to links referring to external sites (actually, any absolute url).

+ +

+ From version 1.10 on, the xdoc plugin + allows for an optional id tag in the section + and subsection elements: +

+ + + +]]> +

+ An anchor is constructed from each id tag, + so you can reference sections and subsections from other source + documents. Note that each id tag has to be unique + within one source document. +

+

+ In previous versions of the plugin, an id tag + was constructed from section/subsection names, replacing special + characters by underscores. For backwards compatibility reasons, + we keep this behaviour, i.e., if no id tag + is present, an anchor is constructed from the name tag. + Note that this presents two shortcomings: +

+
    +
  • + If two sections or subsections have identical names + (within one source document), you will get an ambiguity when + referencing them. Also the resulting html document will not be + valid XHTML. +
  • +
  • + For long section titles, this leads to rather + cumbersome anchor names. +
  • +
+

+ We recommend that you provide an id tag if you + want to reference a section or subsection. +

+