On 23 November 2012 03:21, Philipp Marek <[email protected]> wrote:
> Hello Lex,
>
>
>> > Is there an easy way to define a "quotes2" or something like that, similar 
>> > to
>> > "replacements{,2,3}", to have _only_ my rules in there?
>>
>> Basically no, the substitution types are built in to the code that
>> does them, you can't add more.
>>
>> Possibly you could do something with replacements (or 2 or 3) but note
>> that since they are processed *after* the quotes are processed (see
>> http://www.methods.co.nz/asciidoc/userguide.html#_document_processing
>> ) you can't just transform them into quoted text like you did in your
>> first post, you need to generate the output markup, for each backend
>> you use.
> I'd like to ask for a "quotes2" change, so that I can define my (few)
> substitutions even for a literal block.
>
> If something like this hits the repository, I can try to apply it to my local
> version.
>
>
> Or, alternatively, a way to register these substitutions _directly_ in the
>
>    [blockdef-listing]
>

Adding another substitution won't help.  Let me spell it out, if you
had another quotes substitution:

1. you can't transform your special quotes into normal quotes since
that would require you to escape all other occurrences of the quotes
character.  If you need to do that then you might just as well use
normal quotes.

2. Since you can't do 1. you have to directly generate backend markup.
 The markup for your special quotes will still have to be defined for
each backend, by putting each alternate markup in ifdef:: tests.

3. You can already do exactly the same using replacements3, wrap an
alternative replacement definition in an ifdef:: that depends on the
backend.

So there is no improvement, either in terms of the input or the effort
to define your custom configuration.

The custom asciidoc.conf for html (using ~~ as the custom quotes,
change as needed) would be:

[replacements3]
ifdef::basebackend-html[]
~~(\w+)~~=<em>\1</em>
endif::basebackend-html[]

I would recommend against using non-ascii characters for the quotes
delimiters since Asciidoc is a Python 2 program, and as such Unicode
regular expression handling is not totally consistent.

Cheers
Lex


>
> Thank you very much!
>
> Regards,
>
> Phil
>
> --
> You received this message because you are subscribed to the Google Groups 
> "asciidoc" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/asciidoc?hl=en.
>

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

Reply via email to