From 94bb28d4fcfeb857457c3c3977c79ab0b30cc2fb Mon Sep 17 00:00:00 2001 From: Lukasz Balcerzak Date: Sun, 23 Jan 2011 23:36:32 +0100 Subject: [PATCH] Sphinxified documentation --- docs/Makefile | 96 ++++++++ docs/api/dulwich.client.rst | 10 + docs/api/dulwich.errors.rst | 11 + docs/api/dulwich.file.rst | 10 + docs/api/dulwich.index.rst | 10 + docs/api/dulwich.object_store.rst | 10 + docs/api/dulwich.objects.rst | 10 + docs/api/dulwich.pack.rst | 10 + docs/api/dulwich.patch.rst | 10 + docs/api/dulwich.protocol.rst | 10 + docs/api/dulwich.repo.rst | 10 + docs/api/dulwich.rst | 10 + docs/api/dulwich.server.rst | 10 + docs/api/dulwich.web.rst | 10 + docs/api/index.rst | 23 ++ docs/changelog.rst | 8 + docs/conf.py | 215 ++++++++++++++++ docs/index.rst | 27 +++ docs/make.bat | 121 +++++++++ docs/overview.rst | 7 + docs/performance.rst | 11 + docs/performance.txt | 7 - docs/protocol.rst | 65 +++++ docs/protocol.txt | 34 --- docs/theme/nature/static/nature.css_t | 229 ++++++++++++++++++ docs/theme/nature/static/pygments.css | 59 +++++ docs/theme/nature/theme.conf | 4 + .../{3-conclusion.txt => conclusion.rst} | 2 + docs/tutorial/index.rst | 14 ++ docs/tutorial/index.txt | 10 - .../{0-introduction.txt => introduction.rst} | 2 + .../{2-object-store.txt => object-store.rst} | 2 + docs/tutorial/{1-repo.txt => repo.rst} | 2 + dulwich/tests/__init__.py | 10 +- 34 files changed, 1023 insertions(+), 56 deletions(-) create mode 100644 docs/Makefile create mode 100644 docs/api/dulwich.client.rst create mode 100644 docs/api/dulwich.errors.rst create mode 100644 docs/api/dulwich.file.rst create mode 100644 docs/api/dulwich.index.rst create mode 100644 docs/api/dulwich.object_store.rst create mode 100644 docs/api/dulwich.objects.rst create mode 100644 docs/api/dulwich.pack.rst create mode 100644 docs/api/dulwich.patch.rst create mode 100644 docs/api/dulwich.protocol.rst create mode 100644 docs/api/dulwich.repo.rst create mode 100644 docs/api/dulwich.rst create mode 100644 docs/api/dulwich.server.rst create mode 100644 docs/api/dulwich.web.rst create mode 100644 docs/api/index.rst create mode 100644 docs/changelog.rst create mode 100644 docs/conf.py create mode 100644 docs/index.rst create mode 100644 docs/make.bat create mode 100644 docs/overview.rst create mode 100644 docs/performance.rst delete mode 100644 docs/performance.txt create mode 100644 docs/protocol.rst delete mode 100644 docs/protocol.txt create mode 100644 docs/theme/nature/static/nature.css_t create mode 100644 docs/theme/nature/static/pygments.css create mode 100644 docs/theme/nature/theme.conf rename docs/tutorial/{3-conclusion.txt => conclusion.rst} (92%) create mode 100644 docs/tutorial/index.rst delete mode 100644 docs/tutorial/index.txt rename docs/tutorial/{0-introduction.txt => introduction.rst} (99%) rename docs/tutorial/{2-object-store.txt => object-store.rst} (99%) rename docs/tutorial/{1-repo.txt => repo.rst} (97%) diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 000000000..6a27ce67e --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,96 @@ +# 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) . + +.PHONY: help clean html dirhtml pickle json htmlhelp qthelp latex changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " pdf to make PDF document" + @echo " dirhtml to make HTML files named index.html in directories" + @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 " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @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)/* + +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." + +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/dulwich.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/dulwich.qhc" + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make all-pdf' or \`make all-ps' in that directory to" \ + "run these through (pdf)latex." + +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." + +pdf: + $(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf + @echo + @echo "Build finished. The PDF files are in $(BUILDDIR)/pdf." + diff --git a/docs/api/dulwich.client.rst b/docs/api/dulwich.client.rst new file mode 100644 index 000000000..370eb8794 --- /dev/null +++ b/docs/api/dulwich.client.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.client: + +============== +dulwich.client +============== + + +.. automodule:: dulwich.client + :members: + diff --git a/docs/api/dulwich.errors.rst b/docs/api/dulwich.errors.rst new file mode 100644 index 000000000..c3d030fd4 --- /dev/null +++ b/docs/api/dulwich.errors.rst @@ -0,0 +1,11 @@ +.. _api-dulwich.errors: + +============== +dulwich.errors +============== + + +.. automodule:: dulwich.errors + :members: + + diff --git a/docs/api/dulwich.file.rst b/docs/api/dulwich.file.rst new file mode 100644 index 000000000..50426150c --- /dev/null +++ b/docs/api/dulwich.file.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.file: + +============ +dulwich.file +============ + + +.. automodule:: dulwich.file + :members: + diff --git a/docs/api/dulwich.index.rst b/docs/api/dulwich.index.rst new file mode 100644 index 000000000..afa7ba5c8 --- /dev/null +++ b/docs/api/dulwich.index.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.index: + +============= +dulwich.index +============= + + +.. automodule:: dulwich.index + :members: + diff --git a/docs/api/dulwich.object_store.rst b/docs/api/dulwich.object_store.rst new file mode 100644 index 000000000..a097d574e --- /dev/null +++ b/docs/api/dulwich.object_store.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.object_store: + +==================== +dulwich.object_store +==================== + + +.. automodule:: dulwich.object_store + :members: + diff --git a/docs/api/dulwich.objects.rst b/docs/api/dulwich.objects.rst new file mode 100644 index 000000000..0d05b05ad --- /dev/null +++ b/docs/api/dulwich.objects.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.objects: + +=============== +dulwich.objects +=============== + + +.. automodule:: dulwich.objects + :members: + diff --git a/docs/api/dulwich.pack.rst b/docs/api/dulwich.pack.rst new file mode 100644 index 000000000..b98c21f54 --- /dev/null +++ b/docs/api/dulwich.pack.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.pack: + +============ +dulwich.pack +============ + + +.. automodule:: dulwich.pack + :members: + diff --git a/docs/api/dulwich.patch.rst b/docs/api/dulwich.patch.rst new file mode 100644 index 000000000..339fc1e18 --- /dev/null +++ b/docs/api/dulwich.patch.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.patch: + +============= +dulwich.patch +============= + + +.. automodule:: dulwich.patch + :members: + diff --git a/docs/api/dulwich.protocol.rst b/docs/api/dulwich.protocol.rst new file mode 100644 index 000000000..f69fcf48d --- /dev/null +++ b/docs/api/dulwich.protocol.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.protocol: + +================ +dulwich.protocol +================ + + +.. automodule:: dulwich.protocol + :members: + diff --git a/docs/api/dulwich.repo.rst b/docs/api/dulwich.repo.rst new file mode 100644 index 000000000..740faa885 --- /dev/null +++ b/docs/api/dulwich.repo.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.repo: + +============ +dulwich.repo +============ + + +.. automodule:: dulwich.repo + :members: + diff --git a/docs/api/dulwich.rst b/docs/api/dulwich.rst new file mode 100644 index 000000000..c5eb82dd0 --- /dev/null +++ b/docs/api/dulwich.rst @@ -0,0 +1,10 @@ +.. _api-dulwich: + +======= +dulwich +======= + + +.. automodule:: dulwich + :members: + diff --git a/docs/api/dulwich.server.rst b/docs/api/dulwich.server.rst new file mode 100644 index 000000000..48fa86e89 --- /dev/null +++ b/docs/api/dulwich.server.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.server: + +============== +dulwich.server +============== + + +.. automodule:: dulwich.server + :members: + diff --git a/docs/api/dulwich.web.rst b/docs/api/dulwich.web.rst new file mode 100644 index 000000000..2b00b21b2 --- /dev/null +++ b/docs/api/dulwich.web.rst @@ -0,0 +1,10 @@ +.. _api-dulwich.web: + +=========== +dulwich.web +=========== + + +.. automodule:: dulwich.web + :members: + diff --git a/docs/api/index.rst b/docs/api/index.rst new file mode 100644 index 000000000..3cc7df188 --- /dev/null +++ b/docs/api/index.rst @@ -0,0 +1,23 @@ +.. _api: + +=== +API +=== + +.. toctree:: + :maxdepth: 2 + + dulwich + dulwich.client + dulwich.errors + dulwich.file + dulwich.index + dulwich.objects + dulwich.object_store + dulwich.pack + dulwich.patch + dulwich.protocol + dulwich.repo + dulwich.server + dulwich.web + diff --git a/docs/changelog.rst b/docs/changelog.rst new file mode 100644 index 000000000..d819f6016 --- /dev/null +++ b/docs/changelog.rst @@ -0,0 +1,8 @@ +.. _changelog: + +========= +Changelog +========= + +.. include:: ../NEWS + diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 000000000..002ca4858 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,215 @@ +# -*- coding: utf-8 -*- +# +# dulwich documentation build configuration file, created by +# sphinx-quickstart on Thu Feb 18 23:18:28 2010. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# 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 extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +sys.path.insert(0, os.path.abspath('..')) +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__)))) +dulwich = __import__('dulwich') + +# -- 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'] +try: + import rst2pdf + if rst2pdf.version >= '0.16': + extensions.append('rst2pdf.pdfbuilder') +except ImportError: + print "[NOTE] In order to build PDF you need rst2pdf with version >=0.16" + + +autoclass_content = "both" + +# 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'dulwich' +copyright = u'2011, Jelmer Vernooij' + +# 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 = '.'.join(map(str, dulwich.__version__[:2])) +# The full version, including alpha/beta/rc tags. +release = '.'.join(map(str, dulwich.__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 = ['build'] + +# 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' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. Major themes that come with +# Sphinx are currently 'default' and 'sphinxdoc'. +#html_theme = 'default' +html_theme = 'nature' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +html_theme_path = ['theme'] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v 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 = [] + +# 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_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# 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, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a 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 = 'dulwichdoc' + + +# -- 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, documentclass [howto/manual]). +latex_documents = [ + ('index', 'dulwich.tex', u'dulwich Documentation', + u'Jelmer Vernooij', '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 + +pdf_documents = [ + ('index', u'dulwich', u'Documentation for dulwich', + u'Jelmer Vernooij'), +] +pdf_stylesheets = ['sphinx','kerning','a4'] +pdf_break_level = 2 +pdf_inline_footnotes = True + diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 000000000..60b5fda1c --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,27 @@ +.. _index: + +====================================== +dulwich - Python implementation of Git +====================================== + +**Documentation**: + +.. toctree:: + :maxdepth: 2 + + overview + performance + protocol + changelog + + tutorial/index + api/index + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 000000000..e94ff2f0c --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,121 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +set SPHINXBUILD=sphinx-build +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. pdf to make PDF document + echo. dirhtml to make HTML files named index.html in directories + 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. 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 + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "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. + goto end +) + +if "%1" == "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\dulwich.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\dulwich.ghc + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "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. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "pdf" ( + %SPHINXBUILD% -b pdf %ALLSPHINXOPTS% %BUILDDIR%/pdf + echo. + echo.Build finished. The PDF files are in %BUILDDIR%/pdf. + goto end +) + +:end diff --git a/docs/overview.rst b/docs/overview.rst new file mode 100644 index 000000000..4ce5f4a03 --- /dev/null +++ b/docs/overview.rst @@ -0,0 +1,7 @@ +.. _overview: + +Overview +======== + +.. include:: ../README + diff --git a/docs/performance.rst b/docs/performance.rst new file mode 100644 index 000000000..d2fd817f8 --- /dev/null +++ b/docs/performance.rst @@ -0,0 +1,11 @@ +.. _performance: + +============================== +Possible areas for improvement +============================== + +Places for improvement, ordered by difficulty / effectiveness: + +* read_zlib() should have a C equivalent (~ 4% overhead atm) +* unpack_object() should have a C equivalent + diff --git a/docs/performance.txt b/docs/performance.txt deleted file mode 100644 index dfe8d2d1a..000000000 --- a/docs/performance.txt +++ /dev/null @@ -1,7 +0,0 @@ -Possible areas for improvement -============================== - -Places for improvement, ordered by difficulty / effectiveness: - - * read_zlib() should have a C equivalent (~ 4% overhead atm) - * unpack_object() should have a C equivalent diff --git a/docs/protocol.rst b/docs/protocol.rst new file mode 100644 index 000000000..ed694b9e9 --- /dev/null +++ b/docs/protocol.rst @@ -0,0 +1,65 @@ +.. _protocol: + +=================== +Git Server Protocol +=================== + +Transport +========= + +The Git protocol operates over pipes or TCP/IP. When a client connects over +TCP/IP, it sends a header that tells the server which program to run and what +parameters to use. When invoked over SSH, git will run a program with the +parameters as command line arguments. + +Protocols +========= + +Basics +------ + +Git communicates with a server by piping data between a local program and a +remote program. + +A common way of sending a unit of information is a pkt_line. This is a 4 byte +size as human encoded hex (i.e. totally underusing the 4 bytes...) that tells +you the size of the payload, followed by the payload. The size includes the 4 +byes used by the size itself. + + 0009ABCD\n + +Git can also multiplex data using the sideband. As well as 4 bytes size, there +would be a 1 byte channel number. This is in binary, so ``1`` will be ``\x01``. + +Typically Git will piggyback a list of capabilities on the first pkt_line it +sends. It will also look for capabilities in the first pkt_like it receives. +Git will degrade as much as possible when encountering a server or client with +differing capabilities. + +git-upload-pack +--------------- + +git-upload pack is used by git-ls-remote, git-clone, git-fetch and git-pull. +And i'm sure others. Typically a client will connect a local git-fetch-pack to +a remote git-upload-pack. + +Capabilities for this protocol include multi_ack, thin-pack, ofs-delta, +sideband and sideband-64k A thin pack can reference objects not in the current +pack. + +The server tells the client what refs it has. The client states which of those +SHA1's it would like. It then starts to report which SHA1's it has. The server +ACKs these allowing the client to work out when to stop sending SHA1's. This +saves a lot of transfer because the client can make decisions like "well if it +has this SHA, then it has all its parents so i dont need to care about those". +When the client stops sending shas, the server can work out an optimal pack and +then send it to the client. + +git-receive-pack +---------------- + +git-receive-pack is used by git push. Typically a client connects a local +git-send-pack to a remote git-receive-pack. + +Capabilities include report-status and delete-ref. + diff --git a/docs/protocol.txt b/docs/protocol.txt deleted file mode 100644 index 04fd9f8cb..000000000 --- a/docs/protocol.txt +++ /dev/null @@ -1,34 +0,0 @@ -= Git Server Protocol = - -== Transport == -The Git protocol operates over pipes or TCP/IP. When a client connects over TCP/IP, it sends a header that tells the server which program to run and what parameters to use. When invoked over SSH, git will run a program with the parameters as command line arguments. - -== Protocols == - -=== Basics ==== - -Git communicates with a server by piping data between a local program and a remote program. - -A common way of sending a unit of information is a pkt_line. This is a 4 byte size as human encoded hex (i.e. totally underusing the 4 bytes...) that tells you the size of the payload, followed by the payload. The size includes the 4 byes used by the size itself. - -{{{ -0009ABCD\n -}}} - -Git can also multiplex data using the sideband. As well as 4 bytes size, there would be a 1 byte channel number. This is in binary, so 1 will be \x01. - -Typically Git will piggyback a list of capabilities on the first pkt_line it sends. It will also look for capabilities in the first pkt_like it receives. Git will degrade as much as possible when encountering a server or client with differing capabilities. - -==== git-upload-pack === - -git-upload pack is used by git-ls-remote, git-clone, git-fetch and git-pull. And i'm sure others. Typically a client will connect a local git-fetch-pack to a remote git-upload-pack. - -Capabilities for this protocol include multi_ack, thin-pack, ofs-delta, sideband and sideband-64k A thin pack can reference objects not in the current pack. - -The server tells the client what refs it has. The client states which of those SHA1's it would like. It then starts to report which SHA1's it has. The server ACKs these allowing the client to work out when to stop sending SHA1's. This saves a lot of transfer because the client can make decisions like "well if it has this SHA, then it has all its parents so i dont need to care about those". When the client stops sending shas, the server can work out an optimal pack and then send it to the client. - -==== git-receive-pack === - -git-receive-pack is used by git push. Typically a client connects a local git-send-pack to a remote git-receive-pack. - -Capabilities include report-status and delete-ref. diff --git a/docs/theme/nature/static/nature.css_t b/docs/theme/nature/static/nature.css_t new file mode 100644 index 000000000..03b0379d0 --- /dev/null +++ b/docs/theme/nature/static/nature.css_t @@ -0,0 +1,229 @@ +/** + * Sphinx stylesheet -- default theme + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: Arial, sans-serif; + font-size: 100%; + background-color: #111; + color: #555; + margin: 0; + padding: 0; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +hr{ + border: 1px solid #B1B4B6; +} + +div.document { + background-color: #eee; +} + +div.body { + background-color: #ffffff; + color: #3E4349; + padding: 0 30px 30px 30px; + font-size: 0.8em; +} + +div.footer { + color: #555; + width: 100%; + padding: 13px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #444; + text-decoration: underline; +} + +div.related { + background-color: #6BA81E; + line-height: 32px; + color: #fff; + text-shadow: 0px 1px 0 #444; + font-size: 0.80em; +} + +div.related a { + color: #E2F3CC; +} + +div.sphinxsidebar { + font-size: 0.75em; + line-height: 1.5em; +} + +div.sphinxsidebarwrapper{ + padding: 20px 0; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: Arial, sans-serif; + color: #222; + font-size: 1.2em; + font-weight: normal; + margin: 0; + padding: 5px 10px; + background-color: #ddd; + text-shadow: 1px 1px 0 white +} + +div.sphinxsidebar h4{ + font-size: 1.1em; +} + +div.sphinxsidebar h3 a { + color: #444; +} + + +div.sphinxsidebar p { + color: #888; + padding: 5px 20px; +} + +div.sphinxsidebar p.topless { +} + +div.sphinxsidebar ul { + margin: 10px 20px; + padding: 0; + color: #000; +} + +div.sphinxsidebar a { + color: #444; +} + +div.sphinxsidebar input { + border: 1px solid #ccc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar input[type=text]{ + margin-left: 20px; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #005B81; + text-decoration: none; +} + +a:hover { + color: #E32E00; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: Arial, sans-serif; + background-color: #BED4EB; + font-weight: normal; + color: #212224; + margin: 30px 0px 10px 0px; + padding: 5px 0 5px 10px; + text-shadow: 0px 1px 0 white +} + +div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 150%; background-color: #C8D5E3; } +div.body h3 { font-size: 120%; background-color: #D8DEE3; } +div.body h4 { font-size: 110%; background-color: #D8DEE3; } +div.body h5 { font-size: 100%; background-color: #D8DEE3; } +div.body h6 { font-size: 100%; background-color: #D8DEE3; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + line-height: 1.5em; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.highlight{ + background-color: white; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 10px; + background-color: White; + color: #222; + line-height: 1.2em; + border: 1px solid #C6C9CB; + font-size: 1.2em; + margin: 1.5em 0 1.5em 0; + -webkit-box-shadow: 1px 1px 1px #d8d8d8; + -moz-box-shadow: 1px 1px 1px #d8d8d8; +} + +tt { + background-color: #ecf0f3; + color: #222; + padding: 1px 2px; + font-size: 1.2em; + font-family: monospace; +} diff --git a/docs/theme/nature/static/pygments.css b/docs/theme/nature/static/pygments.css new file mode 100644 index 000000000..efbfc0bef --- /dev/null +++ b/docs/theme/nature/static/pygments.css @@ -0,0 +1,59 @@ +pre { + background-color: #FAF8CC; + border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; +} + +.c { color: #999988; font-style: italic } /* Comment */ +.k { font-weight: bold } /* Keyword */ +.o { font-weight: bold } /* Operator */ +.cm { color: #999988; font-style: italic } /* Comment.Multiline */ +.cp { color: #999999; font-weight: bold } /* Comment.preproc */ +.c1 { color: #999988; font-style: italic } /* Comment.Single */ +.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #aa0000 } /* Generic.Error */ +.gh { color: #999999 } /* Generic.Heading */ +.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ +.go { color: #111 } /* Generic.Output */ +.gp { color: #555555 } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #aaaaaa } /* Generic.Subheading */ +.gt { color: #aa0000 } /* Generic.Traceback */ +.kc { font-weight: bold } /* Keyword.Constant */ +.kd { font-weight: bold } /* Keyword.Declaration */ +.kp { font-weight: bold } /* Keyword.Pseudo */ +.kr { font-weight: bold } /* Keyword.Reserved */ +.kt { color: #445588; font-weight: bold } /* Keyword.Type */ +.m { color: #009999 } /* Literal.Number */ +.s { color: #bb8844 } /* Literal.String */ +.na { color: #008080 } /* Name.Attribute */ +.nb { color: #999999 } /* Name.Builtin */ +.nc { color: #445588; font-weight: bold } /* Name.Class */ +.no { color: #ff99ff } /* Name.Constant */ +.ni { color: #800080 } /* Name.Entity */ +.ne { color: #990000; font-weight: bold } /* Name.Exception */ +.nf { color: #990000; font-weight: bold } /* Name.Function */ +.nn { color: #555555 } /* Name.Namespace */ +.nt { color: #000080 } /* Name.Tag */ +.nv { color: purple } /* Name.Variable */ +.ow { font-weight: bold } /* Operator.Word */ +.mf { color: #009999 } /* Literal.Number.Float */ +.mh { color: #009999 } /* Literal.Number.Hex */ +.mi { color: #009999 } /* Literal.Number.Integer */ +.mo { color: #009999 } /* Literal.Number.Oct */ +.sb { color: #bb8844 } /* Literal.String.Backtick */ +.sc { color: #bb8844 } /* Literal.String.Char */ +.sd { color: #bb8844 } /* Literal.String.Doc */ +.s2 { color: #bb8844 } /* Literal.String.Double */ +.se { color: #bb8844 } /* Literal.String.Escape */ +.sh { color: #bb8844 } /* Literal.String.Heredoc */ +.si { color: #bb8844 } /* Literal.String.Interpol */ +.sx { color: #bb8844 } /* Literal.String.Other */ +.sr { color: #808000 } /* Literal.String.Regex */ +.s1 { color: #bb8844 } /* Literal.String.Single */ +.ss { color: #bb8844 } /* Literal.String.Symbol */ +.bp { color: #999999 } /* Name.Builtin.Pseudo */ +.vc { color: #ff99ff } /* Name.Variable.Class */ +.vg { color: #ff99ff } /* Name.Variable.Global */ +.vi { color: #ff99ff } /* Name.Variable.Instance */ +.il { color: #009999 } /* Literal.Number.Integer.Long */ diff --git a/docs/theme/nature/theme.conf b/docs/theme/nature/theme.conf new file mode 100644 index 000000000..1cc400446 --- /dev/null +++ b/docs/theme/nature/theme.conf @@ -0,0 +1,4 @@ +[theme] +inherit = basic +stylesheet = nature.css +pygments_style = tango diff --git a/docs/tutorial/3-conclusion.txt b/docs/tutorial/conclusion.rst similarity index 92% rename from docs/tutorial/3-conclusion.txt rename to docs/tutorial/conclusion.rst index 5ec596ddb..374e4ccee 100644 --- a/docs/tutorial/3-conclusion.txt +++ b/docs/tutorial/conclusion.rst @@ -1,3 +1,5 @@ +.. _tutorial-conclusion: + Conclusion ========== diff --git a/docs/tutorial/index.rst b/docs/tutorial/index.rst new file mode 100644 index 000000000..9f3a2a1e0 --- /dev/null +++ b/docs/tutorial/index.rst @@ -0,0 +1,14 @@ +.. _tutorial: + +======== +Tutorial +======== + +.. toctree:: + :maxdepth: 2 + + introduction + repo + object-store + conclusion + diff --git a/docs/tutorial/index.txt b/docs/tutorial/index.txt deleted file mode 100644 index a7c1cedb7..000000000 --- a/docs/tutorial/index.txt +++ /dev/null @@ -1,10 +0,0 @@ -================ -Dulwich Tutorial -================ - -.. contents:: - -.. include:: 0-introduction.txt -.. include:: 1-repo.txt -.. include:: 2-object-store.txt -.. include:: 3-conclusion.txt diff --git a/docs/tutorial/0-introduction.txt b/docs/tutorial/introduction.rst similarity index 99% rename from docs/tutorial/0-introduction.txt rename to docs/tutorial/introduction.rst index 84ff50bfd..cff4f3d51 100644 --- a/docs/tutorial/0-introduction.txt +++ b/docs/tutorial/introduction.rst @@ -1,3 +1,5 @@ +.. _tutorial-introduction: + Introduction ============ diff --git a/docs/tutorial/2-object-store.txt b/docs/tutorial/object-store.rst similarity index 99% rename from docs/tutorial/2-object-store.txt rename to docs/tutorial/object-store.rst index 44a579081..21604c11a 100644 --- a/docs/tutorial/2-object-store.txt +++ b/docs/tutorial/object-store.rst @@ -1,3 +1,5 @@ +.. _tutorial-object-store: + The object store ================ diff --git a/docs/tutorial/1-repo.txt b/docs/tutorial/repo.rst similarity index 97% rename from docs/tutorial/1-repo.txt rename to docs/tutorial/repo.rst index 084ff3c09..54ab6616e 100644 --- a/docs/tutorial/1-repo.txt +++ b/docs/tutorial/repo.rst @@ -1,3 +1,5 @@ +.. _tutorial-repo: + The Repository ============== diff --git a/dulwich/tests/__init__.py b/dulwich/tests/__init__.py index 93299f15b..8c9debdbc 100644 --- a/dulwich/tests/__init__.py +++ b/dulwich/tests/__init__.py @@ -103,12 +103,12 @@ def self_test_suite(): def tutorial_test_suite(): tutorial = [ - '0-introduction', - '1-repo', - '2-object-store', - '3-conclusion', + 'introduction', + 'repo', + 'object-store', + 'conclusion', ] - tutorial_files = ["../../docs/tutorial/%s.txt" % name for name in tutorial] + tutorial_files = ["../../docs/tutorial/%s.rst" % name for name in tutorial] def setup(test): test.__dulwich_tempdir = tempfile.mkdtemp() os.chdir(test.__dulwich_tempdir)