On Sun, Mar 17, 2013 at 10:18 AM, Tong Sun <[email protected]> wrote:

>
> On Mon, Mar 11, 2013 at 10:50 PM, Tong wrote:
>
>>
>> On Sunday, March 10, 2013 2:32:32 PM UTC-4, Tong wrote:
>>
>> I hope you would agree that, if each head can be a link to itself, it
>>> will make referring to a specific section much easier. Especially if the
>>> article is long and breaks into many sections. Having a direct link would
>>> be very convenient.
>>>
>>
I plan to support this option out of the box w/ Asciidoctor, because it
just makes sense.

As Lex mentioned, this is easy to do by overriding the backend templates.
Something like:

ifdef::basebackend-html[]

[sect1]
<div class="sect1{style? {style}}{role? {role}}">
<h2>*{id?<a id="{id}">}*{numbered?{sectnum} }{title}*{id?</a>}*</h2>
<div class="sectionbody">
|
</div>
</div>

endif::basebackend-html[]

Put this in an asciidoc.conf file or a conf file w/ the same base name as
your document in your document directory.

You can use CSS to give you the link icons.


>
>> Is there any possibility that I achieve this by defining my own macros?
>> Anyone can help please?
>>
>
>  In this case, I hope that such feature will be available in future
> releases, as an option, because I still think it is a reasonable request
> and quite useful future. BTW, github already support it, and has it turned
> on by default.
>

GitHub is doing it via a post-processor that runs after Asciidoctor
generates the HTML.

-Dan

-- 
Dan Allen
Principal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://google.com/profiles/dan.j.allen
http://mojavelinux.com
http://mojavelinux.com/seaminaction

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to