Changes between Version 12 and Version 13 of EggCookingTutorial/BasicEggCooking
- Timestamp:
- Oct 1, 2005, 12:48:34 AM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EggCookingTutorial/BasicEggCooking
v12 v13 1 1 = Egg cooking = 2 2 3 Since Trac 0.9 it has been possible to write plugins for Trac to extend Trac functionality. Even better, you can deploy plugins as [http://peak.telecommunity.com/DevCenter/PythonEggs Python eggs] that really makes plugin development fun.3 Since Trac 0.9 it has been possible to write plugins for Trac to extend Trac functionality. Even better, you can deploy plugins as [http://peak.telecommunity.com/DevCenter/PythonEggs Python eggs] that really makes plugin development fun and easy. 4 4 5 This tutorial shows how to make an egg, successfully load an egg in Trac and in advanced topicshow to serve templates and static content from an egg.5 This tutorial shows how to make an egg, and load an egg in Trac. In the advanced parts you'll learn how to serve templates and static content from an egg. 6 6 7 You should be familiar with [trac:TracDev/ComponentArchitecture component architecture] and [trac:TracDev/PluginDevelopment plugin development]. This plugin is based on example in the plugin development article. Here we extend it a bit further.7 You should be familiar with [trac:TracDev/ComponentArchitecture component architecture] and [trac:TracDev/PluginDevelopment plugin development]. This plugin is based on the example in the plugin development article. Here we extend it a bit further. 8 8 9 9 == Required items == … … 15 15 == Directories == 16 16 17 To develop a plugin you need to create few directories to keep things together.17 To develop a plugin you need to create a few directories to keep things together. 18 18 19 19 So let's create following directories: … … 26 26 == Main plugin == 27 27 28 The first step is to generate the main module for this plugin. We will construct a simple plugin that will display "Hello world!" on the screen when accessed through/helloworld URL. The plugin also provides a "Hello" button that is, by default, rendered on the far right in the main navigation bar.28 The first step is to generate the main module for this plugin. We will construct a simple plugin that will display "Hello world!" on the screen when accessed through the /helloworld URL. The plugin also provides a "Hello" button that is, by default, rendered on the far right in the main navigation bar. 29 29 30 30 So create ''helloworld.py'' in ''./helloworld-plugin/helloworld/'': … … 63 63 == Make it a module == 64 64 65 To make the plugin a module, you simply create that magic''_''____''_init_''____''_.py'' in ''./helloworld-plugin/helloworld/'':65 To make the plugin a module, you simply create an ''_''____''_init_''____''_.py'' in ''./helloworld-plugin/helloworld/'': 66 66 {{{ 67 67 #!python … … 98 98 == Aftermath == 99 99 100 Now you have successfully created your first egg. You can continue by reading [wiki:EggCookingTutorial/AdvancedEggCooking EggCookingTutorial/AdvancedEggCooking] to learn how to use Trac in your plugins.100 Now you have successfully created your first egg. You can continue by reading [wiki:EggCookingTutorial/AdvancedEggCooking EggCookingTutorial/AdvancedEggCooking] to learn how to use templates in your plugins, and make its output look like other Trac pages.