sábado, 28 de febrero de 2015

Open source tools to document your software projects. Part 2: Pandoc

This is the second part of Open source tools to document your software projects if you want to read the fist part reviewing Markdown follow this link.

PANDOC

If you need to convert files from one markup format into another, pandoc is your swiss-army knife.[1]
Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, TWiki markup, OPML, Emacs Org-Mode, Txt2Tags, Microsoft Word docx, EPUB, or Haddock markup to HTML formats ( XHTML, HTML5, and HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides), Word processor  (Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML), Ebooks (EPUB version 2 or 3, FictionBook2), Documentation (DocBook, GNU TexInfo, Groff man pages, Haddock markup), Page layout formats(InDesign ICML), TeX formats(LaTeX, ConTeXt, LaTeX Beamer slides), PDF (via LaTeX), and Lightweight markup formats (Markdown, reStructuredText, AsciiDoc, MediaWiki markup, DokuWiki markup, Emacs Org-Mode, Textile), among others.

Getting pandoc

For Debian users pandoc is available from the official repositories. Get it with standard software applications
$ apt-get install pandoc -y

Using pandoc[2]

If the markdown formatted text is "pandoc.md" the following commands can be tested:

Markdown to HTML:
pandoc pandoc.md -o my_parsed_html.html
Markdown to an standalone HTML
pandoc -s pandoc.md -o my_parsed_html.html
Markdown to an standalone HTML with table of contents
pandoc -s --toc pandoc.md -o my_parsed_html.html
Markdown to  Latex
pandoc -s README -o example4.tex
Latex to Markdown
pandoc -s example4.tex -o example5.text
Markdown to PDF
pandoc -s example4.tex -o example5.text
To see more examples go to [2] or read the man page of pandoc. You can download the README file[3] and parse it to any other format by invoking pandoc and see the fancy output.

References

  1. from the creator of Pandoc at Pandoc webpage
  2. http://johnmacfarlane.net/pandoc/demos.html
  3. http://johnmacfarlane.net/pandoc/demo/README

No hay comentarios.:

Publicar un comentario