views:

239

answers:

4

Instead of a blog/cms, I'd like to have a static html-based site with a few (rarely updated) pages. I figure the simplest way to update them is to keep the sources in a format like ReST, and compile it each time it updates. What is a recommended compiler for this usage? I'd like to have my own theme/design and I don't need anything beyond the proper ReST syntax (Sphinx is too much, for example).

+1  A: 

A Makefile would be a good solution to do this. Here's a quick template makefile

# Flags to pass to rst2html
# e.g. RSTFLAGS = --stylesheet-path=mystyle.css 
RSTFLAGS = 

%.html: %.rst
        rst2html $(RSTFLAGS) $< $@

.PHONY: all
.DEFAULT: all

all: index.html foo.html bar.html # any other html files to be generated from an rst file

Then just run make in the directory with your files to generate the html from the rst

Geoff Reedy
+2  A: 

rest2web might be more the sort of thing you're looking for.

Geoff Reedy
I decided to go with this since it is the bare minimum - exactly what I wanted. Thanks!
MTsoul
+1  A: 

If you dont necessarily need restructured text, but markdown or textile is just as fine, then check out jekyll.

I use it myself. Thumbs up.

Christian
A: 

I use nanoc3 along with docutils (via a sphinx install) to enable nice restructuredtext support in a static site generator. I've looked at (and would like to use) a pure python solution (hyde) but nanoc allows for cleaner ReST source files.

I've also considered using sphinx to produce a static site, but it's not as easy to do this without rolling a lot of code to support it.

I'm happy to detail how to do this precisely if there is still interest in this topic. It's basically using docutils to output html from the source rest. I have a simple nanoc processor that does this:

module Nanoc3::Filters

  class ReST < Nanoc3::Filter

    identifier :rest

    def run(content, params={})
      open('|rst2html.py --template=rest.template', 'r+') do |io|
        io.write(content)
        io.close_write
        io.read
      end
    end

  end

end

The rest.template file is basically a dummy template with the following single line:

%(body)s
altercation