Skip to content
A sketch for a Primer backed by Wikipedia.
HTML Python CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets
data
.gitignore
README.md
build_data.py
example.markup
fullscreen.html
index.html
primer.py
requirements.txt
server.pem

README.md

Primer

Although this is a long way away from the Primer as envisioned by Neal Stephenson, it's an extremely rough sketch of a primer backed by Wikipedia. If you haven't already, go read https://en.wikipedia.org/wiki/The_Diamond_Age

A live, running version is available at http://primer.piratestudios.com. This has been tested on Chrome, Safari and iOS.

Development Setup for OS X

virtualenv env
source env/bin/activate
STATIC_DEPS=true pip install lxml
pip install -r requirements.txt

Development Setup for Amazon Linux

	sudo yum install git emacs gcc gcc-c++ libxml2-devel libxslt-devel python-devel
	virtualenv env
	source env/bin/activate
	pip install lxml
	pip install -r requirements.txt

SSL Cert Generation for Local Testing

openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes

Ensure the "Common Name (e.g. server FQDN or YOUR name)" response is localhost

Usage

usage: primer.py [-h] [--article ARTICLE] [--file] [--random] [--server]
             [--https] [--port PORT] [--nojsoncache] [--nowikicache]
             [--norelatedmedia] [--nothreaded]

optional arguments:
  -h, --help         show this help message and exit
  --article ARTICLE  The article to generate. (World_War_I)
  --file             Write data to files
  --random           Get random image from Wikipedia.
  --server           Run interactive HTTP server
  --https            Serve using HTTPS
  --port PORT        The port listened to by the server. Defaults to 8000.
  --nojsoncache      Skip the JSON cache
  --nowikicache      Skip the Wiki markup cache
  --norelatedmedia   Skip related media discovery
  --nothreaded       Disable multithreaded media lookup

To run as an interactive server run:

./primer.py --server

And open http://localhost:8000 in your browser

You can’t perform that action at this time.