fix literal block format

This commit is contained in:
IGARASHI Masanao
2013-11-10 02:48:59 +09:00
parent 2a8968394e
commit 51f91fe4d3

View File

@@ -18,8 +18,8 @@
Add the following in your init.el Add the following in your init.el
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC lisp
(require 'ox-rst) (require 'ox-rst)
#+END_SRC #+END_SRC
* reStructuredText export * reStructuredText export
@@ -44,18 +44,18 @@
** Title, Author, E-Mail and Date ** Title, Author, E-Mail and Date
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+TITLE: This is the title of the document ,#+TITLE: This is the title of the document
#+AUTHOR: Author ,#+AUTHOR: Author
#+EMAIL: mailaddress@example.com ,#+EMAIL: mailaddress@example.com
#+DATE: 2013/12/31 00:00 ,#+DATE: 2013/12/31 00:00
#+OPTIONS: author:t date:t email:t ,#+OPTIONS: author:t date:t email:t
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
This is the title of the document This is the title of the document
================================================================== ==================================================================
:Author: Author :Author: Author
:Contact: mailaddress@example.com :Contact: mailaddress@example.com
@@ -65,154 +65,153 @@ This is the title of the document
** Headings ** Headings
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
* Heading 1 ,* Heading 1
contents 1 contents 1
** Heading 1-1 ,** Heading 1-1
contents 1-1 contents 1-1
*** Heading 1-1-3 ,*** Heading 1-1-3
contents 1-1-3 contents 1-1-3
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
Heading 1 Heading 1
------------------ ------------------
contents 1 contents 1
Heading 1-1 Heading 1-1
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
contents 1-1 contents 1-1
Heading 1-1-3 Heading 1-1-3
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
contents 1-1-3 contents 1-1-3
#+END_SRC #+END_SRC
** Table of contents ** Table of contents
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+OPTIONS: toc:t ,#+OPTIONS: toc:t
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. contents:: .. contents::
#+END_SRC #+END_SRC
** Lists ** Lists
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
** Lord of the Rings ,** Lord of the Rings
1. The attack of the Rohirrim 1. The attack of the Rohirrim
2. Eowyn's fight with the witch king 2. Eowyn's fight with the witch king
+ this was already my favorite scene in the book + this was already my favorite scene in the book
+ I really like Miranda Otto. + I really like Miranda Otto.
3. Peter Jackson being shot by Legolas 3. Peter Jackson being shot by Legolas
- on DVD only - on DVD only
He makes a really funny face when it happens. He makes a really funny face when it happens.
But in the end, no individual scenes matter but the film as a whole. But in the end, no individual scenes matter but the film as a whole.
Important actors in this film are: Important actors in this film are:
- Elijah Wood :: He plays Frodo - Elijah Wood :: He plays Frodo
- Sean Austin :: He plays Sam, Frodo's friend. I still remember - Sean Austin :: He plays Sam, Frodo's friend. I still remember
him very well from his role as Mikey Walsh in The Goonies. him very well from his role as Mikey Walsh in The Goonies.
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
Lord of the Rings Lord of the Rings
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. The attack of the Rohirrim 1. The attack of the Rohirrim
2. Eowyn's fight with the witch king 2. Eowyn's fight with the witch king
- this was already my favorite scene in the book - this was already my favorite scene in the book
- I really like Miranda Otto. - I really like Miranda Otto.
3. Peter Jackson being shot by Legolas 3. Peter Jackson being shot by Legolas
- on DVD only - on DVD only
He makes a really funny face when it happens. He makes a really funny face when it happens.
But in the end, no individual scenes matter but the film as a whole. But in the end, no individual scenes matter but the film as a whole.
Important actors in this film are: Important actors in this film are:
Elijah Wood Elijah Wood
He plays Frodo He plays Frodo
Sean Austin Sean Austin
He plays Sam, Frodo's friend. I still remember He plays Sam, Frodo's friend. I still remember
him very well from his role as Mikey Walsh in The Goonies. him very well from his role as Mikey Walsh in The Goonies.
#+END_SRC #+END_SRC
** Special Characters ** Special Characters
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
special characters * asterisk \ backspace special characters * asterisk \ backspace
.. reStructuredText comment line .. reStructuredText comment line
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
special characters \* asterisk \\ backspace special characters \* asterisk \\ backspace
\.. reStructuredText comment line \.. reStructuredText comment line
#+END_SRC #+END_SRC
** Paragraphs ** Paragraphs
*note* Org line breaks =\\= will be ignored. *note* Org line breaks =\\= will be ignored.
*** Verse block *** Verse block
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+BEGIN_VERSE ,#+BEGIN_VERSE
Great clouds overhead Great clouds overhead
Tiny black birds rise and fall Tiny black birds rise and fall
Snow covers Emacs Snow covers Emacs
-- AlexSchroeder -- AlexSchroeder
#+END_VERSE ,#+END_VERSE
#+END_SRC #+END_EXAMPLE
reStructuredText Line Blocks: reStructuredText Line Blocks:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
| Great clouds overhead | Great clouds overhead
| Tiny black birds rise and fall | Tiny black birds rise and fall
| Snow covers Emacs | Snow covers Emacs
| |
| -- AlexSchroeder | -- AlexSchroeder
| |
#+END_SRC #+END_SRC
*** Quote block *** Quote block
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+BEGIN_QUOTE ,#+BEGIN_QUOTE
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
#+END_QUOTE ,#+END_QUOTE
#+END_SRC #+END_EXAMPLE
reStructuredText Literal Blocks: reStructuredText Literal Blocks:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
:: ::
Everything should be made as simple as possible, Everything should be made as simple as possible,
@@ -220,22 +219,22 @@ Everything should be made as simple as possible,
#+END_SRC #+END_SRC
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+ATTR_RST: :margin 4 ,#+ATTR_RST: :margin 4
#+BEGIN_QUOTE ,#+BEGIN_QUOTE
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
#+END_QUOTE ,#+END_QUOTE
#+ATTR_RST: :margin 8 ,#+ATTR_RST: :margin 8
#+BEGIN_QUOTE ,#+BEGIN_QUOTE
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
#+END_QUOTE ,#+END_QUOTE
#+END_SRC #+END_EXAMPLE
reStructuredText Block Quotes: reStructuredText Block Quotes:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
@@ -244,34 +243,34 @@ but not any simpler -- Albert Einstein
#+END_SRC #+END_SRC
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+ATTR_RST: :directive note ,#+ATTR_RST: :directive note
#+BEGIN_QUOTE ,#+BEGIN_QUOTE
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
#+END_QUOTE ,#+END_QUOTE
#+END_SRC #+END_EXAMPLE
reStructuredText Directives: reStructuredText Directives:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. note:: .. note::
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
#+END_SRC #+END_SRC
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+ATTR_RST: :directive sidebar :title sidebar title ,#+ATTR_RST: :directive sidebar :title sidebar title
#+BEGIN_QUOTE ,#+BEGIN_QUOTE
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
#+END_QUOTE ,#+END_QUOTE
#+END_SRC #+END_EXAMPLE
reStructuredText Directives with title: reStructuredText Directives with title:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. sidebar:: sidebar title .. sidebar:: sidebar title
Everything should be made as simple as possible, Everything should be made as simple as possible,
but not any simpler -- Albert Einstein but not any simpler -- Albert Einstein
@@ -282,15 +281,15 @@ but not any simpler -- Albert Einstein
Center block will not affect. Center block will not affect.
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+BEGIN_CENTER ,#+BEGIN_CENTER
center block center block
#+END_CENTER ,#+END_CENTER
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
center block center block
#+END_SRC #+END_SRC
** Literal examples ** Literal examples
@@ -298,18 +297,16 @@ center block
*** example block *** example block
Org: Org:
#+BEGIN_SRC org-mode
#+NAME: label
#+BEGIN_EXAMPLE #+BEGIN_EXAMPLE
example ,#+NAME: label
#+END EXAMPLE ,#+BEGIN_EXAMPLE
#+END_SRC example
,#+END EXAMPLE
# maybe github org parser's bug #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
:: ::
:name: label :name: label
example example
@@ -318,17 +315,15 @@ example
*** src block *** src block
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+BEGIN_SRC org-mode ,#+BEGIN_SRC lisp
(require 'ox-rst) (require 'ox-rst)
#+END SRC ,#+END SRC
#+END_SRC #+END_EXAMPLE
# maybe github org parser's bug
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. code-block:: org-mode .. code-block:: lisp
(require 'ox-rst) (require 'ox-rst)
#+END_SRC #+END_SRC
@@ -336,40 +331,40 @@ example
** Emphasis and monospace ** Emphasis and monospace
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
*bold* /italic/ _underlined_ =code= ~verbatim~ +strike-through+ ,*bold* /italic/ _underlined_ =code= ~verbatim~ +strike-through+
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
**bold** *italic* underlined ``code`` ``verbatim`` strike-through ,**bold** *italic* underlined ``code`` ``verbatim`` strike-through
#+END_SRC #+END_SRC
** Horizontal rules ** Horizontal rules
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
----- -----
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
------------ ------------
#+END_SRC #+END_SRC
** Comment block ** Comment block
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+BEGIN_COMMENT ,#+BEGIN_COMMENT
comment comment
#+END_COMMENT ,#+END_COMMENT
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. ..
comment comment
#+END_SRC #+END_SRC
@@ -378,29 +373,29 @@ comment
*** Images *** Images
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+ATTR_RST: :alt alternate text :align right ,#+ATTR_RST: :alt alternate text :align right
[[./image.jpg]] [[./image.jpg]]
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. image:: ./image.jpg .. image:: ./image.jpg
:alt: alternate text :alt: alternate text
:align: right :align: right
#+END_SRC #+END_SRC
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+CAPTION: image caption ,#+CAPTION: image caption
#+NAME: label ,#+NAME: label
#+ATTR_RST: :alt alternate text :align center :scale 50% ,#+ATTR_RST: :alt alternate text :align center :scale 50%
[[./image.jpg]] [[./image.jpg]]
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. figure:: ./image.jpg .. figure:: ./image.jpg
:alt: alternate text :alt: alternate text
:align: center :align: center
:scale: 50% :scale: 50%
@@ -408,25 +403,24 @@ comment
image caption image caption
#+END_SRC #+END_SRC
*** Tables *** Tables
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
|------+------+------| |------+------+------|
| TOP1 | TOP2 | TOP3 | | TOP1 | TOP2 | TOP3 |
|------+------+------| |------+------+------|
| 1 | 2 | 3 | | 1 | 2 | 3 |
|------+------+------| |------+------+------|
| AAAA | BBBB | CCCC | | AAAA | BBBB | CCCC |
|------+------+------| |------+------+------|
| END1 | END2 | END3 | | END1 | END2 | END3 |
|------+------+------| |------+------+------|
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. table:: .. table::
+------+------+------+ +------+------+------+
| TOP1 | TOP2 | TOP3 | | TOP1 | TOP2 | TOP3 |
@@ -440,23 +434,23 @@ comment
#+END_SRC #+END_SRC
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+CAPTION: caption ,#+CAPTION: caption
#+NAME: label ,#+NAME: label
|------+------+------| |------+------+------|
| TOP1 | TOP2 | TOP3 | | TOP1 | TOP2 | TOP3 |
|------+------+------| |------+------+------|
| 1 | 2 | 3 | | 1 | 2 | 3 |
|------+------+------| |------+------+------|
| AAAA | BBBB | CCCC | | AAAA | BBBB | CCCC |
|------+------+------| |------+------+------|
| END1 | END2 | END3 | | END1 | END2 | END3 |
|------+------+------| |------+------+------|
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. table:: caption .. table:: caption
:name: label :name: label
+------+------+------+ +------+------+------+
@@ -473,31 +467,31 @@ comment
** Hyperlinks ** Hyperlinks
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
[[http://orgmode.org][Org Mode]] [[http://orgmode.org][Org Mode]]
[[http://orgmode.org]] [[http://orgmode.org]]
[[label]] [[label]]
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
`Org Mode <http://orgmode.org/>`_ `Org Mode <http://orgmode.org/>`_
`http://orgmode.org`_ `http://orgmode.org`_
`label`_ `label`_
#+END_SRC #+END_SRC
** Export reStructuredText fragments ** Export reStructuredText fragments
Org: Org:
#+BEGIN_SRC org-mode #+BEGIN_EXAMPLE
#+RST: .. class:: alert ,#+RST: .. class:: alert
#+END_SRC #+END_EXAMPLE
reStructuredText: reStructuredText:
#+BEGIN_SRC rst-mode #+BEGIN_SRC rst
.. class:: alert .. class:: alert
#+END_SRC #+END_SRC