Nice!

thanks Dan :)

Em sexta-feira, 13 de setembro de 2013 21h58min58s UTC-3, Dan Allen 
escreveu:
>
> Two clarifications.
>
> First, the default subs for an inline pass are "attributes,macros", so you 
> don't need to specify the subs list:
>
> .How to use do-while: pass:[{src}]
>
> Even better, you don't need the attribute substituted to make the 
> link...you just need to make AsciiDoc recognize the unsubstituted URL as a 
> link. Thus, you can simply at the link: prefix.
>
> .How to use do-while: 
> link:{gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c]
>
> Voila!
>
> -Dan
>
>
>
> On Fri, Sep 13, 2013 at 6:39 PM, Dan Allen <[email protected]<javascript:>
> > wrote:
>
>> This happens because (for some reason) title substitutions are applied in 
>> a different order than normal substitutions:
>>
>> :title    => [:specialcharacters, :quotes, :replacements, :macros, 
>> :attributes, :post_replacements]
>>
>> Thus, the links have already been processed by the time the macros (which 
>> include links) are discovered.
>>
>> In theory, one way around this problem is to use an inline pass macro w/ 
>> a custom subs list:
>>
>> [source,c]
>> .How to use do-while: 
>> pass:normal[{gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c\]]
>>
>> ----
>> do{
>> // some code
>> }while(){
>> // some code
>> }
>> ----
>>
>> However, there seems to be a bug in AsciiDoc that prevents this from 
>> working correct (though it does work in Asciidoctor). The problem is that 
>> the escaped closing square bracket is not processed correctly.
>>
>> When you are dealing with links, the best solution is to always put them 
>> in an attribute. Here's how that would look:
>>
>> :src: 
>> {gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c]
>>
>> [source,c]
>> .How to use do-while: pass:attributes,macros[{src}]
>>
>> ----
>> do{
>> // some code
>> }while(){
>> // some code
>> }
>> ----
>>
>> You can redefined the "src" attribute before each code listing.
>>
>> Given where that syntax is headed, it might be better to create a custom 
>> inline macro to handle the assembly of the link.
>>
>> -Dan
>>
>>
>> On Thu, Sep 12, 2013 at 1:25 PM, Eduardo Santana 
>> <[email protected]<javascript:>
>> > wrote:
>>
>>> Hi,
>>>
>>> Here's the problem: 
>>> https://gist.github.com/edusantana/6542122/raw/96bdfa0046b379c26508134b2f8508607657d1ac/title_with_link.asciidoc
>>>
>>> If we have an attribute like this:
>>> :gitrepo: https://github.com/edusantana/linguagem-de-programacao-i-livro
>>>
>>> And use it on a title like this:
>>>
>>> [source,c]
>>> .How to use do-while: 
>>> {gitrepo}/blob/master/livro/capitulos/code/cap1/do_while_exemplo.c[code/cap1/do_while_exemplo.c]
>>> ----
>>> do{
>>> // some code
>>> }while(){
>>> // some code
>>> }
>>> ----
>>>
>>> It won't work html/dblatex.
>>>
>>> Am I doing some thing wrong?
>>>
>>> -- 
>>> 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] <javascript:>.
>>> To post to this group, send email to [email protected]<javascript:>
>>> .
>>> Visit this group at http://groups.google.com/group/asciidoc.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> -- 
>> Dan Allen | http://google.com/profiles/dan.j.allen
>>  
>
>
>
> -- 
> Dan Allen | http://google.com/profiles/dan.j.allen
>  

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to