PyGreen – The Simplest Static Web Site Generator Ever For Python Programmers
butterflyprogramming.neoname.eu
butterflyprogramming.neoname.eu
#!/bin/bash
for f in *.mdwn
do
pandoc "$f" -o "${f%.*}.html" --standalone
done
A bash script with a loop plus one command to convert a markdown file into a HTML file. You might choose something different than pandoc. Most likely you will have an executable called "markdown*" in your $PATH.I created PyGreen to be able to do the same thing but with an even faster startup. With it I don't need to create a base setup or copy-paste an old one. I just begin to work on the home page and exporting the style of the web site in a template takes like 10 seconds. And that's it, I spent 10 seconds on the coding of my website and I can use pygreen gen to get my static version to push on github pages.
Later, if I want, I can ditch the static version and add dynamic web pages. PyGreen does not use declarative markdown files, there is nothing that prevents you from adding completely dynamic stuff in the templates. It also uses Bottle, which is almost the same as Flask. So I can just add routes to Bottle and anything dynamic I could need then publish my app on a small server.
https://github.com/daeken/Benjen
"Benjen is a tiny static blog generator. At its heart is a <100 line Python script, which takes in your templates and blog entries and produces a static site."
You should consider adding a little more leading to your website's copy to improve readability.
No, seriously, if you want to compare with an old stuff compare with PHP because that's precisely what I copied. But as far as I know there was no other project that ported that quick&dirty approach to Python.
> if you want to compare with an old stuff compare with PHP because that's precisely what I copied. But as far as I know there was no other project that ported that quick&dirty approach to Python.
mod_python has been around for something like 13 years.Note: I make no recommendation for its usage. I personally consider 'start with html and add dynamic bits', for anything beyond the trivial, as an anti-pattern.
[1]: http://www.modpython.org/live/current/doc-html/pyapi-psp.html
[2]: https://en.wikipedia.org/wiki/Python_Server_PagesI'm the first to say it's quick&dirty. Yet quick&dirty has its advantages in some cases, even for good programmers that know how to make solid and maintainable applications.
Who uses easy_install these days.