HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
luckythetourist
staticgenerator
HISTORICAL RECORD2010–2012
luckythetourist / staticgenerator · Not publicly available

staticgenerator

Discover this repository through its Hacker News conversations.

2Distinct people
2Mentions
0Explicit recommenders
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A public description has not been verified.

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 5:04:57 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by month2 dated mentions

Observed mentions: 2010-12-20 21:00:51 UTC to 2012-03-30 12:27:05 UTC.

012010-12-01 00:00:00 UTC to 2011-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsDec 20102011-01-01 00:00:00 UTC to 2011-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-02-01 00:00:00 UTC to 2011-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-03-01 00:00:00 UTC to 2011-04-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-04-01 00:00:00 UTC to 2011-05-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-05-01 00:00:00 UTC to 2011-06-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-06-01 00:00:00 UTC to 2011-07-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-07-01 00:00:00 UTC to 2011-08-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsJul 20112011-08-01 00:00:00 UTC to 2011-09-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-09-01 00:00:00 UTC to 2011-10-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-10-01 00:00:00 UTC to 2011-11-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-11-01 00:00:00 UTC to 2011-12-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2011-12-01 00:00:00 UTC to 2012-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-01-01 00:00:00 UTC to 2012-02-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-02-01 00:00:00 UTC to 2012-03-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2012-03-01 00:00:00 UTC to 2012-04-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsMar 2012

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Dec 20102010-12-01 00:00:00 UTC2011-01-01 00:00:00 UTC101
Jan 20112011-01-01 00:00:00 UTC2011-02-01 00:00:00 UTC000
Feb 20112011-02-01 00:00:00 UTC2011-03-01 00:00:00 UTC000
Mar 20112011-03-01 00:00:00 UTC2011-04-01 00:00:00 UTC000
Apr 20112011-04-01 00:00:00 UTC2011-05-01 00:00:00 UTC000
May 20112011-05-01 00:00:00 UTC2011-06-01 00:00:00 UTC000
Jun 20112011-06-01 00:00:00 UTC2011-07-01 00:00:00 UTC000
Jul 20112011-07-01 00:00:00 UTC2011-08-01 00:00:00 UTC000
Aug 20112011-08-01 00:00:00 UTC2011-09-01 00:00:00 UTC000
Sep 20112011-09-01 00:00:00 UTC2011-10-01 00:00:00 UTC000
Oct 20112011-10-01 00:00:00 UTC2011-11-01 00:00:00 UTC000
Nov 20112011-11-01 00:00:00 UTC2011-12-01 00:00:00 UTC000
Dec 20112011-12-01 00:00:00 UTC2012-01-01 00:00:00 UTC000
Jan 20122012-01-01 00:00:00 UTC2012-02-01 00:00:00 UTC000
Feb 20122012-02-01 00:00:00 UTC2012-03-01 00:00:00 UTC000
Mar 20122012-03-01 00:00:00 UTC2012-04-01 00:00:00 UTC101

What Hacker News says

2 sources
If you want an off-the-shelf solution, then you need two pieces - a markup parser and a template package. The parser could be Textile, Markdown, RST, or various parsers implementing different wiki markups. There are python libraries to implement almost anything you want. Or you could write your own. The parser goes through your content, and applies basic rules to translate it into HTML. If you want a quick a dirty hack, just: 1. enumerate files in "posts" directory 2. sort by date edited 3. open each file in turn 4. read in contents and store as a string 5. chunk string by splitting on "\n\n" (ie, an empty line) 6. for each chunk, append <p> to output string 7. for each chunk, apply a regex to look pairs of *s 8. for each pair of *s, replace them with <b> and </b> 9. append the resulting chunk and a </p> 10. repeat
Read the rest
6-9 for each chunk 11. repeat 5-10 for each file until done The end result of all that should probably be something like a dict, with a single key "body" container your post with <p> and <b> tags. Add an author and date keys, and your ready to hand it off to your template system. The problem comes if you want to do anything more than paragraphs and bold text, like, for example, a hyperlink, or an unordered list. All of a sudden you will learn why using regexps to parse any sort of markup is a terrible idea. It's like trying to fix a car engine with a toothbrush; even if you can make it work, you really shouldn't. There's a lot of info on writing parsers with Python out there, and a bunch of parser modules you can use[1], but as far as I know the short of it is that it's really quite hard. Either do some research on parsers and be prepared to devote a lot of time to it, or find one someone's already written is my advice. (Either way, don't actually use regexps to try and make your own markup parser on the cheap.) As for the template system, you could use Mustache, or Jinja 2, or if you're okay with going beyond Python, any of a hundred others, depending in what you want. I'm quite fond of HAML syntax, but most of the template systems I know which speak HAML or a variant or written in Javascript or Ruby, for example. If you want to write your own you'll face an easier task than for the parser step. Again, you'll want to read in the template files, but the tokens your looking to replace are pretty simple. Ideally they'll be something like: "$$IDENTIFIER$$"; a regexp can easily find that, then you use the identifier as a key for your dictionary you got from your parser, and bob's your aunty. The remaining trick is stuff like navigation. A naive implementation will just process each file one at a time, which makes things like an archive page which lists every post you've made in each month tricky. You can get around this by reprocessing every page every "compile", saving some metadata (like data and titles) and then generating your navigation, indexes, and archives. If you're even smarter you can try and cache stuff so you don't need to recompile stuff that hasn't changed; this will require persisting metadata locally, presumably on the file system. At some point you'll probably be tempted to drop in an SQLite database to store the metadata; this is pretty easy, but you might want to just run a full on CMS locally and cache the results to a file system. Django has the Static Generator project[2], and Flask has something very similar. These basically turn Django (or Flask) into a tool that will "auto generate static HTML pages from a selection of page templates and a [database] of text", which is more or less what you want. (Of course, the static generation route is never going to make comments workable. This may or may not be an issue for you, depending on how much you hate Disqus.) [1]: For example, PLY: http://www.dabeaz.com/ply/ If you look at that and go "ah, this will be easy" then knock yourself out. Most people find this stuff pretty dry and difficult though. :) [2]: https://github.com/luckythetourist/staticgenerator
In Ask HN: I want to write my own CMS. Point me to some reading?

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.