【问题标题】:AsciiDoc add bold text inside a listing blockAsciiDoc 在列表块中添加粗体文本
【发布时间】:2016-01-06 19:55:13
【问题描述】:

有一些像...这样的块的 AsciiDoc

----
  this is a test
    with *some* formatted/tabbed text in it
blah
----

...我希望文本显示为...

 这是一个测试
    其中包含 一些 格式化/选项卡式文本
废话

...“some”这个词是粗体的。

【问题讨论】:

    标签: asciidoc asciidoctor


    【解决方案1】:

    在 AsciiDoc 中,双 ---- 行表示 ListingBlocks,它只保留文本的某些格式方面linewhitespace 格式化),根据AsciiDoc documentation on Delimited Blockswith the exception of using[subs="quotes"],就像你noted in your answer)。

    在分隔块中包含粗体格式的其他方法包括 “警告块”ExampleBlockOpenBlockQuoteBlock 和 SidebarBlock options


    示例块:

    **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
    ****
    

    示例块输出:

    【讨论】:

    • 谢谢summea。我更新了问题以更好地反映我的问题。请参阅下面的解决方案。如果您有更好的方法,请告诉我。
    • @Lumbee 带有[subs="quotes"] 属性的好发现!
    【解决方案2】:

    这是我想出的。这篇文章很有帮助...

    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
    ----
    

    除了向文本添加格式(在本例中为粗体)之外,这还允许我保留文本中的格式/空白。

    【讨论】:

      【解决方案3】:

      据我所知,这只能通过 docbook 代码实现,您可以看到 example here

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

      当然,只有在您的引擎配置了screenuserinput 的校正样式时,它才会起作用。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-09-04
        • 2023-03-27
        • 1970-01-01
        • 1970-01-01
        • 2013-02-03
        • 1970-01-01
        • 2016-05-30
        • 1970-01-01
        相关资源
        最近更新 更多