[SOLVED] Customize section style rendering

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[SOLVED] Customize section style rendering

jljouannic
This post was updated on .
Hello fellow asciidoctor users!

Is it possible to customize the rendering of a section style?
Let me give you an example. When I use an appendix section style:

[appendix]
== This is an example appendix

I don't really have any inspiration regarding  the content of this example section.
...

The output looks like this:

Appendix A: This is an example appendix

I don't really have any inspiration regarding  the content of this example section.
...

However, the point is the documentation I am wrinting is in French. And usually the French word for "Appendix" is "Annexe" (and following French punctuation rules a colon is preceded by a space).

Is there a way to make the output look like that?

Annexe A : This is an example appendix

I don't really have any inspiration regarding  the content of this example section.
...

Thanks in advance.

JL
Reply | Threaded
Open this post in threaded view
|

Re: Customize section style rendering

asotobu
I cannot help you so much, but I think that now Asciidoctor is not internationalized which means that Appendix or for example in case of "Figures" they are always in English. But as a workaround I think that you could implement a PostProcessor http://asciidoctor.org/docs/user-manual/#postprocessor-example which can make this kind of substitutions.

Then if you are using the 1.5.0.preview.x version you can set from command line the extension you want to register.
Reply | Threaded
Open this post in threaded view
|

Re: Customize section style rendering

LightGuardjp
In reply to this post by jljouannic
Are you looking at changing the visual style? If you're simply outputting HTML, take a look at the source and modify the stylesheet for the classes of the appendix.

If you need to modify the actual output, you'll be modifying / creating a custom backend.


On Tue, Apr 1, 2014 at 1:56 AM, jljouannic [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hello fellow asciidoctor users!

Is it possible to customize the rendering of a section style?
Let me give you an example. When I use an appendix section style:

[appendix]
== This is an example appendix

I don't really have any inspiration regarding  the content of this example section.
...

The output looks like this:

Appendix A: This is an example appendix

I don't really have any inspiration regarding  the content of this example section.
...

However, the point is the documentation I am wrinting is in French. And usually the French word for "Appendix" is "Annexe" (and following French punctuation rules a colon is preceded by a space).

Is there a way to make the output look like that?

Annexe A : This is an example appendix

I don't really have any inspiration regarding  the content of this example section.
...

Thanks in advance.

JL


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Customize-section-style-rendering-tp1662.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Reply | Threaded
Open this post in threaded view
|

Re: Customize section style rendering

jljouannic
I eventually found myself the solution.

Actually, looking at the source file abstract_block.rb, an appendix-caption attribute can be set to customize the output generated when using an appendix section-style:

= Document Title
Doc Writer <doc.writer@asciidoc.org>
v1.0, 2013-01-01
:appendix-caption: Annexe 
...

Problem solved!
Reply | Threaded
Open this post in threaded view
|

Re: Customize section style rendering

LightGuardjp
Wow, that one needs to be documented, thanks for letting us know!

Sent from Mailbox for iPhone


On Fri, Apr 4, 2014 at 4:44 AM, jljouannic [via Asciidoctor :: Discussion] <[hidden email]> wrote:

I eventually found myself the solution.

Actually, looking at the source file abstract_block.rb, an appendix-caption attribute can be set to customize the output generated when using an appendix section-style:

= Document Title
Doc Writer <[hidden email]>
v1.0, 2013-01-01
:appendix-caption: Annexe 
...

Problem solved!


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Customize-section-style-rendering-tp1662p1672.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML