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

时间:2022-09-06 20:51:42

Asciidoc supports callouts. How can one write similar callouts using reStructuredText?

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

1 个解决方案

#1


There does not seem to be a built-in equivalent, but it is easy to make something that looks similar to the example given in the asciidoc documentation:

似乎没有内置的等价物,但很容易做出类似于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.

The only thing this lacks is the highlights on the markers. If those are very important to you, you can use a parsed-literal block:

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

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

Should you have very many of these callouts, then I suggest making a custom directive for them.

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

#1


There does not seem to be a built-in equivalent, but it is easy to make something that looks similar to the example given in the asciidoc documentation:

似乎没有内置的等价物,但很容易做出类似于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.

The only thing this lacks is the highlights on the markers. If those are very important to you, you can use a parsed-literal block:

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

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

Should you have very many of these callouts, then I suggest making a custom directive for them.

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