Change the behavior of block quote substitution from normal to verbatim

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

Change the behavior of block quote substitution from normal to verbatim

drearick
Ok so I posted a question about this on stackoverflow before I found this forum. I feel like what I'm trying to do should be pretty straight forward, but my efforts to achieve the desired effect of course have not been successful. With that said, I'm sure there's a good reason the standard doesn't allow callouts by default in any block elements other than literal, listing, and source blocks according to the documentation maintained on asciidoctor.org,  but isn't there a way to change the default behavior? If so, could you please share that? Of course I'm also open to alternative suggestions for methods that would have the same net effect as what I'm attempting to do with a quote block as illustrated in my stackoverflow post. Thanks in advance for any help you're able to offer.
Reply | Threaded
Open this post in threaded view
|

Re: Change the behavior of block quote substitution from normal to verbatim

drearick
I've made a couple updates to the question posted on stackoverflow regarding this issue. I did find a workaround to accomplish the desired effect by using the pass macro. The problem is it will only provide what I need if I'm converting to HTML5, but if I try a conversion to PDF the conversion throws errors and meta-characters come through in the output.
Reply | Threaded
Open this post in threaded view
|

Re: Change the behavior of block quote substitution from normal to verbatim

mojavelinux
Administrator
@drearick,

The subs attribute cannot be set on a compound block. It can only be set on a simple block. A simple block is a block that does not contain other blocks, such as a paragraph.

If I understand correctly, you want the output to be rendered as a quote block, but with callout numbers. That means you'll need to set the subs attribute on each paragraph that contains a callout number. You can use incremental subs to append the callouts substitution to the default set.

[quote,The Declaration of Independence]
____
[subs=+callouts]
When in the Course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to assume among the powers of the earth, the separate and equal station to which the *Laws of Nature and of Nature's God* <1>
entitle them, a decent respect to the opinions of mankind requires that they should declare the causes which impel them to the separation.

[subs=+callouts]
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and *the pursuit of Happiness*. <2>
— That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, — That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.
____
<1> Implies the founders believed in <a href="https://en.wikipedia.org/wiki/Natural_law[Natural">https://en.wikipedia.org/wiki/Natural_law[Natural law]
<2> The current American cultural conception of "Happiness" <a href="http://www.patheos.com/blogs/mercynotsacrifice/2013/07/05/property-and-the-pursuit-of-happiness/[tends">http://www.patheos.com/blogs/mercynotsacrifice/2013/07/05/property-and-the-pursuit-of-happiness/[tends more toward self-centeredness] which doesn't lead to true happiness at all.

I'm sure there's a good reason the standard doesn't allow callouts by default in any block elements other than literal, listing, and source blocks

Because it's an infrequent case...and exactly why the subs attribute exists.

There's an open issue for the subs attribute to be inherited, but it turns out to be rather complex. See https://github.com/asciidoctor/asciidoctor/issues/784.

Cheers,

-Dan

On Wed, Aug 22, 2018 at 8:06 AM, drearick [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I've made a couple updates to the question posted on stackoverflow regarding this issue. I did find a workaround to accomplish the desired effect by using the pass macro. The problem is it will only provide what I need if I'm converting to HTML5, but if I try a conversion to PDF the conversion throws errors and meta-characters come through in the output.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Change-the-behavior-of-block-quote-substitution-from-normal-to-verbatim-tp6440p6449.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