Movatterモバイル変換


[0]ホーム

URL:


导航

7. ThereStructuredText Cheat Sheet: Syntax Reminders

Info:See <http://docutils.sf.net/rst.html> for introductory docs.
Author:David Goodger <goodger@python.org>
Date:$Date: 2013-02-20 01:10:53 +0000 (Wed, 20 Feb 2013) $
Revision:$Revision: 7612 $
Description:This is a “docinfo block”, or bibliographic field list

注解

If you are reading this as HTML, please readcheatsheet.txt instead to see the input syntax examples!

7.1. Section Structure

Section titles are underlined or overlined & underlined.

7.2. Body Elements

Grid table:

Paragraphs are flush-left,separated by blank lines.

Block quotes are indented.

Literal block, preceded by ”::”:

Indented

or:

> Quoted
>>>print'Doctest block'Doctest block
Line blocks preserve line breaks & indents. [new in 0.3.6]
Useful for addresses, verse, and adornment-free lists; longlines can be wrapped with continuation lines.

Simple tables:

List TypeExamples (syntax in thetext source)
Bullet list
  • items begin with “-”, “+”, or “*”
Enumerated list
  1. items use any variation of “1.”, “A)”, and “(i)”
  2. also auto-enumerated
Definition list
Term is flush-left:optional classifier
Definition is indented, no blank line between
Field list
field name:field body
Option list
-oat least 2 spaces between option & description
Explicit MarkupExamples (visible in thetext source)
Footnote
[1]Manually numbered or [#] auto-numbered(even [#labelled]) or [*] auto-symbol
Citation
[CIT2002]A citation.
Hyperlink Target
Anonymous Target
Directive (”::”)_images/biohazard.png
Substitution Def
Comment
Empty Comment(”..” on a line by itself, with blank lines before & after,used to separate indentation contexts)

7.3. Inline Markup

emphasis;strong emphasis;interpreted text;interpreted textwith role;inlineliteraltext; standalone hyperlink,http://docutils.sourceforge.net; named reference,reStructuredText;anonymous reference; footnote reference,[1]; citation reference,[CIT2002]; like an inline directive;inline internal target.

7.4. Directive Quick Reference

See <http://docutils.sf.net/docs/ref/rst/directives.html> for full info.

Directive NameDescription (Docutils version added to, in [brackets])
attentionSpecific admonition; also “caution”, “danger”,“error”, “hint”, “important”, “note”, “tip”, “warning”
admonitionGeneric titled admonition:..admonition::ByTheWay
image..image::picture.png; many options possible
figureLike “image”, but with optional caption and legend
topic..topic::Title; like a mini section
sidebar..sidebar::Title; like a mini parallel document
parsed-literalA literal block with parsed inline markup
rubric..rubric::InformalHeading
epigraphBlock quote with class=”epigraph”
highlightsBlock quote with class=”highlights”
pull-quoteBlock quote with class=”pull-quote”
compoundCompound paragraphs [0.3.6]
containerGeneric block-level container element [0.3.10]
tableCreate a titled table [0.3.1]
list-tableCreate a table from a uniform two-level bullet list [0.3.8]
csv-tableCreate a table from CSV data [0.3.4]
contentsGenerate a table of contents
sectnumAutomatically number sections, subsections, etc.
header, footerCreate document decorations [0.3.8]
target-notesCreate an explicit footnote for each external target
mathMathematical notation (input in LaTeX format)
metaHTML-specific metadata
includeRead an external reST file as if it were inline
rawNon-reST data passed untouched to the Writer
replaceReplacement text for substitution definitions
unicodeUnicode character code conversion for substitution defs
dateGenerates today’s date; for substitution defs
classSet a “class” attribute on the next element
roleCreate a custom interpreted text role [0.3.2]
default-roleSet the default interpreted text role [0.3.10]
titleSet the metadata document title [0.3.10]

7.5. Interpreted Text Role Quick Reference

See <http://docutils.sf.net/docs/ref/rst/roles.html> for full info.

Role NameDescription
emphasisEquivalent toemphasis
literalEquivalent toliteral but processes backslash escapes
mathMathematical notation (input in LaTeX format)
PEPReference to a numbered Python Enhancement Proposal
RFCReference to a numbered Internet Request For Comments
rawFor non-reST data; cannot be used directly (see docs) [0.3.6]
strongEquivalent tostrong
subSubscript
supSuperscript
titleTitle reference (book, etc.); standard default role

內容目录

本页

下载

导航

© 版权所有 2013, Azuwis.

[8]ページ先頭

©2009-2025 Movatter.jp