Commits

James Taylor committed 552b9aa

Added sphinx documentation skelaton from Istvan Albert. Modified styles to match bx.mathcs.emory.edu. Added support for sphinx to setup.py. Created a shortcut build_docs to build both API and sphinc documentation.

Comments (0)

Files changed (13)

 
 # Object files
 *.so
+*.pyd
 
 # egg-info for inplace builds
 bx_python.egg-info
 
 # IDE project files
 *.kpf
+
+# windows shortcuts
+*.lnk
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d build/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+.PHONY: help clean html web pickle htmlhelp latex changes linkcheck
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html      to make standalone HTML files"
+	@echo "  apidoc    to run epydoc" 
+	@echo "  pickle    to make pickle files"
+	@echo "  json      to make JSON files"
+	@echo "  htmlhelp  to make HTML files and a HTML help project"
+	@echo "  latex     to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  changes   to make an overview over all changed/added/deprecated items"
+	@echo "  linkcheck to check all external links for integrity"
+
+clean:
+	-rm -rf docbuild/*
+
+html:
+	mkdir -p build/html build/doctrees
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) docbuild/html
+	@echo
+	@echo "Build finished. The HTML pages are in docbuild/html."
+
+apidoc:
+	mkdir -p build/html/apidoc
+	epydoc --docformat restructuredtext ../lib/bx -o docbuild/html/apidoc
+	@echo
+	@echo "Epydoc finished. The pages are in docbuild/html/apidoc."
+
+
+pickle:
+	mkdir -p build/pickle build/doctrees
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) docbuild/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+web: pickle
+
+json:
+	mkdir -p build/json build/doctrees
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) docbuild/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+	mkdir -p build/htmlhelp build/doctrees
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) docbuild/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in build/htmlhelp."
+
+latex:
+	mkdir -p build/latex build/doctrees
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) docbuild/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in build/latex."
+	@echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \
+	      "run these through (pdf)latex."
+
+changes:
+	mkdir -p build/changes build/doctrees
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) docbuild/changes
+	@echo
+	@echo "The overview file is in build/changes."
+
+linkcheck:
+	mkdir -p build/linkcheck build/doctrees
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) docbuild/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in build/linkcheck/output.txt."
+# -*- coding: utf-8 -*-
+#
+# BxPython documentation build configuration file, created by
+# sphinx-quickstart on Fri May 08 10:18:22 2009.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# The contents of this file are pickled, so don't put values in the namespace
+# that aren't pickleable (module imports are okay, they're removed automatically).
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If your extensions are in another directory, add it here. If the directory
+# is relative to the documentation root, use os.path.abspath to make it
+# absolute, like shown here.
+#sys.path.append(os.path.abspath('.'))
+curr_dir = os.path.dirname( __file__ )
+bx_dir = os.path.join( curr_dir, '..', '..', 'lib')
+sys.path.insert( 0, bx_dir )
+import bx
+
+# General configuration
+# ---------------------
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'bx-python'
+copyright = u'2009, James Taylor'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = bx.__version__
+
+# The full version, including alpha/beta/rc tags.
+release = version
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of documents that shouldn't be included in the build.
+#unused_docs = []
+
+# List of directories, relative to source directory, that shouldn't be searched
+# for source files.
+exclude_trees = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+
+# Options for HTML output
+# -----------------------
+
+# The style sheet to use for HTML and HTML Help pages. A file of that name
+# must exist either in Sphinx' static/ path, or in one of the custom paths
+# given in html_static_path.
+html_style = 'base.css'
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+html_index = 'index.html'
+html_sidebars = { 'index': 'indexsidebar.html'}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+html_additional_pages = {
+    'index': 'index.html',
+}
+
+# If false, no module index is generated.
+#html_use_modindex = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, the reST sources are included in the HTML build as _sources/<name>.
+#html_copy_source = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = ''
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'bx-doc'
+
+
+# Options for LaTeX output
+# ------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, document class [howto/manual]).
+latex_documents = [
+  ('index', 'bx-python.tex', ur'bx-python Documentation',
+   ur'James Taylor', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_use_modindex = True
+
+
+# Example configuration for intersphinx: refer to the Python standard library.
+#intersphinx_mapping = {'http://docs.python.org/dev': None}

doc/source/contents.rst

+
+
+bx-python documentation contents
+================================
+
+Browse the Python API `class documentation <apidoc/index.html>`_ 
+
+Contents:
+
+.. toctree::
+    :maxdepth: 3
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+
+.. BxPython documentation master file, created by sphinx-quickstart on Fri May 08 10:18:22 2009.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to bx-python's documentation
+====================================
+
+Contents:
+
+.. toctree::
+   :maxdepth: 2
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
+

doc/source/static/base.css

+@import url(tripoli.base.css);
+
+html {
+    font-family: 'Verdana', sans-serif;
+    color: #333333;
+}
+body {
+    padding: 3em 3em;
+}
+
+h1.pageheader {
+    font-variant: small-caps;
+    margin-top: 0;
+    border-top: solid 1px;
+    padding-top: 2px;
+    border-bottom: solid 1px;
+    border-color: #CCCCCC;
+    margin-bottom: 1em;
+}
+
+h1.pageheader a {
+    color: inherit;
+    text-decoration: inherit;
+    border: none;
+}
+
+.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
+    font-family: 'Hoefler Text', 'Georgia', serif;
+    font-weight: normal;
+    color: #666666;
+    /* border-bottom: solid #666666 1px; */
+}
+
+.content h1.pagetitle {
+    color: #c33;
+}
+
+#main {
+}
+
+.colpad {
+    padding: 0 2em;
+}
+
+#main > .inner {
+    min-width: 70em;
+    max-width: 90em;
+    margin: auto;
+    height: 100%;
+}
+
+#left {
+    background: white;
+    margin-right: 36%; /* 31em; */
+    padding-right: 3%;
+    height: 100%;
+}
+
+#right {
+    float: right;
+    width: 33%; /* 28em; */
+    padding-left: 3%; 
+    border-left: solid #CCCCCC 1px;
+}
+
+.sidebar {
+    font-size: 1em;
+}
+
+.sidebar ul {
+    margin-left: 0;
+}
+
+.sidebar ul li {
+    list-style-type: none;
+    margin-bottom: 0.6em;
+}
+
+.sidebar ul.pages {
+    margin-left: 5px;
+    margin-top: 0.6em;
+}
+
+.sidebar ul.pages li {
+    background: url(hbullet.png) 0 0.4em no-repeat;
+    padding-left: 25px;
+    list-style-type: none;
+}
+
+.sidebar ul.pages li {
+}
+
+.sidebar h1 {
+    clear: both;
+}
+
+.sidebar .publications .info {
+    color: #666666;
+}
+
+.postinfo {
+    color: #666666;
+    font-size: 92%;
+    margin-top: -1em;
+}
+
+.postreadlink {
+    margin-top: -1em;
+}
+
+.sidebar .posts .info {
+    color: #666666;
+}
+
+.comments_title {
+    margin-top: 2em;
+}
+
+label {
+    display: block;
+}
+
+#footer {
+    clear: both;
+}
+
+a, a:link, a:visited {
+    text-decoration: none;
+    border-bottom: dotted #666666 1px;
+    color: black;
+}
+
+a:hover {
+ color: #CC3333;
+}
+
+li {
+    list-style: square;
+}
+
+table.layout td {
+    vertical-align: top;
+    padding-left: 2em;
+    padding-right: 2em;
+    border-left: solid #999999 1px
+}
+
+hr {
+    border: none;
+    height: 1px;
+    background: #999999; 
+}	

doc/source/static/tripoli.base.css

+/*
+ *   Tripoli is a generic CSS standard for HTML rendering. 
+ *   Copyright (C) 2007 David Hellsing
+ *   
+ *   http://devkick.com/lab/tripoli/
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+**/
+
+/*
+_______________________________
+RESET */
+
+*
+{
+	text-decoration:none;
+	font-size:1em;
+	outline:none;
+	margin:0;
+	padding:0;
+}
+
+code,kbd,samp,pre,tt,var,textarea,input,select,isindex,listing,xmp,plaintext
+{
+	font:inherit;
+	white-space:normal;
+}
+
+a,img,a img,iframe,form,abbr,acronym,object,applet,table,a abbr,a acronym
+{
+	border-width:0;
+}
+
+dfn,i,cite,var,address,em
+{
+	font-style:normal;
+}
+
+th,b,strong,h1,h2,h3,h4,h5,h6,dt
+{
+	font-weight:normal;
+}
+
+caption,th,td
+{
+	text-align:left;
+}
+
+html
+{
+	background:white;
+	color:black;
+	line-height:1;
+	font-family:arial, sans-serif;
+}
+
+/* \*/
+
+html
+{
+	font-family:sans-serif;
+}
+
+/* */
+
+q
+{
+	quotes:"\201C""\201D""\2018""\2019";
+}
+
+ul,ol,dir,menu
+{
+	list-style:none;
+}
+
+sub,sup
+{
+	vertical-align:baseline;
+}
+
+a
+{
+	color:inherit;
+}
+
+/*
+_______________________________
+DISABLE DEPRECATED HTML */
+
+font,basefont
+{
+	color:inherit;
+	font:inherit;
+	font-size:100%;
+}
+
+
+center,*[align]
+{
+	text-align:inherit;
+}
+
+s,strike,u
+{
+	text-decoration:inherit;
+}
+
+img
+{
+	border:none;
+	margin:0;
+}
+
+ol
+{
+	list-style-type:decimal;
+}
+
+body
+{
+	background-color:transparent;
+}
+
+tr,th,td
+{
+	width:auto;
+	height:auto;
+	background-color:transparent;
+	vertical-align:inherit;
+	border:none;
+}
+
+table[border],.content table[border]
+{
+	border-collapse:separate;
+	border-spacing:0;
+}
+
+nobr
+{
+	white-space:normal;
+}
+
+marquee
+{
+	overflow:visible;
+	-moz-binding:none;
+}
+
+blink
+{
+	text-decoration:none;
+}
+
+/*
+_______________________________
+GENERAL */
+
+html
+{
+	font-size:125%;
+}
+
+body
+{
+	font-size:50%;
+}
+
+a
+{
+	text-decoration:underline;
+}
+
+strong,th,thead td,h1,h2,h3,h4,h5,h6,dt
+{
+	font-weight:bold;
+}
+
+cite,em,dfn
+{
+	font-style:italic;
+}
+
+code,kbd,samp,pre,tt,var,input[type='text'],input[type='password'],textarea
+{
+	font-size:100%;
+	font-family:mono-space,monospace;
+}
+
+pre
+{
+	white-space:pre;
+}
+
+pre *
+{
+	font-size:100%;
+	white-space:pre;
+}
+
+del
+{
+	text-decoration:line-through;
+}
+
+ins,dfn
+{
+	border-bottom:1px solid black;
+}
+
+small,sup,sub
+{
+	font-size:85%;
+}
+
+big
+{
+	font-size:125%;
+	line-height:80%;
+}
+
+abbr,acronym
+{
+	text-transform:uppercase;
+	font-size:85%;
+	letter-spacing:.1em;
+}
+
+abbr[title],acronym[title],dfn[title]
+{
+	cursor:help;
+	border-bottom:1px dotted black;
+}
+
+sup
+{
+	vertical-align:super;
+}
+
+sub
+{
+	vertical-align:sub;
+}
+
+blockquote
+{
+	padding-left:2.2em;
+}
+
+hr
+{
+	display:none; /* We will re-reset it later for content */
+}
+
+:lang(af),:lang(nl),:lang(pl)
+{
+	quotes:'\201E' '\201D' '\201A' '\2019';
+}
+
+:lang(bg),:lang(cs),:lang(de),:lang(is),:lang(lt),:lang(sk),:lang(sr),:lang(ro)
+{
+	quotes:'\201E' '\201C' '\201A' '\2018';
+}
+
+:lang(da),:lang(hr)
+{
+	quotes:'\00BB' '\00AB' '\203A' '\2039';
+}
+
+:lang(el),:lang(es),:lang(sq),:lang(tr)
+{
+	quotes:'\00AB' '\00BB' '\2039' '\203A';
+}
+
+:lang(en-GB)
+{
+	quotes:'\2018' '\2019' '\201C' '\201D';
+}
+
+:lang(fi),:lang(sv)
+{
+	quotes:'\201D' '\201D' '\2019' '\2019';
+}
+
+:lang(fr)
+{
+	quotes:'\ab\2005' '\2005\bb' '\2039\2005' '\2005\203a';
+}
+
+*[lang|='en'] q:before
+{
+	content:'\201C';
+}
+
+*[lang|='en'] q:after
+{
+	content:'\201D';
+}
+
+*[lang|='en'] q q:before
+{
+	content:'\2018';
+}
+
+*[lang|='en'] q q:after
+{
+	content:'\2019';
+}
+
+input,select,button
+{
+	cursor:pointer;
+}
+
+input[type='text'],input[type='password']
+{
+	cursor:text;
+}
+
+input[type='hidden']
+{
+	display:none;
+}
+
+/*
+_______________________________
+CONTENT */
+
+.content
+{
+	font-size:1.2em;
+	line-height:1.6em;
+}
+
+.content h1
+{
+	font-size:1.6em;
+	line-height:1;
+	margin:1em 0 .5em;
+}
+
+.content h2
+{
+	font-size:1.5em;
+	line-height:1;
+	margin:1.07em 0 .535em;
+}
+
+.content h3
+{
+	font-size:1.4em;
+	line-height:1;
+	margin:1.14em 0 .57em;
+}
+
+.content h4
+{
+	font-size:1.3em;
+	line-height:1;
+	margin:1.23em 0 .615em;
+}
+
+.content h5
+{
+	font-size:1.2em;
+	line-height:1;
+	margin:1.33em 0 .67em;
+}
+
+.content h6
+{
+	font-size:1em;
+	line-height:1;
+	margin:1.6em 0 .8em;
+}
+
+.content hr
+{
+	display:block;
+	background:black;
+	color:black;
+	width:100%;
+	height:1px;
+	border:none;
+}
+
+.content ul
+{
+	list-style:disc outside;
+}
+
+.content ol
+{
+	list-style:decimal outside;
+}
+
+.content table
+{
+	border-collapse:collapse;
+}
+
+.content hr,.content p,.content ul,.content ol,.content dl,.content pre, .content address,.content table,.content form
+{
+	margin-bottom:1.6em;
+}
+
+.content p+p
+{
+	margin-top:-.8em;
+}
+
+.content fieldset
+{
+	margin:1.6em 0;
+	padding:1.6em;
+}
+
+/* \*/
+
+.content legend
+{
+	padding-left:.8em;
+	padding-right:.8em;
+}
+
+/* */
+
+@media all and (min-width: 0px) /* for Opera 8 */
+{ 
+	.content legend
+	{
+		margin-bottom:1.6em;
+	}
+	.content fieldset
+	{
+		margin-top:0;
+	}
+	.content[class^='content'] fieldset
+	{
+		margin-top:1.6em;
+	}
+}
+
+.content fieldset>*:first-child
+{
+	margin-top:0;
+}
+
+.content textarea,.content input[type='text']
+{
+	padding:.1em .2em;
+}
+
+.content input
+{
+	padding:.2em .1em;
+}
+
+.content select
+{
+	padding:.2em .1em 0;
+}
+
+.content select[multiple]
+{
+	margin-bottom:.8em;
+}
+
+.content option
+{
+	padding:0 .4em .1em;
+}
+
+.content button
+{
+	padding:.3em .5em;
+}
+
+.content input[type='radio']
+{
+	position:relative;
+	bottom:-.2em;
+}
+
+.content dt
+{
+	margin-top:.8em;
+	margin-bottom:.4em;
+}
+
+.content ul,.content ol
+{
+	margin-left:2.2em;
+}
+
+.content caption,.content form div
+{
+	padding-bottom:.8em;
+}
+
+.content ul ul,content ol ul,.content ul ol,content ol ol
+{
+	margin-bottom:0;
+}
+
+/*
+_______________________________
+END */

