z3c.* Tutorial – ZRT Resources
After a long wait, I finally updated the z3c tutorial. I added a section on using z3c.zrtresource, which lets you create css or javascript files with a very minimal amount of dynamic content. Included with that is a quick overview of viewlet customization. Here is the outline of the additional sections:
- 6 z3c.zrtresource and CSS Viewlets
- 6.1 Using z3c.zrtresource
- 6.1.1 Dependencies
- 6.1.2 Using the zrt-resource Directive
- 6.1.3 String Replacement with zrt-resource
- 6.2 Viewlets for CSS Styles
- 6.2.1 Creating the Viewlet Manager
- 6.2.2 Custom Layout Caveat
- 6.2.3 Viewlet Customization
- 6.1 Using z3c.zrtresource
I actually wrote most of the new content a while ago but held off on publishing it because I wanted to simplify the process of using resource viewlets. At one point I actually wrote some code that made the whole thing simpler, but I never had time to finish and formalize it, let alone release it and everything. Now that I realize just how little time I had to invest, I just decided to publish the new stuff anyways, and hope it’s not too hard. I also added some links to the top of the tutorial for the French translation, the Launchpad Project Page, and even an Atom Feed for (unpublished) changes to the tutorial.
Finally, while at PyCon08 in Chicago, I hacked together a ReStructured Text Directive for generating an index of a document. So now there is an index at the end of the tutorial! Hopefully one day I will make the index look a bit more proper, and release the rst directive plugin as an actual piece of software, since it seems to be of general use to people. In case anyone feels like volunteering, the code is here.