Login  Register

Handling large code blocks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Handling large code blocks

ashtontreadway
Hi!

We have some very large code blocks that we want to include in a topic as selectable text, without making the topic unreadable.

In an ideal world, we'd be able to include the block as an excerpt of two or three lines, which when clicked would expand to the full block.

Is there a way to do this elegantly in AsciiDoc/AsciiDoctor?

Thanks,

Ashton
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Handling large code blocks

mojavelinux
Administrator
Ashton,

You'd do that using an extension. It would be somewhat similar to the show results docinfo processor (which does it entirely with JavaScript). It's similar to what you see on this page:  https://asciidoctor.org/docs/asciidoc-syntax-quick-reference/

The main difference would be that it would hide part of the listing block instead of hiding a different block. But the idea is basically the same.


Cheers,

-Dan

On Wed, Dec 19, 2018 at 5:38 AM ashtontreadway [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi!

We have some very large code blocks that we want to include in a topic as selectable text, without making the topic unreadable.

In an ideal world, we'd be able to include the block as an excerpt of two or three lines, which when clicked would expand to the full block.

Is there a way to do this elegantly in AsciiDoc/AsciiDoctor?

Thanks,

Ashton


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


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux