Permalink
Browse files

Prepare documentation

  • Loading branch information...
1 parent dda95dc commit 859fb095f4dc313b86d5fa45c7905a212488f6af @dag committed Apr 9, 2011
Showing with 53 additions and 23 deletions.
  1. +1 −0 .gitignore
  2. +3 −0 .gitmodules
  3. +1 −0 docs/_themes
  4. +22 −0 docs/conf.py
  5. +5 −4 docs/index.rst
  6. +15 −19 flaskext/zodb.py
  7. +6 −0 setup.cfg
View
@@ -1,3 +1,4 @@
*.py?
*.swp
*.egg-info
+build/
View
@@ -0,0 +1,3 @@
+[submodule "docs/_themes"]
+ path = docs/_themes
+ url = git://github.com/mitsuhiko/flask-sphinx-themes.git
Submodule _themes added at 0269f3
View
@@ -0,0 +1,22 @@
+import sys, os
+sys.path.append(os.path.abspath('_themes'))
+
+project = u'Flask-ZODB'
+copyright = u'2011, Dag Odenhall'
+version = '0.1'
+release = '0.1dev'
+
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx']
+intersphinx_mapping = {
+ 'http://docs.python.org/': None,
+ 'http://flask.pocoo.org/docs/': None,
+ 'http://werkzeug.pocoo.org/docs/': None,
+}
+
+master_doc = 'index'
+
+html_theme_path = ['_themes']
+html_theme = 'flask_small'
+html_theme_options = {
+ 'github_fork': 'dag/flask-zodb'
+}
View
@@ -1,6 +1,10 @@
ZODB
====
+
+Links
+-----
+
* `Tutorial <http://zodb.org/documentation/tutorial.html>`_
* `Programming guide <http://zodb.org/documentation/guide/index.html>`_
* `Low-level API <http://docs.zope.org/zope3/Code/ZODB/index.html>`_
@@ -9,8 +13,5 @@ ZODB
API
---
-.. autoclass:: flaskext.zodb.ZODB
- :members: __call__
-
.. automodule:: flaskext.zodb
- :members: Model, Factory, List, Mapping, Timestamp, UUID4, current_db
+ :members:
View
@@ -117,12 +117,10 @@ class Factory(object):
class Dice(Model):
side = Factory(random.randint, 1, 6)
- ::
-
- >>> Dice()
- Dice(side=3)
- >>> Dice()
- Dice(side=5)
+ >>> Dice()
+ Dice(side=3)
+ >>> Dice()
+ Dice(side=5)
"""
@@ -158,12 +156,12 @@ class Model(Persistent):
You can subclass :class:`persistent.Persistent` directly if you prefer,
but this base provides some conviniences.
- Set attributes in instantiation::
+ Set attributes in instantiation:
- >>> Model(title='Hello!')
- Model(title='Hello!')
- >> Model(title='Hello!').title
- 'Hello!'
+ >>> Model(title='Hello!')
+ Model(title='Hello!')
+ >>> Model(title='Hello!').title
+ 'Hello!'
Declare mutable and dynamic attributes in the class definition::
@@ -172,14 +170,12 @@ class Post(Model):
posted_on = Timestamp
comments = List
- ::
-
- >>> Post()
- Post(id=UUID('c3f043a8-8f1f-4381-89b3-fd1f35265925'),
- posted_on=datetime.datetime(2010, 10, 20, 15, 42, 34, 138015),
- comments=[])
- >>> type(Post().comments)
- <class 'persistent.list.PersistentList'>
+ >>> Post()
+ Post(id=UUID('c3f043a8-8f1f-4381-89b3-fd1f35265925'),
+ posted_on=datetime.datetime(2010, 10, 20, 15, 42, 34, 138015),
+ comments=[])
+ >>> type(Post().comments)
+ <class 'persistent.list.PersistentList'>
"""
View
@@ -0,0 +1,6 @@
+[build_sphinx]
+source-dir = docs
+build-dir = build
+
+[upload_docs]
+upload-dir = build/html

0 comments on commit 859fb09

Please sign in to comment.