Permalink
Browse files

add documentation generation

  • Loading branch information...
1 parent 3372ce9 commit 016805d14af5c176d7533056104ba135e30caa8b @benoitc benoitc committed Nov 11, 2012
Showing with 30,592 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +1 −0 docs/CNAME
  3. +163 −0 docs/Makefile
  4. +137 −0 docs/ghp-import
  5. +190 −0 docs/make.bat
  6. +1 −0 docs/site/CNAME
  7. +444 −0 docs/site/docs/api-basics.html
  8. +125 −0 docs/site/docs/api/authn.html
  9. +358 −0 docs/site/docs/api/configuration.html
  10. +1,504 −0 docs/site/docs/api/database.html
  11. +78 −0 docs/site/docs/api/dbmaint.html
  12. +1,246 −0 docs/site/docs/api/design.html
  13. +934 −0 docs/site/docs/api/documents.html
  14. +255 −0 docs/site/docs/api/local.html
  15. +1,040 −0 docs/site/docs/api/misc.html
  16. +168 −0 docs/site/docs/api/reference.html
  17. +373 −0 docs/site/docs/changes.html
  18. +110 −0 docs/site/docs/commonjs.html
  19. +569 −0 docs/site/docs/config_reference.html
  20. +135 −0 docs/site/docs/configuring.html
  21. +78 −0 docs/site/docs/ddocs.html
  22. +95 −0 docs/site/docs/errors.html
  23. +72 −0 docs/site/docs/genindex.html
  24. +141 −0 docs/site/docs/http-proxying.html
  25. +188 −0 docs/site/docs/index.html
  26. +315 −0 docs/site/docs/intro.html
  27. +970 −0 docs/site/docs/json-structure.html
  28. +11 −0 docs/site/docs/objects.inv
  29. +104 −0 docs/site/docs/os-daemons.html
  30. +122 −0 docs/site/docs/range.html
  31. +102 −0 docs/site/docs/release.html
  32. +394 −0 docs/site/docs/replication.html
  33. +92 −0 docs/site/docs/search.html
  34. +1 −0 docs/site/docs/searchindex.js
  35. +459 −0 docs/site/docs/sources/api-basics.txt
  36. +41 −0 docs/site/docs/sources/api/authn.txt
  37. +297 −0 docs/site/docs/sources/api/configuration.txt
  38. +1,463 −0 docs/site/docs/sources/api/database.txt
  39. +15 −0 docs/site/docs/sources/api/dbmaint.txt
  40. +1,264 −0 docs/site/docs/sources/api/design.txt
  41. +931 −0 docs/site/docs/sources/api/documents.txt
  42. +169 −0 docs/site/docs/sources/api/local.txt
  43. +805 −0 docs/site/docs/sources/api/misc.txt
  44. +28 −0 docs/site/docs/sources/api/reference.txt
  45. +299 −0 docs/site/docs/sources/changes.txt
  46. +56 −0 docs/site/docs/sources/commonjs.txt
  47. +288 −0 docs/site/docs/sources/config_reference.txt
  48. +95 −0 docs/site/docs/sources/configuring.txt
  49. +19 −0 docs/site/docs/sources/ddocs.txt
  50. +37 −0 docs/site/docs/sources/errors.txt
  51. +94 −0 docs/site/docs/sources/http-proxying.txt
  52. +48 −0 docs/site/docs/sources/index.txt
  53. +309 −0 docs/site/docs/sources/intro.txt
  54. +606 −0 docs/site/docs/sources/json-structure.txt
  55. +50 −0 docs/site/docs/sources/os-daemons.txt
  56. +72 −0 docs/site/docs/sources/range.txt
  57. +47 −0 docs/site/docs/sources/release.txt
  58. +383 −0 docs/site/docs/sources/replication.txt
  59. +109 −0 docs/site/docs/sources/ssl.txt
  60. +148 −0 docs/site/docs/ssl.html
  61. BIN docs/site/docs/static/ajax-loader.gif
  62. BIN docs/site/docs/static/alert_info_32.png
  63. BIN docs/site/docs/static/alert_warning_32.png
  64. +540 −0 docs/site/docs/static/basic.css
  65. BIN docs/site/docs/static/bg-page.png
  66. BIN docs/site/docs/static/bullet_orange.png
  67. BIN docs/site/docs/static/comment-bright.png
  68. BIN docs/site/docs/static/comment-close.png
  69. BIN docs/site/docs/static/comment.png
  70. +247 −0 docs/site/docs/static/doctools.js
  71. BIN docs/site/docs/static/down-pressed.png
  72. BIN docs/site/docs/static/down.png
  73. BIN docs/site/docs/static/file.png
  74. +371 −0 docs/site/docs/static/haiku.css
  75. +154 −0 docs/site/docs/static/jquery.js
  76. BIN docs/site/docs/static/minus.png
  77. BIN docs/site/docs/static/plus.png
  78. +62 −0 docs/site/docs/static/pygments.css
  79. +560 −0 docs/site/docs/static/searchtools.js
  80. +23 −0 docs/site/docs/static/underscore.js
  81. BIN docs/site/docs/static/up-pressed.png
  82. BIN docs/site/docs/static/up.png
  83. +808 −0 docs/site/docs/static/websupport.js
  84. BIN docs/site/favicon.ico
  85. BIN docs/site/images/epub-icon.png
  86. BIN docs/site/images/futon-createdb.png
  87. BIN docs/site/images/futon-editdoc.png
  88. BIN docs/site/images/futon-editeddoc.png
  89. BIN docs/site/images/futon-overview.png
  90. BIN docs/site/images/futon-replform.png
  91. BIN docs/site/images/screenshot_rcouchx.png
  92. +166 −0 docs/site/index.html
  93. +17 −0 docs/site/javascripts/scale.fix.js
  94. +1 −0 docs/site/params.json
  95. +69 −0 docs/site/stylesheets/pygment_trac.css
  96. +255 −0 docs/site/stylesheets/styles.css
  97. +459 −0 docs/source/api-basics.rst
  98. +41 −0 docs/source/api/authn.rst
  99. +297 −0 docs/source/api/configuration.rst
  100. +1,463 −0 docs/source/api/database.rst
  101. +15 −0 docs/source/api/dbmaint.rst
  102. +1,264 −0 docs/source/api/design.rst
  103. +931 −0 docs/source/api/documents.rst
  104. +169 −0 docs/source/api/local.rst
  105. +805 −0 docs/source/api/misc.rst
  106. +28 −0 docs/source/api/reference.rst
  107. +299 −0 docs/source/changes.rst
  108. +56 −0 docs/source/commonjs.rst
  109. +299 −0 docs/source/conf.py
  110. +288 −0 docs/source/config_reference.rst
  111. +95 −0 docs/source/configuring.rst
  112. +19 −0 docs/source/ddocs.rst
  113. +37 −0 docs/source/errors.rst
  114. +94 −0 docs/source/http-proxying.rst
  115. +48 −0 docs/source/index.rst
  116. +309 −0 docs/source/intro.rst
  117. +606 −0 docs/source/json-structure.rst
  118. +50 −0 docs/source/os-daemons.rst
  119. +72 −0 docs/source/range.rst
  120. +47 −0 docs/source/release.rst
  121. +383 −0 docs/source/replication.rst
  122. +109 −0 docs/source/ssl.rst
  123. +384 −0 docs/sphinxtogithub.py
  124. BIN docs/sphinxtogithub.pyc
View
@@ -19,6 +19,10 @@ build-aux
*.sw*
*.gz
+#doc
+
+docs/build
+
# relase
rel/rcouch
dev
View
@@ -0,0 +1 @@
+rcouch.org
View
@@ -0,0 +1,163 @@
+# Makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+PAPER =
+BUILDDIR = build
+
+# Internal variables.
+PAPEROPT_a4 = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+# the i18n builder cannot share the environment and doctrees with the others
+I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+
+# Custom
+GH_PAGES_SOURCES = source code libuv Makefile
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext gh-pages
+
+help:
+ @echo "Please use \`make <target>' where <target> is one of"
+ @echo " html to make standalone HTML files"
+ @echo " dirhtml to make HTML files named index.html in directories"
+ @echo " singlehtml to make a single large HTML file"
+ @echo " pickle to make pickle files"
+ @echo " json to make JSON files"
+ @echo " htmlhelp to make HTML files and a HTML help project"
+ @echo " qthelp to make HTML files and a qthelp project"
+ @echo " devhelp to make HTML files and a Devhelp project"
+ @echo " epub to make an epub"
+ @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+ @echo " latexpdf to make LaTeX files and run them through pdflatex"
+ @echo " text to make text files"
+ @echo " man to make manual pages"
+ @echo " texinfo to make Texinfo files"
+ @echo " info to make Texinfo files and run them through makeinfo"
+ @echo " gettext to make PO message catalogs"
+ @echo " changes to make an overview of all changed/added/deprecated items"
+ @echo " linkcheck to check all external links for integrity"
+ @echo " doctest to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+ @rm -rf $(BUILDDIR)/*
+ @rm -rf site/docs
+
+
+html:
+ $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:
+ $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+ @echo
+ @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:
+ $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+ @echo
+ @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:
+ $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+ @echo
+ @echo "Build finished; now you can process the pickle files."
+
+json:
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+ @echo
+ @echo "Build finished; now you can process the JSON files."
+
+htmlhelp:
+ $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+ @echo
+ @echo "Build finished; now you can run HTML Help Workshop with the" \
+ ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:
+ $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+ @echo
+ @echo "Build finished; now you can run "qcollectiongenerator" with the" \
+ ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+ @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/AnIntroductiontolibuv.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/AnIntroductiontolibuv.qhc"
+
+devhelp:
+ $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+ @echo
+ @echo "Build finished."
+ @echo "To view the help file:"
+ @echo "# mkdir -p $$HOME/.local/share/devhelp/AnIntroductiontolibuv"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/AnIntroductiontolibuv"
+ @echo "# devhelp"
+
+epub:
+ $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+ @echo
+ @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo
+ @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+ @echo "Run \`make' in that directory to run these through (pdf)latex" \
+ "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:
+ $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+ @echo "Running LaTeX files through pdflatex..."
+ $(MAKE) -C $(BUILDDIR)/latex all-pdf
+ @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:
+ $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+ @echo
+ @echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:
+ $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+ @echo
+ @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+texinfo:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo
+ @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
+ @echo "Run \`make' in that directory to run these through makeinfo" \
+ "(use \`make info' here to do that automatically)."
+
+info:
+ $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
+ @echo "Running Texinfo files through makeinfo..."
+ make -C $(BUILDDIR)/texinfo info
+ @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
+
+gettext:
+ $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
+ @echo
+ @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
+
+changes:
+ $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+ @echo
+ @echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:
+ $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+ @echo
+ @echo "Link check complete; look for any errors in the above output " \
+ "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:
+ $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+ @echo "Testing of doctests in the sources finished, look at the " \
+ "results in $(BUILDDIR)/doctest/output.txt."
+
+gh-pages: clean html
+ mkdir -p site/docs
+ mv -fv build/html/* ./site/docs
+ ./ghp-import -p site
View
@@ -0,0 +1,137 @@
+#! /usr/bin/env python
+#
+# This file is part of the ghp-import package released under
+# the Tumbolia Public License. See the LICENSE file for more
+# information.
+
+import optparse as op
+import os
+import subprocess as sp
+import time
+
+__usage__ = "%prog [OPTIONS] DIRECTORY"
+
+def is_repo(d):
+ if not os.path.isdir(d):
+ return False
+ if not os.path.isdir(os.path.join(d, 'objects')):
+ return False
+ if not os.path.isdir(os.path.join(d, 'refs')):
+ return False
+
+ headref = os.path.join(d, 'HEAD')
+ if os.path.isfile(headref):
+ return True
+ if os.path.islinke(headref) and os.readlink(headref).startswith("refs"):
+ return True
+ return False
+
+def find_repo(path):
+ if is_repo(path):
+ return True
+ if is_repo(os.path.join(path, '.git')):
+ return True
+ (parent, ignore) = os.path.split(path)
+ if parent == path:
+ return False
+ return find_repo(parent)
+
+def try_rebase(remote):
+ cmd = ['git', 'rev-list', '--max-count=1', 'origin/gh-pages']
+ p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
+ (rev, ignore) = p.communicate()
+ if p.wait() != 0:
+ return True
+ cmd = ['git', 'update-ref', 'refs/heads/gh-pages', rev.strip()]
+ if sp.call(cmd) != 0:
+ return False
+ return True
+
+def get_config(key):
+ p = sp.Popen(['git', 'config', key], stdin=sp.PIPE, stdout=sp.PIPE)
+ (value, stderr) = p.communicate()
+ return value.strip()
+
+def get_prev_commit():
+ cmd = ['git', 'rev-list', '--max-count=1', 'gh-pages']
+ p = sp.Popen(cmd, stdin=sp.PIPE, stdout=sp.PIPE, stderr=sp.PIPE)
+ (rev, ignore) = p.communicate()
+ if p.wait() != 0:
+ return None
+ return rev.strip()
+
+def make_when(timestamp=None):
+ if timestamp is None:
+ timestamp = int(time.time())
+ currtz = "%+05d" % (time.timezone / 36) # / 3600 * 100
+ return "%s %s" % (timestamp, currtz)
+
+def start_commit(pipe, message):
+ username = get_config("user.name")
+ email = get_config("user.email")
+ pipe.stdin.write('commit refs/heads/gh-pages\n')
+ pipe.stdin.write('committer %s <%s> %s\n' % (username, email, make_when()))
+ pipe.stdin.write('data %d\n%s\n' % (len(message), message))
+ head = get_prev_commit()
+ if head:
+ pipe.stdin.write('from %s\n' % head)
+ pipe.stdin.write('deleteall\n')
+
+def add_file(pipe, srcpath, tgtpath):
+ pipe.stdin.write('M 100644 inline %s\n' % tgtpath)
+ with open(srcpath) as handle:
+ data = handle.read()
+ pipe.stdin.write('data %d\n' % len(data))
+ pipe.stdin.write(data)
+ pipe.stdin.write('\n')
+
+def run_import(srcdir, message):
+ cmd = ['git', 'fast-import', '--date-format=raw', '--quiet']
+ pipe = sp.Popen(cmd, stdin=sp.PIPE)
+ start_commit(pipe, message)
+ for path, dnames, fnames in os.walk(srcdir):
+ for fn in fnames:
+ fpath = os.path.join(path, fn)
+ add_file(pipe, fpath, os.path.relpath(fpath, start=srcdir))
+ pipe.stdin.write('\n')
+ pipe.stdin.close()
+ if pipe.wait() != 0:
+ print "Failed to process commit."
+
+def options():
+ return [
+ op.make_option('-m', dest='mesg', default='Update documentation',
+ help='The commit message to use on the gh-pages branch.'),
+ op.make_option('-p', dest='push', default=False, action='store_true',
+ help='Push the branch to origin/gh-pages after committing.'),
+ op.make_option('-r', dest='remote', default='origin',
+ help='The name of the remote to push to. [%default]')
+ ]
+
+def main():
+ parser = op.OptionParser(usage=__usage__, option_list=options())
+ opts, args = parser.parse_args()
+
+ if len(args) == 0:
+ parser.error("No import directory specified.")
+
+ if len(args) > 1:
+ parser.error("Unknown arguments specified: %s" % ', '.join(args[1:]))
+
+ if not os.path.isdir(args[0]):
+ parser.error("Not a directory: %s" % args[0])
+
+ if not find_repo(os.getcwd()):
+ parser.error("No Git repository found.")
+
+ if not try_rebase(opts.remote):
+ parser.error("Failed to rebase gh-pages branch.")
+
+ run_import(args[0], opts.mesg)
+
+ if opts.push:
+ sp.check_call(['git', 'push', opts.remote, 'gh-pages'])
+
+if __name__ == '__main__':
+ main()
+
Oops, something went wrong.

0 comments on commit 016805d

Please sign in to comment.