简体   繁体   中英

How to add local HTML anchors for sections with Doxia?

In a Maven site doc I use code like this for sections:

<section name="Hibernate statistics">
  Foo
</section>

How do I tell Doxia I want the section name/title to be an HTML local anchor? http://maven.apache.org/doxia/references/doxia-apt.html#Anchors does talk about this but I've been unable to apply it to <section> s.

I still don't know how to do it "properly". However, there's a pretty simple and painless workaround; use the id attribute:

<section name="Hibernate statistics" id="hibernate-statistics">
  Foo
</section>

id ends up in the HTML markup as-is. Most browsers nowadays support using id s as anchors: http://server/page.html#hibernate-statistics

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM