The last several months I have been working on an exciting project: Pitance. Pitance stands for Project Infrastructure and Templates Are Now Convenient for Everyone, and is an infrastructure for sharing and managing project templates and snippets. This infrastructure consists of a website, an HTTP/JSON API, and a command line utility.
./pitance.py template erlang_couchdb_app > erlang_couchdb_app.erl# specific version
./pitance.py template erlang_couchdb_app 1 > erlang_couchdb_app.erl
If you have simplejson installed (or have a version of Python with the json library) then you
use pitance.py to create and update templates as well:
echo "print 'This is my template'" > test_template.py./pitance create python_test_template \ --language python \ --tags "test, useless" \ --related_templates "erlang_test, ruby_test" \ --author_email email@example.com # this is hidden from users, only visible to admin \ --author "Will Larson" \ --desc "This is a test for a Python template. Please ignore this." \ < test_template.py
That is to say, you add the template itself via standard input, and must specify the
parameters language, author_email, author and desc.
You may optionally specific the parameters tags and related_templates,
which take a comma-separated list.
Once you have created a template, you can update it in a similar fashion, with the important
caveat that you must load a template with each update, but all other parameters are
optional. This is actually a limitation in the command line client rather than the API, which
I will hopefully fix soon (basically, it just stalls out waiting for standard input...).
Each update creates a new version of the template, but the previous versions are still
available by explicit reference. This makes it possible for multiple individuals to contribute
wiki-style to templates, while still making it possible to ensure you get the templates you prefer.
I have a great quantity of ideas of how to improve Pitance, and will keep implementing them piece by
piece, depending from feedback and if this service seems to be useful to more individuals than just myself.
In no particular order, some of the ideas are:
Tweet updates and creation of templates.
Create variables within templates, to make it easier to customize (although, consistent naming and search & replace accomplishes this already).
The ability to declare template dependencies, to facilitate building multi-file project templates out of several templates (this could be built as a third-party system as well, on top of the existing apis).
Command-line client could use some work.
The some parts of the web-client and searches should make a distinction between projects and versions of projects (i.e. you search for erlang and get responses of erlang_couchdb_app - 1 and erlang_couchdb_app -2. That's kind of silly).
Syntax highlighting for the web pages (sadly, doing the implementation in Erlang has divided me from my longtime love Pygments).