About

Welcome to Panela, Matt Harrison's take on mostly Open Source, Linux, Python, innovation in those areas, other buzzwords and Dick Proenneke. It comes complete with the illustrations as needed. Note the opinions expressed here are merely my opinions and not the opinions of my employer.

about Matt

Calendar

««Nov 2009»»
SMTWTFS
1234567
8910
11
12
1314
151617
18
192021
22232425262728
2930

Mailing List

My RSS Feeds








reStructuredText is cool

posted 2006.01.22 Sun
A few weeks ago I blogged about what digital format to use for a journal that would eventually be printed at some indefinite point in the future. I was deliberating between odt and html. OpenOffice gave me essentially what I wanted, but I thought using a text file instead of a binary file might help out since I'm going to be adding lots of pictures (would rather have a pointer to them than embed them), and I can also do a diff of a text file. Well a kind reader recommended I look into reStructuredText and I'm glad he reminded me of it. (I've been meaning to check it out). I should add that I was thinking about using wiki markup as well (I would say wiki is to html what python is to java). But I think rst is actually a very good match for me. Here's what I like about rst:
  • I can edit in any text editor
  • The markup is really simple. Here's a template I made for myself:
    Jan 22, 2006
    -------------
    
    Paragraph number 1.
    
    Paragraph number 2.
    
    .. figure:: /path/to/picture
       :width: 600
    
       Caption for picture
    
    (The really nice thing here is the figure markup. It adds a bunch of div tags around the image and the caption, so if I want to do anything fancy with css it would be simple. I don't know how easy this is in wiki...).
  • I can open/import it in OpenOffice after I convert it to html (which consists of doing the following: rst2html.py journal.rst > test.html
  • I can export as tex if I feel the desire
  • I can spell check in emacs
  • The file size of my journal will stay relatively small. (I'm keeping backups of my pictures as well and the links should be easy to replace, since I have a straightforward numbering scheme for storing digital pics on my computer)
  • I can use it for creating an s5 slideshow for pycon...
Downsides? Well, I have to postprocess the file, before being able to preview in html.... Oh well, I like it so far.

tags:        

links: digg this    del.icio.us    reddit




1. mpn left...
2006.01.23 Mon 3:50 pm

You might check out AsciiDoc as well http://www.methods.co.nz/asciidoc/


2. B. Smith-Mannschott left...
2006.01.25 Wed 1:25 am

rST rocks!

I use a slight variation on rST to for my work log book. Individual entries are marked by a line of the form:

$ YYYY-MM-DD @RST

The @RST string is optional. It marks the particular entry as RST (as opposed to plain text).

A script transforms this to true RST and does some other magic. It's very convenient to have the whole log book available in emacs for isearching. Currently it's about 1 MB of text and produces a 500 page book ( log -> rst -> tex -> pdf ).

The only drawback I've found with rST is that it really needs a monospaced font and explicit linebreaks to be useable. This makes it well-suited to editing in Emacs, but less than ideal when I'm pounding on my AlphaSmart Neo.


3. Jehiah left...
2006.02.12 Sun 7:40 pm :: http://jehiah.com/

I havn't heard of reStructuredText before, but it reminds me of Markdown which i am a big fan of.