Skip to content

Latest commit

 

History

History
385 lines (267 loc) · 7.54 KB

testTextReStructuredTextUserDefinedLanguage.rst

File metadata and controls

385 lines (267 loc) · 7.54 KB

test file

This is a test file for verifying the notepad++ syntax highlighting when using the reStructuredTxt user defined language.

The content is from http://docutils.sourceforge.net/docs/user/rst/quickref.html to verify that commenly used syntax is highlightede reasonably.

Inline Markup

emphasis

strong emphasis

interpreted text

inline literal

reference_

`phrase reference`_

anonymous__

inline internal target

|substitution reference|

footnote reference [1]

citation reference [CIT2002]

http://docutils.sf.net/

Escaping with Backslashes

escape with ""

*escape* ``with`` "\"

r"""*escape* `with` "\""""

"""\*escape* \`with` "\\""""

"""*escape* `with` "\""""

Section Structure

Title

Subtitle

Titles are underlined (or over- and underlined) with a printing nonalphanumeric 7-bit ASCII character. Recommended choices are "= - ` : ' " ~ ^ _ * + # < >". The underline/overline must be at least as long as the title text.

A lone top-level (sub)section is lifted up to be the document's (sub)title. *

Paragraphs

This is a paragraph.

Paragraphs line up at their left edges, and are normally separated by blank lines.

Bullet Lists

Bullet lists:

  • This is item 1
  • This is item 2
  • bullet point
  • another bullet point
  • Bullets are "-", "*" or "+". Continuing text must be aligned after the bullet and whitespace.

Note that a blank line is required before the first item and after the last, but is optional between items.

Enumerated Lists

Enumerated lists:

  1. This is the first item
  2. This is the second item
  3. Enumerators are arabic numbers, single letters, or roman numerals
  4. List items should be sequentially numbered, but need not start at 1 (although not all formatters will honour the first index).
  5. This item is auto-enumerated

Definition Lists

Definition lists:

what
Definition lists associate a term with a definition.
how
The term is a one-line phrase, and the definition is one or more paragraphs or body elements, indented relative to the term. Blank lines are not allowed between term and definition.

Field Lists

Authors:

Tony J. (Tibs) Ibbs, David Goodger

(and sundry other good-natured folks)

Version:

1.0 of 2001/08/08

Dedication:

To my father.

Option Lists

-a command-line option "a"
-b file options can have arguments and long descriptions
--long options can be long also
--input=file long options can also have arguments
/V DOS/VMS-style options too

Literal Blocks

A paragraph containing only two colons indicates that the following indented or quoted text is a literal block.

Whitespace, newlines, blank lines, and
all kinds of markup (like *this* or
\this) is preserved by literal blocks.

The paragraph containing only '::'
will be omitted from the result.

The :: may be tacked onto the very end of any paragraph. The :: will be omitted if it is preceded by whitespace. The :: will be converted to a single colon if preceded by text, like this:

It's very convenient to use this form.

Literal blocks end when text returns to the preceding paragraph's indentation. This means that something like this is possible:

    We start here
  and continue here
and end here.

Per-line quoting can also be used on unindented literal blocks:

> Useful for quotes from email and
> for Haskell literate programming.

Line Blocks

Line blocks are useful for addresses,
verse, and adornment-free lists.

Each new line begins with a
vertical bar ("|").
Line breaks and initial indents
are preserved.
Continuation lines are wrapped portions of long lines; they begin with spaces in place of vertical bars.

Block Quotes

Block quotes are just:

Indented paragraphs,

and they may nest.

Doctest Blocks

Doctest blocks are interactive Python sessions. They begin with ">>>" and end with a blank line.

>>> print "This is a doctest block."
This is a doctest block.

Tables

Grid table:

Header 1 Header 2 Header 3
body row 1 column 2 column 3
body row 2 Cells may span columns.
body row 3 Cells may span rows.
  • Cells
  • contain
  • blocks.
body row 4

Simple table:

Inputs Output
A B A or B
False False False
True False True
False True True
True True True

Transitions

A transition marker is a horizontal line

of 4 or more repeated punctuation characters.


A transition should not begin or end a section or document, nor should two transitions be immediately adjacent.

Explicit Markup

Footnotes

Footnote references, like [5]. Note that footnotes may get rearranged, e.g., to the bottom of the "page".

[5]A numerical footnote. Note there's no colon after the ].

Autonumbered footnotes are possible, like using [1] and [2].

[1]This is the first one.
[2]This is the second one.

They may be assigned 'autonumber labels' - for instance, [4] and [3].

[3]a.k.a. third
[4]a.k.a. fourth

Auto-symbol footnotes are also possible, like this: [*] and [†].

[*]This is the first one.
[†]This is the second one.

Citations

Citation references, like [CIT2002]. Note that citations may get rearranged, e.g., to the bottom of the "page".

[CIT2002](1, 2) A citation (as often used in journals).

Citation labels contain alphanumerics, underlines, hyphens and fullstops. Case is not significant.

Given a citation like [this], one can also refer to it like this.

[this]here.

Hyperlink Targets

External hyperlinks, like Python.

External hyperlinks, like Python.

Internal crossreferences, like example.

This is an example crossreference target.

Python is `my favourite programming language`__.

Titles are targets, too

Implict references, like Titles are targets, too.

Directives

For instance:

images/ball1.gif

Substitution References and Definitions

The biohazard symbol must be used on containers used to dispose of medical waste.

Comments

An "empty comment" does not consume following blocks. (An empty comment is ".." with blank lines before and after.)

So this block is not "lost", despite its indentation.

end of file...