Re: Create extension to embed source code

Posted by mojavelinux on
URL: https://discuss.asciidoctor.org/Create-extension-to-embed-source-code-tp3645p4026.html


there is no special reason to use inline extension or block extension

There is a huge difference, in fact. It's exactly the same as the difference between a span and a div in html. An inline extension is for a macro in the middle of a sentence, whereas a block stands by itself as its own...block.

In your case, you want a block macro extension.

I've been discussing with Robert about putting a source block macro in AsciidoctorJ by default to solve exactly the problem you are observing...to simplify the source listing coming from an external file (the most common case in mature documentation). I've always envisioned that this would one day become a built-in block because its so clear we could cut down on the number of lines we are currently typing.

Refer to this list to find extensions written in AsciidoctorJ: http://asciidoctor.org/docs/extensions/#third-party-extensions

Cheers,

-Dan

--
Dan Allen | @mojavelinux | http://google.com/profiles/dan.j.allen