3af2953bd930 — Oben Sonne 14 years ago
Start working on a Diggie package
4 files changed, 156 insertions(+), 0 deletions(-)

M .hgignore
A => MANIFEST.in
A => README
A => setup.py
M .hgignore +4 -0
@@ 1,2 1,6 @@ 
 \.pyc$
 ~$
+^build$
+^dist$
+^install\.log$
+^MANIFEST$

          
A => MANIFEST.in +2 -0
@@ 0,0 1,2 @@ 
+recursive-include app/diggie/templates/diggie *.html *.css
+recursive-include app/diggie/media/diggie/images *.svg *.png
  No newline at end of file

          
A => README +114 -0
@@ 0,0 1,114 @@ 
+-*- restructuredtext -*-
+
+Diggie
+======
+
+*Diggie* is a `Django`_ wiki application. While it can be integrated into every
+Django driven site, it's main use case is to run it as a local wiki
+web application. *Diggie* ships with a command line utility which automatically
+sets up a local Django site running *Diggie*::
+
+    $ diggie /path/to/wiki --init --name MyWiki
+    $ diggie /path/to/wiki --run
+
+is all you need to get your local wiki up and running.
+
+Install *Diggie* by running ``easy_install diggie`` or ``pip install diggie``.
+
+.. _Django: http://www.djangoproject.com/
+
+Using Diggie as a personal local wiki
+--------------------------------------
+
+This is easy!
+
+1.  Initialize a new wiki::
+
+        $ diggie /path/to/wiki --init --name MyWiki
+
+2.  Run::
+
+        $ diggie /path/to/wiki --run [--port 4000]
+
+3.  Point your browser to http://localhost:4000 .
+
+Run ``diggie --help`` to get some more actions and options.
+
+Structure of a local wiki
+'''''''''''''''''''''''''
+
+A new wiki at ``/path/to/wiki`` consists of the following files and directories: 
+
+- ``wiki.db``: sqlite3 database containing wiki pages
+- ``templates/diggie``: symbolic link, just ignore this for now
+- ``media/diggie``: symbolic link, just ignore this for now
+- ``media/images``: image links refer to files located here 
+- ``media/math``: used to store rendered formula images
+       
+That is you can easily share you wiki across multiple computers using
+services like *UbuntuOne* or *DropBox*.
+
+Using Diggie in a Django powered site
+----------------------------------------
+
+For a simple example, have a look into the Django site projects created by
+the tool *diggie* for local wikis.
+
+The concrete steps depend on the site project but basically it works as
+follows:
+
+1.  Add ``diggie`` to ``INSTALLED_APPS`` in the project's ``settings.py``.
+
+2.  Create a symbolic link ``diggie`` in the project's template directory
+    pointing to ``/path/to/diggie-python-module/templates/diggie``.
+
+3.  Create a symbolic link ``diggie`` in the project's ``MEDIA_ROOT`` pointing
+    to ``/path/to/diggie-python-module/media/diggie``.
+
+4.  Set *Diggie* specific options  in the projects ``settings.py``:
+
+    +---------------------+--------------+------------------------------------+
+    | Setting             | Default      | Description                        |
+    +=====================+==============+====================================+
+    | ``DIGGIE_WIKINAME`` | ``"Diggie"`` | Name of the wiki.                  |
+    +---------------------+--------------+------------------------------------+
+    | ``DIGGIE_MEDIA``    | ``""``       | Path relative to ``MEDIA_ROOT``    |
+    |                     |              | (and ``MEDIA_URL``) to use for wiki|
+    |                     |              | content files (e.g. images). Must  |
+    |                     |              | use *slashes*! The server needs    |
+    |                     |              | write access to                    |
+    |                     |              | ``MEDIA_ROOT/DIGGIE_MEDIA/math``   |
+    |                     |              | for saving rendered math images.   |
+    +---------------------+--------------+------------------------------------+
+    | ``DIGGIE_MDX``      | ``[]``       | List of additional or custom       |
+    |                     |              | markdown extensions.               |
+    +---------------------+--------------+------------------------------------+
+
+5.  Adjust your ``urls.py``, for instance::
+
+        urlpatterns = patterns('',
+            ...
+            (r'diggie/^', include('diggie.urls')),
+        )
+
+6.  Sync the project's database::
+
+        $ python manage.py syncdb
+
+Finished.
+
+Import and export
+-----------------
+
+The command line tool *diggie* can be used to import or export pages into or
+from a *Diggie* wiki.
+
+TODO
+
+Changes
+=======
+
+Version 0.1
+-----------
+
+- Initial release
  No newline at end of file

          
A => setup.py +36 -0
@@ 0,0 1,36 @@ 
+from __future__ import with_statement
+
+from distutils.core import setup
+import os.path
+
+README = os.path.join(os.path.dirname(__file__), 'README')
+
+with open(README) as fp:
+    longdesc = fp.read()
+    longdesc = longdesc.replace("-*- restructuredtext -*-\n", "")
+
+setup(name='diggie',
+      version='0.1',
+      description='Django',
+      long_description=longdesc,
+      classifiers=[
+            'Development Status :: 4 - Beta',
+            'License :: OSI Approved :: MIT License',
+            'Operating System :: OS Independent',
+            'Programming Language :: Python',
+            'Framework :: Django',
+            'Topic :: Documentation',
+            'Intended Audience :: End Users/Desktop',
+            'Intended Audience :: System Administrators'
+      ],
+      author='Oben Sonne',
+      author_email='obensonne@googlemail.com',
+      license='MIT License',
+      url='http://bitbucket.org/obensonne/diggie',
+      packages=['diggie'],
+      package_dir={'': 'app'},
+      package_data={'diggie': ['templates/diggie/*', 'media/diggie/images/*',
+                               'templatetags/*.py']},
+      scripts=["diggie"],
+      requires=["django(>=1.2)"],
+     )