doc/source/templates/index.html

+{% extends "layout.html" %}
+{% set title = 'bx python' %}
+{% block body %}
+  <h1>Welcome</h1>
+
+  <p>
+    
+    The <b>bx-python</b> project is a python library and associated set of scripts to allow for rapid implementation of genome scale analyses. The library contains a variety of useful modules, but the particular strengths are:
+
+    <ul>
+      <li>Classes for reading and working with genome-scale multiple local alignments (in MAF, AXT, and LAV formats)</li>
+     <li>Generic data structure for indexing on disk files that contain blocks of data associated with intervals on various sequences (used, for example, to provide random access to individual alignments in huge files; optomized for use over network filesystems)
+     </li>
+     <li>Data structures for working with intervals on sequences</li>
+     <li>"Binned bitsets" which act just like chromosome sized bit arrays, but lazily allocate regions and allow large blocks of all set or all unset bits to be stored compactly</li>
+     <li>"Intersecter" for performing fast intersection tests that preserve both query and target intervals and associated annotation </li>
+
+      These tools have been used in a variety of published research, and are a fundamental part of the ongoing Galaxy and ESPERR projects.
+      
+    </ul>
+    
+  </p>
+
+  <p> 
+    Browse the Python <a href="apidoc/index.html">API documentation</a>
+  </p>
+
+{% endblock %}

