spirit.bob provides several mr.bob template to generate packages for it-spirit projects.
To create a package like spirit.diazo.mytheme:
$ mrbob spirit.bob:diazo_theme
Note
In contrast to other available mr.bob templates (e.g. bobtemplates.plone), the packages created with spirit.bob create the package folder as well.
The templates provided by spirit.bob are categorized as follows:
- Plone and Diazo Packages
- Zope Packages (planned)
- Pyramid Packages (planned)
- diazo_theme
- A installable diazo core or customer theme. Core themes are mainly used as a base for most customer themes. Customer themes can extend a core theme.
On creating a package you can choose from the following options. The default value is in [square brackets].
- Type of the Theme (core or customer) [customer]
- A customer theme can extend a core theme.
Core themes will have the
spirit.diazonamespace prefix, customer themes thecustomer.diazonamespace prefix. - Base theme to extend
- Add the package name of the core theme you want to extend.
Leave empty if you don't want to extend.
This options is only available for
customerthemes. - Repository type of the base theme to extend [git]
- Should be something like 'git', 'hg', 'svn'. Used for the mr.developer source section within the buildout. This option is only available if a base theme was provided.
- Repository URL of the base theme to extend [https://github.com/it-spirit/spirit.diazo.base]
- The URL to the repo used for the mr.developer source section within the buildout. This option is only available if a base theme was provided.
- Name of the Theme [Example Theme]
- Should be something like 'Example Theme'.
- Package Name of the Theme [example]
- Should be something like 'example'.
Package created with spirit.bob use the current best-practices when creating an addon.
- Buildout
- The packages are contained in a buildout that allow you to build Plone with the new package installed for testing-purposes.
- Locales
- The packages register a directory for locales.
- Profile
- The packages contain a Generic Setup Profile that installs a browserlayer.
- Setuphandler
- The packages contain a setuphandlers.py where you can add code that is executed on installing the package.
- Template-Overrides
- The packages register the folder
template_overridesas a directory where you can drop template-overrides using z3c.jbot. - Tests
- The packages come with a test setup and some tests for installing the package. They also contain a robot-test for browser testing. The buildouts also contains a config to allow testing the package on travis.
Addons created with spirit.bob are tested to work in Plone 4.3.x.
They should also work with other versions but that was not tested.
[buildout]
parts += mrbob
[mrbob]
recipe = zc.recipe.egg
eggs =
mr.bob
spirit.bob
If you want to use the latest development version from GitHub, add spirit.bob to your mr.developer source section:
[buildout] extensions += mr.developer [sources] spirit.bob = git git://github.com/it-spirit/spirit.bob.git
This creates a mrbob-executeable in your bin-directory.
Call it from the src-directory of your project like this.:
$ ../bin/mrbob spirit.bob:diazo_theme
You can also install spirit.bob in a virtualenv.:
$ pip install spirit.bob
You can also install the latest version of spirit.bob directly from GitHub:
$ pip install -e git://github.com/it-spirit/spirit.bob.git#egg=spirit.bob
Now you can use it like this:
$ mrbob spirit.bob:diazo_theme