Change the docs to not require library installation

This commit is contained in:
Jason Paryani
2013-08-18 22:20:37 -07:00
parent 3c74c5d244
commit fdb427fb5c
2 changed files with 15 additions and 42 deletions

View File

@@ -2,34 +2,3 @@
API Reference API Reference
=================== ===================
.. automodule:: capnp
.. currentmodule:: capnp
Functions
-------------
.. autofunction:: load
.. autofunction:: writeMessageToFd
.. autofunction:: writePackedMessageToFd
Readers
-------------
.. autoclass:: StreamFdMessageReader
:members:
:undoc-members:
:inherited-members:
.. autoclass:: PackedFdMessageReader
:members:
:undoc-members:
:inherited-members:
Writers
-------------
.. autoclass:: MallocMessageBuilder
:members:
:undoc-members:
:inherited-members:

View File

@@ -48,18 +48,22 @@ copyright = u'2013, Author'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
import pkg_resources def extract_version():
try: """extract version from version.py, so it's not multiply defined"""
release = pkg_resources.get_distribution('capnp').version with open(os.path.join('..', 'capnp', 'version.py')) as f:
except pkg_resources.DistributionNotFound: line = f.readline()
print 'To build the documentation, The distribution information of sandman' while not line.startswith("version"):
print 'Has to be available. Either install the package into your' line = f.readline()
print 'development environment or run "setup.py develop" to setup the' print line
print 'metadata. A virtualenv is recommended!' exec(line)
sys.exit(1) return version
del pkg_resources
version = '.'.join(release.split('.')[:2]) vs = extract_version()
# The short X.Y version.
import string
version = vs.rstrip(string.letters)
# The full version, including alpha/beta/rc tags.
release = vs
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.