PluginsTips: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==Quickstart== In the [https://gitorious.org/mediagoblin mediagoblin repository], there's a sample plugin under mediagoblin/plugins/sampleplugin that you can use to get starte...") |
No edit summary |
||
Line 5: | Line 5: | ||
# <tt>cp -r mediagoblin/plugins/sampleplugin mediagoblin/plugins/myplugin</tt> (where "myplugin" is your plugin name) |
# <tt>cp -r mediagoblin/plugins/sampleplugin mediagoblin/plugins/myplugin</tt> (where "myplugin" is your plugin name) |
||
# <tt>cp mediagoblin.ini mediagoblin_local.ini</tt> |
# <tt>cp mediagoblin.ini mediagoblin_local.ini</tt> |
||
# edit <tt>mediagoblin_local.ini</tt> and add [[mediagoblin.plugins.myplugin]] to enable your plugin |
# edit <tt>mediagoblin_local.ini</tt> and add <nowiki>[[mediagoblin.plugins.myplugin]]</nowiki> under the <nowiki>[plugins]</nowiki> section to enable your plugin |
||
Now you can look at e.g. other core or non-core plugins for inspiration. See [[Available Plugins]] for non-core plugins. |
Now you can look at e.g. other core or non-core plugins for inspiration. See [[Available Plugins]] for non-core plugins. |
Revision as of 19:35, 17 January 2014
Quickstart
In the mediagoblin repository, there's a sample plugin under mediagoblin/plugins/sampleplugin that you can use to get started with plugin creation. The simplest way to get up and running is to
- Follow HackingHowto#How_to_set_up_and_maintain_an_environment_for_hacking_with_virtualenv to set up a local mediagoblin instance
- run it with ./lazyserver.sh so you get debug output (if you run celeryd separately, you won't see logging.info from stuff run in celery tasks)
- cp -r mediagoblin/plugins/sampleplugin mediagoblin/plugins/myplugin (where "myplugin" is your plugin name)
- cp mediagoblin.ini mediagoblin_local.ini
- edit mediagoblin_local.ini and add [[mediagoblin.plugins.myplugin]] under the [plugins] section to enable your plugin
Now you can look at e.g. other core or non-core plugins for inspiration. See Available Plugins for non-core plugins.
Making an installable plugin
If you followed the steps above, you can use your plugin by copying it into the plugins folder; however, to get a plugin that is easily installable by users (e.g. with pip install myplugin), it should have a certain folder layout. A good example is the RDFa plugin.