Infosys在阅读器中打开 / AI 翻译

PLC · 0 次阅读

Directives

Directives are explicit markup blocks. These are syntax elements that affect an entire paragraph.

Structure

  • Directives consist of a directive mark followed by a directive block.
  • The directive markup consists of an explicit markup start (".. "), the type of directive, two colons and a space.
  • The directive block consists of three parts, with individual directives using any combination of these parts:
    • directive argument
    • directive options
    • directive content
  • Directive arguments can be file system paths, title texts etc.
  • The directive options are specified using field lists; the possible field names and contents depend on the type of directive.
  • Directive arguments and options must form a coherent block starting with the first or second line of the explicit markup block.
  • The start of the content block of the directive is indicated by a blank line.

Principle

+-----+-----------------------------+
|".. "|directive type"::" directive |
+-----+block                        |
      |                             |
      +-----------------------------+

A blank line is required between a directive and a preceding text body element (for example, a paragraph with text). A blank line between directives is optional.

Sample:

Paragraph

.. image:: C:\Tc3LibDocImages\SampleLib1\img11.jpg
.. image:: C:\Tc3LibDocImages\SampleLib1\img12.jpg

Use

The following text elements can be created using directives:

Use

Sample

Specific notes

.. note::

Generic notes

.. admonition:: Title

Images

.. image:: C:\Users\SampleUser\Documents\LibraryDocumentationpicture.png
   :height: 100 px
   :width: 200 px

Codeblock

.. code::

   Code block

CSV table

.. csv-table:: Table
   :header: "Column 1", "Column 2"
   :widths: 50, 50

   "Line 1.1","Line 1.2"

List table

.. list-table:: Table
   :widths: 50 50
   :header-rows: 1

   * - Column 1
     - Column 2
   * - Line 1.1
     - Line 1.2