Python project documentation with Sphinx

This post is an “open post” where I put useful tips & tricks about documentation in Python projects.

Most used inline formatting rules

  • **bold** which render bold
  • *italics* which render italic
  • “inline literal monospace“ which render inline literal monospace
  • `Python <>`_ which render Python



How to install and build a custom Zepto library

If you’re searching for a light-weight JavaScript library similar to jQuery to use in your development for mobile hybrid app (i.e. with PhoneGap) then Zepto is your choice! This library it’s really compact, open source (MIT license), weights just 9.2kB and if you already know jQuery (who doesn’t?) Zepto APIs match jQuery ones…

Zepto’s default package contains these modules: zepto, event, ajax, form and ie (check Zepto site for explanations and full list of modules!).

A very cool thing about Zepto is that you can create your own package with only needed modules! To build a custom Zepto library you should have Node.js installed on your system and follow these steps (for linux and OSX):

  • download Zepto source code from Github (i.e. in zip archive)
  • unzip it and open a terminal in that directory (i.e. you should be inside something like ‘/tmp/zepto-master/’)
  • execute following command:
    • npm install
    • npm run-script dist
    • MODULES=”zepto event data” npm run-script dist

…where “zepto event data” is a space-separated list of wanted modules! After this you should find your Zepto custom library (uncompressed, minified and gzipped) inside ‘dist’ directory (i.e. ‘/tmp/zepto-master/dist/’)…

Please note that inside your custom library you can find in the first line a comment with your choosen modules.

Sass logo

SASS or how to DRY your CSS

I’ve read an interesting article introducing SASS.

In short: SASS (Syntactically Awesome StyleSheets) is an extension of CSS that allow you to code and organize your stylesheet using variables, nested rules, mixins and inline imports!

As outlined in the linked post it may appear as an hindrance but it isn’t: actually if your start using it you’re applying the “don’t repeat yourself” (DRY) principle… no more redundant repetition but a more clean and neat set of stylesheets!

…and it’s an open source project!!!

Steps to get started? A few:

  1. install a Sass application or the command line utility to process .scss files
  2. take a look at sass reference
  3. write a .scss file
  4. put it through one of those compiler and you get your css files!


Thanks to @castagna I found this interesting project: ElasticSearch.

It is an Open Source (Apache 2), Distributed, RESTful (alt), Search Engine built on top of Apache Lucene.

I like their motto: “This should be easier and cool, bonsai cool”.

I’ll cover it eventually.