AsciiDoc add bold text inside a listing block

无人久伴 提交于 2019-12-05 13:13:20
summea

In AsciiDoc, the double ---- lines signify ListingBlocks, which only preserve certain formatting aspects of your text (line and whitespace formatting), according to the AsciiDoc documentation on Delimited Blocks ( with the exception of using [subs="quotes"], as you noted in your answer).

Other ways to include bold formatting in a delimited block include the "Admonition Block", ExampleBlock, OpenBlock, QuoteBlock, and SidebarBlock options.


Example Blocks:

**Admonition Block:**
[NOTE]
====
here *is* my text
====

**Example Block:**
====
here *is* my text
====

**Open Block:**
--
here *is* my text
--

**Quote Block:**
[quote, quote author]
____
here *is* my text
____

**Sidebar Block:**
****
here *is* my text
****

Example Blocks Output:

Here is what I came up with. This post was helpful...

http://www.methods.co.nz/asciidoc/faq.html#_how_can_i_format_text_inside_a_listing_block

[subs="quotes"]
----
  this is a test
    with *some* formatted/tabbed text in it
blah
----

This allowed me to retain the formatting/whitespace in the text in addition to adding the formatting (bold in this case) to the text.

As far as I know, this is only possible with docbook code, you can see an example here:

++++
<screen>hostname $ <userinput>date</userinput>
Sun Apr  1 12:34:56 GMT 1984</screen>
++++

Of course, it will only work if your engine was configured with the correcting style for screen and userinput.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!