An example using simplicity and complexity.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
project
.gitignore
README.rst

README.rst

simplicity-complexity-example

Date: July 19, 2013
Author: Daniel Greenfeld
Version: 1.0
description:An example of using Simplicity to populate the data in a Complexity generated site.

Clone this and use it with the Complexity static site generator. Try it out:

$ pip install simplicity
$ pip install complexity
$ git clone git@github.com:pydanny/simplicity-complexity-example.git my_project
$ cd my_project
$ simplicity README.rst > project/json/README.json
$ complexity project www

Open http://127.0.0.1:9090/

BOOM!

What the @#$% just happened?!?

  1. You installed:

    • simplicity: Converts ReStructuredText into JSON.
    • complexity: A refreshingly simple static site generator, for those who like to work in HTML.
$ pip install simplicity
$ pip install complexity
  1. You cloned these files to your local machine and went inside them.
$ git clone git@github.com:pydanny/simplicity-complexity-example.git my_project
$ cd my_project
  1. You used simplicity to convert this README.rst file to JSON.
$ simplicity README.rst > project/json/README.json
  1. You used complexity to generate a static HTML site in a new 'www' folder.
$ complexity project www
  1. You viewed the generated static site which was served by complexity's built-in HTTP server:

    $ open http://127.0.0.1:9090

And?

Take a look at https://github.com/pydanny/simplicity-complexity-example/blob/master/project/templates/index.html

{% extends "base.html" %}

{% block title %}Home{% endblock %}

{% block content %}
<div class="row">
    <div class="span12">
        <h1>{{ README.0.title }}</h1>
        <p>Created: {{ README.0.date }}</p>
        <p>Author: {{ README.0.author }}</p>
        <p>Version: {{ README.0.version }}</p>
        <p>Version: {{ README.0.description }}</p>

    </div>
</div>
{% endblock %}

Complexity used Jinja2 to render the data elements in that module with the README.json module you just created from this file using simplicity.

Easy as that.