Development
Following Development ¶
nanoc uses the Mercurial distributed version control system. Those that are unfamiliar with Mercurial or DVCSes in general should read the Mercurial tutorial.
The repositories are located over here. There is a repository for nanoc itself, and there are repositories for sample sites and plugins. Each repository’s web interface has a timeline for following development.
There also is a Trac installation for nanoc which has a source code browser and a timeline, among other features, for tracking changes to the nanoc repository.
Enhancing nanoc ¶
The easiest way to customize nanoc is to implement helper functions in Ruby source files that reside inside a site’s lib directory. Most of what is defined in these files will be available during the compilation process (functions, classes, globals, …).
It is possible to override built-in nanoc functions by re-implementing them. This is not recommended, as it relies on nanoc’s internals which may change between releases, causing your site to break.
You can also write custom filters, layout processors and data sources to extend nanoc. The third chapter of the nanoc manual explains how to do this.
Modifying nanoc’s core ¶
It is possible to modify nanoc’s source code (that’s why nanoc is open source). This is quite useful for fixing bugs, or even adding new features to nanoc. However, I recommend not modifying nanoc itself, unless it is impossible to enhance nanoc by putting code in the lib directory.
A quick word about test: nanoc comes with a large amount of unit tests. There unit tests are not included in the standard nanoc distribution, since this would make nanoc a lot larger. You can get the tests from the repository (see above). If possible, run the unit tests to check whether your patch works. If you can’t run unit tests or if some tests fail, send the patch to me anyway—I’ll fix the issues.
If you have modified nanoc one way or another, I would love to see your changes. Create a ticket on the nanoc Trac, attach a patch, and specify what version of nanoc this patch was made for. If I like your patch, I will include it in the standard nanoc distribution, and include you in the nanoc credits.
A small word about licensing issues: nanoc is licensed under the MIT licence. To prevent legal issues, all your contributions to the nanoc core should also be under the MIT licence.
Any contribution to nanoc is more than welcome. Thanks in advance!