Btw, this is probably a decent candidate for an FAQ. "How to include a
caption even when the block has no title"


On Thu, May 23, 2013 at 7:11 PM, Dan Allen <[email protected]> wrote:

> Ah, I think I understand what's going on now.
>
> As Lex mentioned, when you omit the title, it's still making an example
> block, it's just not getting labeled as an example block (so it might
> appear like it's just a regular paragraph). If you look at the source code
> generated, you'll see it does use an example element variant in both cases.
>
> What this really seems to be about is having an example *caption* without
> an example *title*. AsciiDoc (and the DocBook toolchain) only adds a
> caption (e.g., Example 1) when the example block has a title (the same goes
> for other types of blocks).
>
> There are a few approaches to getting the caption without a title.
>
> Approach #1: Trick AsciiDoc/DocBook into thinking there is a title using a
> space character
>
> .{zwsp}
> ====
> example block content
> ====
>
> This should appear as:
>
> *Example 1.*
> example block content
>
> Approach #2: Use the title to output the caption
>
> .{example-caption} {counter:example-number}.
> ====
> example block content
> ====
>
> This should also appear as:
>
> *Example 1.*
> example block content
>
> These workarounds are necessary because you are working around the
> convention that a caption (e.g., Example 1) should only be used when there
> is also a title.
>
> The final option is to customize the template in the backend so that it
> always uses the caption even in the absence of a title. See the html5.conf
> or docbook45.conf files for the template you need to customize.
>
> -Dan
>
>
>
> On Thu, May 23, 2013 at 5:13 PM, Eduardo Santana 
> <[email protected]>wrote:
>
>> Hi Dan,
>>
>> I know the title is optional, but when I don't use it, it doesn't turn
>> into an example block.
>>
>>
>> ====
>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>> adolescens.
>> ====
>>
>> .This box turns into an example because it has a title.
>> ====
>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>> adolescens.
>> ====
>>
>>
>> My question is, how can I create an example box without using the title...
>>
>> It should be only Example 1...
>>
>> Em quinta-feira, 23 de maio de 2013 19h03min30s UTC-3, Dan Allen escreveu:
>>>
>>> Yep, that's allowed. The block title is optional on all delimited blocks.
>>>
>>> -Dan
>>>
>>>
>>> On Thu, May 23, 2013 at 2:19 PM, Eduardo Santana <[email protected]>wrote:
>>>
>>>> At  
>>>> http://www.methods.co.nz/**asciidoc/userguide.html#X48<http://www.methods.co.nz/asciidoc/userguide.html#X48>we
>>>>  can see how to create example blocks.
>>>>
>>>> But how can we create it without having to put a title?
>>>>
>>>> .An example
>>>> ==============================**==============================**=========
>>>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>>>> adolescens.
>>>> ==============================**==============================**=========
>>>>
>>>> Not an example:
>>>>
>>>> ==============================**==============================**=========
>>>> Qui in magna commodo, est labitur dolorum an. Est ne magna primis
>>>> adolescens.
>>>> ==============================**==============================**=========
>>>>
>>>>
>>>>  --
>>>> 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 asciidoc+u...@**googlegroups.com.
>>>> To post to this group, send email to [email protected].
>>>>
>>>> Visit this group at 
>>>> http://groups.google.com/**group/asciidoc?hl=en<http://groups.google.com/group/asciidoc?hl=en>
>>>> .
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Dan Allen | 
>>> http://google.com/profiles/**dan.j.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?hl=en.
>> 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to