Asciidoc中缩进的使用

本文介绍了AsciiDoc中两种实现文本缩进的方法:使用::符号和标记对+--。通过这些方法可以在不同场景下(如列表内)实现精确的文本格式化。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

方法一

通过 :: 进行缩进,只对单行其作用。 

AsciiDoc::
    Converts AsciiDoc (`.txt`) files to DocBook XML (`.xml`) files.

形成的效果如下:

可以看出,converts相当于AsciiDoc形成了缩进。但是此时,:: 前的内容被加粗了,如果不想加粗,可以将 :: 单独放在一行,如下所示:

AsciiDoc

 ::
    Converts AsciiDoc (`.txt`) files to DocBook XML (`.xml`) files.

 

方法二

通过如下标记对来缩进

这一行顶格。
+
--

  这里的内容被缩进。

--

这种方式非常适合在有序或无序列表中对某个list下的内容进行缩进,示例如下:

. An optional document revision number followed by an optional
  revision date followed by an optional revision remark:
+
--
  * If the revision number is specified it must be followed by a
    comma.
  * The revision number must contain at least one numeric character.
  * Any non-numeric characters preceding the first numeric character
    will be dropped.
  * If a revision remark is specified it must be preceded by a colon.
    The revision remark extends from the colon up to the next blank
    line, attribute entry or comment and is subject to normal text
    substitutions.
  * If a revision number or remark has been set but the revision date
    has not been set then the revision date is set to the value of the
    'docdate' attribute.

Examples:

  v2.0, February 2003
  February 2003
  v2.0,
  v2.0, February 2003: Rewritten for version 2 release.
  February 2003: Rewritten for version 2 release.
  v2.0,: Rewritten for version 2 release.
  :Rewritten for version 2 release.
--

. The revision information line can also be an RCS/CVS/SVN $Id$
  marker:
+
--
  * AsciiDoc extracts the 'revnumber', 'revdate', and 'author'
    attributes from the $Id$ revision marker and displays them in the
    document header.
  * If an $Id$ revision marker is used the header author line can be
    omitted.

Example:

  $Id: mydoc.txt,v 1.5 2009/05/17 17:58:44 jbloggs Exp $
--

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

汀桦坞

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值