Praveen's Blog

An Eternal Quest for Incremental Improvement

Hello, Pelican World!

This post serves as a quick reference for reStructuredText markups that matters to me.

Emphasis

reStructuredText

This is regular text.

*Here is some text in italics.*

**and here is some in bold.**

.. There seems to be no direct support for strikethrough text. The
   closest, I could find is the following that requires customization
   of 'del' class in CSS. FIXME (2015-03-15, Praveen Kumar): Figure
   out if there is a way to neatly enclose it in <s> or <del> tag
   instead.

Here is a sample :del:`strikethrough text`.

``0xdeadbeef`` is the favorite steak of a software engineer.

Less is a :abbr:`CSS (Cascading Style Sheets)` pre-processor, meaning
that it extends the CSS language, adding features that allow
variables, mixins, functions and many other techniques that allow you
to make CSS that is more maintainable, themable and extendable.

You can quit Emacs using the keystroke :kbd:`C-x C-c`.

Rendering

This is regular text.

Here is some text in italics.

and here is some in bold.

0xdeadbeef is favorite steak of a software engineer.

Less is a CSS pre-processor.

You can quit Emacs using the keystroke C-x C-c.

Quotes

reStructuredText

.. class:: bg-primary
..

   I think it's fair to say that personal computers have become the
   most empowering tool we've ever created. They're tools of
   communication, they're tools of creativity, and they can be shaped
   by their user.

   -- Bill Gates.

.. class:: blockquote-reverse
..

   Computers themselves, and software yet to be developed, will
   revolutionize the way we learn.

   -- Steve Jobs


.. class:: blockquote-reverse bg-success
..

    | An old silent pond...
    | A frog jumps into the pond,
    | splash! Silence again.

    -- Bashō

Rendering

I think it's fair to say that personal computers have become the most empowering tool we've ever created. They're tools of communication, they're tools of creativity, and they can be shaped by their user.

—Bill Gates.

Computers themselves, and software yet to be developed, will revolutionize the way we learn.

—Steve Jobs

An old silent pond...
A frog jumps into the pond,
splash! Silence again.

—Bashō

Code

reStructuredText

.. code-block:: haskell
   :linenos:

    quickSort :: Ord a => [a] -> [a]
    quickSort []     = []                               -- The empty list is already sorted
    quickSort (x:xs) = quickSort [a | a <- xs, a < x]   -- Sort the left part of the list
                       ++ [x] ++                        -- Insert pivot between two sorted parts
                       quickSort [a | a <- xs, a >= x]  -- Sort the right part of the list

Rendering

1
2
3
4
5
 quickSort :: Ord a => [a] -> [a]
 quickSort []     = []                               -- The empty list is already sorted
 quickSort (x:xs) = quickSort [a | a <- xs, a < x]   -- Sort the left part of the list
                    ++ [x] ++                        -- Insert pivot between two sorted parts
                    quickSort [a | a <- xs, a >= x]  -- Sort the right part of the list

Tables

reStructuredText

.. class:: table table-striped
.. table:: Truth Table

    =====  =====  ======
       Inputs     Output
    ------------  ------
      A      B    A or B
    =====  =====  ======
    False  False  False
    True   False  True
    False  True   True
    True   True   True
    =====  =====  ======


.. class:: table table-striped

    +------------+------------+-----------+
    | 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  | - Cells   |
    +------------+ span rows. | - contain |
    | body row 4 |            | - blocks. |
    +------------+------------+-----------+

Rendering

Truth Table
Inputs Output
A B A or B
False False False
True False True
False True True
True True True
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

Images

reStructuredText

.. class:: pull-left img-thumbnail img-padding
.. figure:: http://upload.wikimedia.org/wikipedia/commons/3/3a/Greek_lc_lamda_thin.svg
   :alt: Lambda

   Lambda is beautiful!

Rendering

Lambda

Lambda is beautiful!

Lorem ipsum dolor sit amet, per ei laoreet erroribus. Ea enim definiebas vix, ea sea labores invenire vituperatoribus. No labitur delenit evertitur mel, invidunt prodesset dissentiunt an his. Nec sensibus molestiae philosophia in. Quot lorem reprehendunt mei id, te pri partiendo temporibus. Vim ei illud malis maiestatis.

Tota percipitur ut cum. Quo no dictas mollis petentium, te civibus denique vel, ad his porro verear diceret. Ne sea alii nullam audiam, liber antiopam mei at. Doming definitionem pro an, pri an mucius consequuntur vituperatoribus. Vel an paulo moderatius. An mea consequat contentiones.

Homero impedit vocibus et nam, mea id verear maiestatis. Mel an dicant graeco, sed eu novum nominati dissentiunt, has in fierent delectus salutatus. Mel an odio eruditi maiorum, et eum congue soleat inciderint. No tamquam invenire est, sed mentitum intellegat an. An his sumo habemus omittantur, ex verear accommodare vel. Cum id quot epicurei incorrupte.

Sea in erant diceret reprimique. Nibh nobis suavitate est et, sadipscing voluptatibus his ei. Mei iisque scripserit ex. Eu usu dolores hendrerit, his nihil recusabo ex. Sanctus laoreet ullamcorper ea nec, eum et movet quando.

Lorem ipsum dolor sit amet, per ei laoreet erroribus. Ea enim definiebas vix, ea sea labores invenire vituperatoribus. No labitur delenit evertitur mel, invidunt prodesset dissentiunt an his. Nec sensibus molestiae philosophia in. Quot lorem reprehendunt mei id, te pri partiendo temporibus. Vim ei illud malis maiestatis.

Tota percipitur ut cum. Quo no dictas mollis petentium, te civibus denique vel, ad his porro verear diceret. Ne sea alii nullam audiam, liber antiopam mei at. Doming definitionem pro an, pri an mucius consequuntur vituperatoribus. Vel an paulo moderatius. An mea consequat contentiones.

Homero impedit vocibus et nam, mea id verear maiestatis. Mel an dicant graeco, sed eu novum nominati dissentiunt, has in fierent delectus salutatus. Mel an odio eruditi maiorum, et eum congue soleat inciderint. No tamquam invenire est, sed mentitum intellegat an. An his sumo habemus omittantur, ex verear accommodare vel. Cum id quot epicurei incorrupte.

Sea in erant diceret reprimique. Nibh nobis suavitate est et, sadipscing voluptatibus his ei. Mei iisque scripserit ex. Eu usu dolores hendrerit, his nihil recusabo ex. Sanctus laoreet ullamcorper ea nec, eum et movet quando.

Misc

reStructuredText

.. panel:: Test panel

    A test panel is a predetermined group of medical tests as an aid in
    the diagnosis and treatment of disease.

    Test panels (sometimes called profiles) are typically composed of
    individual laboratory tests which are related in some way: by the
    medical condition they are intended to help diagnose (cardiac risk
    panel), by the specimen type (complete blood count, CBC), by the tests
    most frequently requested by users (comprehensive chemistry profile),
    by the methodology employed in the test (viral panel by polymerase
    chain reaction), or by the types of components included (urine drug
    screen).

Rendering

Test panel

A test panel is a predetermined group of medical tests as an aid in the diagnosis and treatment of disease. Test panels (sometimes called profiles) are typically composed of individual laboratory tests which are related in some way: by the medical condition they are intended to help diagnose (cardiac risk panel), by the specimen type (complete blood count, CBC), by the tests most frequently requested by users (comprehensive chemistry profile), by the methodology employed in the test (viral panel by polymerase chain reaction), or by the types of components included (urine drug screen).

Comments