Custom-type delimited blocks

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

Custom-type delimited blocks

joruib
I have the need of tagging some blocks in my novel, so that they represent particular things.

The aim of it is that, when I render the document, I can typeset these blocks differently.

For example, I have a block which I want to tag as 'location', which will translate to being a paragraph aligned right and with the font in italics.

Would something like this be the right approach?

[source,asciidoc]
----

= Chapter One

[location]
----
Somehwere in the United States
----

Text of the chapter

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

Re: Custom-type delimited blocks

mojavelinux
Administrator
Yep, that exactly describes the block (processor) extension. See:


I would recommend decorating an open block instead of a listing block, though. You want to pick the native structural container (e.g., open block) that most closely matches the content type. (Think of how the block is handled when the extension is not active).

Cheers,

-Dan

On Mon, Jan 11, 2016 at 1:10 AM, joruib [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have the need of tagging some blocks in my novel, so that they represent particular things.

The aim of it is that, when I render the document, I can typeset these blocks differently.

For example, I have a block which I want to tag as 'location', which will translate to being a paragraph aligned right and with the font in italics.

Would something like this be the right approach?

[source,asciidoc]
----

= Chapter One

[location]
----
Somehwere in the United States
----

Text of the chapter

----


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



--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen
Reply | Threaded
Open this post in threaded view
|

Re: Custom-type delimited blocks

joruib
Oh, it has been my mistake using a listing block, I had been thinking of an open block all along...

How would I use such an extension developed by myself? Would it be enough to put it in the relevant subdirectory of the Asciidoc distribution I am using? Or I have to 'register' it somehow, si that my installation recognizes it?

Oh, and, a completely unrelated question... I want to try to develop my own backend but I don't know where to start. I think the HTML5 backend is understandable enough, but I'm at a loss in choosing which template language will be the best...