如何使用重组文本编写标注?

时间:2009-06-15 17:50:43

标签: restructuredtext asciidoc

Asciidoc支持callouts。如何使用reStructuredText编写类似的标注?

1 个答案:

答案 0 :(得分:4)

似乎没有内置的等价物,但很容易做出类似于asciidoc文档中给出的示例的内容:

.. topic:: MS-DOS directory listing

   ::

     10/17/97   9:04         <DIR>    bin
     10/16/97  14:11         <DIR>    DOS            <1>
     10/16/97  14:40         <DIR>    Program Files
     10/16/97  14:46         <DIR>    TEMP
     10/17/97   9:04         <DIR>    tmp
     10/16/97  14:37         <DIR>    WINNT
     10/16/97  14:25             119  AUTOEXEC.BAT   <2>
      2/13/94   6:21          54,619  COMMAND.COM    <2>
     10/16/97  14:25             115  CONFIG.SYS     <2>
     11/16/97  17:17      61,865,984  pagefile.sys
     2/13/94   6:21           9,349  WINA20.386      <3>

   1. This directory holds MS-DOS.
   2. System startup code for DOS.
   3. Some sort of Windows 3.1 hack.

唯一缺少的是标记上的亮点。如果这些对您非常重要,您可以使用parsed-literal块:

.. topic:: MS-DOS directory listing

   .. parsed-literal::

      10/17/97   9:04         <DIR>    bin
      10/16/97  14:11         <DIR>    DOS            **<1>**
      10/16/97  14:40         <DIR>    Program Files
      10/16/97  14:46         <DIR>    TEMP
      10/17/97   9:04         <DIR>    tmp
      10/16/97  14:37         <DIR>    WINNT
      10/16/97  14:25             119  AUTOEXEC.BAT   **<2>**
       2/13/94   6:21          54,619  COMMAND.COM    **<2>**
      10/16/97  14:25             115  CONFIG.SYS     **<2>**
      11/16/97  17:17      61,865,984  pagefile.sys
      2/13/94   6:21           9,349  WINA20.386      **<3>**

   1. This directory holds MS-DOS.
   2. System startup code for DOS.
   3. Some sort of Windows 3.1 hack.

如果你有很多这些标注,那么我建议为它们制作一个自定义指令。