Friday, 19 September 2014

How to install Pandoc on Arch Linux based distros

  1. Add haskell-core was above extra in /etc/pacman.conf:
    $ sudo nano /etc/pacman.conf
    [haskell-core]
    Server = http://xsounds.org/~haskell/core/$arch
  2. Remove alex, ghc, happy and other haskell packages from the extra repository from your system
  3. Add key and install Pandoc and Texlive (needed to generate PDF):
    $ sudo pacman-key -r 4209170B
    $ sudo pacman-key --lsign-key 4209170B
    $ sudo pacman -Scc
    $ sudo pacman -Syy
    $ sudo pacman -S haskell-pandoc haskell-pandoc-citeproc haskell-pandoc-types
    $ sudo pacman -S texlive-core 
  4. I am using Sphinx which is a tool that makes it easy to create intelligent and beautiful documentation. Sphinx and I use reStructuredText (rst) instead of markdown (md). Here is a comparison between markdown and reStructuredText. Try pandoc site offers to convert between different text syntax formats.
    These is a little reStructuredText syntax:
    Title
    =====
    
    Heading 1
    ---------
    
    Heading 2
    `````````
    
    Heading 3
    '''''''''
    
    Heading 4
    .........
    
    Heading 5
    ~~~~~~~~~
    
    Heading 6
    *********
    
    Heading 7
    +++++++++
    
    Heading 8
    ^^^^^^^^^
    
    *Italic*
    
    **bold**
    ReStructuredText’s cheat sheet
  5. Converting reStructuredText to PDF and DOCX:
    $ pandoc -V geometry:a4paper -f rst --toc --smart -o test.pdf test.rst
    $ pandoc -V geometry:a4paper -f rst --toc --smart -o test.docx test.rst
  6. Converting reStructuredText to other formats.

No comments:

Post a Comment