ReStructuredText: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
Line 23: Line 23:


=== Lists ===
=== Lists ===
각각의 항목에 따라 자동으로 번호 및 들여쓰기 마킹이 가능하다.
<pre>
* Athing.
* Another thing.


or
1. Item 1.
2. Item 2.
3. Item 3.
or
- Some.
- Thing.
- Different.
</pre>
다음과 같은 방식으로도 가능하다.
<pre>
  - A bullet list item
  - A bullet list item
  - Second item
  - Second item
Line 51: Line 70:
   
   
  #) Second item
  #) Second item
</pre>


=== Images ===
=== Images ===

Revision as of 09:14, 4 July 2016

Overview

reStructuredText 사용법 정리.

문서를 Git 이나 다른 형상관리툴로 관리하기에는 많은 어려움이 있다. 간단하게 문서 내용을 업데이트하고, 저장소 에 push 했을때, 문서의 어떤 내용이 변경되었는지 알기가 어렵다. reStructuredText 가 이에 대한 해답이 될 수도 있다.

Examples of reST markup

Headers

H1, H2, H3, H4 단계로 크기 설정이 가능하다.

H1 --  Top of Page Header
*************************

H2 -- Page Sections
===================

H3 -- Subsection
-----------------

H4 -- Subsubsection
+++++++++++++++++++

Lists

각각의 항목에 따라 자동으로 번호 및 들여쓰기 마킹이 가능하다.

* Athing.
* Another thing.

or

1. Item 1.
2. Item 2.
3. Item 3.

or

- Some.
- Thing.
- Different.

다음과 같은 방식으로도 가능하다.

 - A bullet list item
 - Second item
 
   - A sub item
 
 - Spacing between items creates separate lists
 
 - Third item
 
 1) An enumerated list item
 
 2) Second item
 
    a) Sub item that goes on at length and thus needs
       to be wrapped. Note the indentation that must
       match the beginning of the text, not the 
       enumerator.
 
       i) List items can even include
 
          paragraph breaks.
 
 3) Third item
 
 #) Another enumerated list item
 
 #) Second item

Images

.. image:: /path/to/image.jpg

Named links

A sentence with links to Wikipedia_ and the `Linux kernel archive`_.

.. _Wikipedia: http://www.wikipedia.org/
.. _Linux kernel archive: http://www.kernel.org/

Anonymous links

Another sentence with an `anonymous link to the Python website`__.

__ https://www.python.org/

N.B.: named links and anonymous links are enclosed in grave accents (`), and not in apostrophes (').

Literal blocks

::

  some literal text

This may also be used inline at the end of a paragraph, like so::

  some more literal text

.. code:: python

<source lang="python" enclose="none">
   print("A literal block directive explicitly marked as python code")
</source>

See also

  • Sphinx (documentation generator)
  • Comparison of documentation generators
  • Comparison of notetaking software
  • Comparison of document markup languages
  • Setext, an old lightweight markup language (1992).
  • Markdown, a widespread lightweight markup language.
  • MultiMarkdown, an improved Markdown.
  • Org-mode, a similar lightweight markup.
  • Textile (markup language), a similar lightweight markup language to produce HTML.
  • AsciiDoc, a similar lightweight markup language supporting many types of documents.
  • txt2tags, another similar lightweight markup language.

References

<references />