Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Working on a new getting started section and general doc improvments.

  • Loading branch information...
commit cb6c5c749c9af278371f9168e7db5cdc63e0f91f 1 parent 64bc52c
ironfroggy authored July 02, 2012

Showing 1 changed file with 24 additions and 4 deletions. Show diff stats Hide diff stats

  1. 28  docs/index.rst
28  docs/index.rst
Source Rendered
@@ -59,11 +59,31 @@ release some components as optional additions to your core package.
59 59
 Getting Started
60 60
 ===============
61 61
 
62  
-The easiest way to get started is to start loading existing modules or
63  
-classes with the ``straight.plugin`` loaders, which creates points where
64  
-your project can be extended by injecting new modules into that namespace.
  62
+After installing ``straight.plugin`` with ``pip install straight.plugin``,
  63
+you'll want to decide on a :term:`namespace` within your package where you'll
  64
+keep your own plugins and where other developers can add more plugins for
  65
+your package to use.
65 66
 
66  
-Read the :doc:`loaders` documentation to get started.
  67
+For example, if you're writing a log filtering library named ``logfilter`` you may
  68
+choose ``logfilter.plugins`` as a package to hold your plugins, so you'll create
  69
+the empty package as you would any other python package. However, the only
  70
+contents of ``logfilter/plugins/__init__.py`` will be a little bit of special
  71
+code telling python this is a :term:`namespace package`.
  72
+
  73
+::
  74
+
  75
+    from pkgutil import extend_path
  76
+    __path__ = extend_path(__path__, __name__)
  77
+
  78
+
  79
+Now, any modules you place in this package are plugin modules able to be loaded
  80
+by ``straight.plugin``.
  81
+
  82
+::
  83
+
  84
+    from straight.plugin import load
  85
+
  86
+    plugins = load("logfilter.plugins")
67 87
 
68 88
 
69 89
 Indices and tables

0 notes on commit cb6c5c7

Please sign in to comment.
Something went wrong with that request. Please try again.