doc/source/templates/indexsidebar.html

+<h3>About bx-python</h3>
+
+<p>Current version: <b>{{ version }}</b></p>
+
+<h3>Download</h3>
+
+<p align="center">
+  <a href="http://bitbucket.org/james_taylor/bx-python">bx-python source</a>
+</p>

doc/source/templates/layout.html

+{% extends "!layout.html" %}
+
+{%- block document %}
+    <div id="main">
+        <div class="inner">
+            <div id="title" class="content">
+                <h1 class="pageheader">
+                    <a href="{{pathto('index')}}">bx-python</a>
+                </h1>
+            </div>	
+            <div id="right">
+                <div class="content secondary sidebar">
+                    {{ relbar() }}
+                    {{ sidebar() }}
+                </div>
+            </div>
+            <div id="left" class="document">
+                <div class="documentwrapper">
+                    {%- if builder != 'htmlhelp' %}
+                      <div class="bodywrapper">
+                    {%- endif %}
+                    <div class="body content">
+                        {% block body %} {% endblock %}
+                    </div>
+                    {%- if builder != 'htmlhelp' %}
+                      </div>
+                    {%- endif %}
+                </div>
+            </div>
+        </div>
+    </div>
+{%- endblock %}
+
+{% block doctype %}
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+{% endblock %}
+
+{% block rootrellink %}
+        <li><a href="{{ pathto('index') }}">bx-python home</a></li>
+        <li><a href="{{ pathto('contents') }}">Table of contents</a></li>
+{% endblock %}
+
+{# Sidebar and already handled #}
+
+{% block relbar1 %}{% endblock %}
+{% block relbar2 %}{% endblock %}
+
+{% block sidebar1 %}{% endblock %}
+{% block sidebar2 %}{% endblock %}
+
+{% block footer %}{% endblock %}
 """
 Shamelessly ripped off of py.std
 """
+__version__ = '0.5.0'
 
 class Std( object ):
     def __init__( self ):
 [aliases]
 snapshot = egg_info -rb_DEV bdist_egg rotate -m.egg -k1
 test = nosetests
+build_docs = build_sphinx build_apidocs
 
 [nosetests]
 tests=script_tests/
 detailed-errors=0
 with-doctest=1
 doctest-extension=pyx
+
+[build_sphinx]
+source-dir = doc/source
+build-dir  = doc/docbuild
+all_files  = 1
             old_argv = sys.argv
             old_cwd = os.getcwd()
             # Build command line for Epydoc
-            sys.argv = """epydoc.py bx --html --output=../apidocs/lib --verbose
+            sys.argv = """epydoc.py bx --html --output=../doc/docbuild/html/apidoc --verbose
                           --simple-term --docformat=reStructuredText""".split()
             # Make output directory
-            if not os.path.exists( "./apidocs" ):
-                os.mkdir( "./apidocs" )
+            if not os.path.exists( "./doc/docbuild/html/apidoc" ):
+                os.mkdir( "./doc/docbuild/html/apidoc" )
             # Move to lib directory (so bx package is in current directory)
             os.chdir( "./lib" )
             # Invoke epydoc