summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Chaplin <>2011-03-30 18:20:31 +0800
committerSteve Chaplin <>2011-03-30 18:20:31 +0800
commit7de3da3058ef63f74c03e947af2b923b9c456702 (patch)
tree80e4d126f59d81feb2aa5d82692f811983234c49
parent223a51feefbb99233bed8096779c576bda6fb0ad (diff)
downloadpycairo-7de3da3058ef63f74c03e947af2b923b9c456702.tar.gz
Get documentation working with Sphinx 1.0.7.
Update docs to describe the new pycairo C API.
-rw-r--r--doc/.gitignore6
-rw-r--r--doc/Makefile130
-rw-r--r--doc/README83
-rw-r--r--[-rwxr-xr-x]doc/conf.py109
-rw-r--r--doc/make.bat170
-rw-r--r--doc/overview.rst2
-rw-r--r--doc/pycairo_c_api.rst44
-rw-r--r--doc/reference/surfaces.rst11
8 files changed, 415 insertions, 140 deletions
diff --git a/doc/.gitignore b/doc/.gitignore
index 0e3f32a..7ae2974 100644
--- a/doc/.gitignore
+++ b/doc/.gitignore
@@ -1,6 +1,6 @@
-.build
-.static
-.templates
+_build
+_static
+_templates
html_docs_create.sh
html_docs_upload.sh
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000..28765d7
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,130 @@
+# 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 singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+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 " 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."
+
+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/Pycairo.qhcp"
+ @echo "To view the help file:"
+ @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Pycairo.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/Pycairo"
+ @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Pycairo"
+ @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."
+
+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."
diff --git a/doc/README b/doc/README
index 4bf7671..25a8ac3 100644
--- a/doc/README
+++ b/doc/README
@@ -1,5 +1,5 @@
Pycairo Documentation README
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+----------------------------
This directory contains the reStructuredText (reST) sources to the Pycairo
documentation.
@@ -11,79 +11,12 @@ Options for accessing pycairo documentation:
from http://www.cairographics.org/releases/. Uncompress the docs and point
your browser at the index.html file.
-3. Build the documentation yourself - the hardest option, see details below.
+3. Build the documentation yourself - the hardest option.
+Install Sphinx 1.0.7 or later.
+Build the docs using sphinx-build
+$ sphinx-build -b html sourcedir builddir
-Building the docs
-=================
-You need to install Python 2.4 or higher; the toolset used to build the docs are
-written in Python. The toolset used to build the documentation is called
-*Sphinx*, it is not included in this tree, but maintained separately in the
-Python Subversion repository. Also needed are Jinja, a templating engine
-(included in Sphinx as a Subversion external), and optionally Pygments, a code
-highlighter.
-
-
-Using make
-----------
- make html
-
-Available make targets are:
-
- * "html", which builds standalone HTML files for offline viewing.
-
- * "htmlhelp", which builds HTML files and a HTML Help project file usable to
- convert them into a single Compiled HTML (.chm) file -- these are popular
- under Microsoft Windows, but very handy on every platform.
-
- To create the CHM file, you need to run the Microsoft HTML Help Workshop
- over the generated project (.hhp) file.
-
- * "latex", which builds LaTeX source files that can be run with "pdflatex"
- to produce PDF documents.
-
- * "text", which builds a plain text file for each source file.
-
- * "linkcheck", which checks all external references to see whether they are
- broken, redirected or malformed, and outputs this information to stdout
- as well as a plain-text (.txt) file.
-
- * "changes", which builds an overview over all versionadded/versionchanged/
- deprecated items in the current version. This is meant as a help for the
- writer of the "What's New" document.
-
- * "pydoc-topics", which builds a Python module containing a dictionary
- with plain text documentation for the labels defined in
- `tools/sphinxext/pyspecific.py` -- pydoc needs these to show topic
- and keyword help.
-
-A "make update" updates the Subversion checkouts in `tools/`.
-
-
-Without make
-------------
-
-You'll need to checkout the Sphinx package to the `tools/` directory::
-
- svn co http://svn.python.org/projects/doctools/trunk/sphinx tools/sphinx
-
-Then, you need to install Docutils 0.4 (the SVN snapshot won't work), either
-by checking it out via ::
-
- svn co http://svn.python.org/projects/external/docutils-0.4/docutils tools/docutils
-
-or by installing it from http://docutils.sf.net/.
-
-You can optionally also install Pygments, either as a checkout via ::
-
- svn co http://svn.python.org/projects/external/Pygments-0.9/pygments tools/pygments
-
-or from PyPI at http://pypi.python.org/pypi/Pygments.
-
-
-Then, make an output directory, e.g. under `build/`, and run ::
-
- python tools/sphinx-build.py -b<builder> . build/<outputdirectory>
-
-where `<builder>` is one of html, web or htmlhelp (for explanations see the make
-targets above).
+or, build the docs using make
+$ make clean
+$ make html
diff --git a/doc/conf.py b/doc/conf.py
index d6ccba9..3201702 100755..100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -1,44 +1,46 @@
# -*- coding: utf-8 -*-
#
-# pycairo documentation build configuration file, created by
-# sphinx-quickstart on Tue Nov 25 23:21:00 2008.
+# Pycairo documentation build configuration file, created by
+# sphinx-quickstart on Mon Mar 28 20:09:35 2011.
#
# 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('.'))
+# 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('.'))
-# General configuration
-# ---------------------
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-extensions = []
+extensions = ['sphinx.ext.autodoc', 'sphinx.ext.todo']
# Add any paths that contain templates here, relative to this directory.
-templates_path = ['.templates']
+templates_path = ['_templates']
# The suffix of source filenames.
source_suffix = '.rst'
# The encoding of source files.
-#source_encoding = 'utf-8'
+#source_encoding = 'utf-8-sig'
# The master toctree document.
master_doc = 'index'
# General information about the project.
-project = u'pycairo'
+project = u'Pycairo'
copyright = u'2008, Steve Chaplin'
# The version info for the project you're documenting, acts as replacement for
@@ -48,7 +50,7 @@ copyright = u'2008, Steve Chaplin'
# The short X.Y version.
version = '1.8'
# The full version, including alpha/beta/rc tags.
-release = '1.8.10'
+release = '1.8.11'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
@@ -60,12 +62,9 @@ release = '1.8.10'
# 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']
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
@@ -84,14 +83,23 @@ exclude_trees = ['.build']
# 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 ---------------------------------------------------
-# Options for HTML output
-# -----------------------
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
-# 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 = 'default.css'
+# 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 = []
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
@@ -112,7 +120,7 @@ html_style = 'default.css'
# 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']
+html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
@@ -130,7 +138,7 @@ html_static_path = ['.static']
#html_additional_pages = {}
# If false, no module index is generated.
-#html_use_modindex = True
+#html_domain_indices = True
# If false, no index is generated.
#html_use_index = True
@@ -138,23 +146,28 @@ html_static_path = ['.static']
# 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, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = 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 = ''
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
# Output file base name for HTML help builder.
-htmlhelp_basename = 'pycairodoc'
+htmlhelp_basename = 'Pycairodoc'
-# Options for LaTeX output
-# ------------------------
+# -- Options for LaTeX output --------------------------------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
@@ -163,10 +176,10 @@ htmlhelp_basename = 'pycairodoc'
#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]).
+# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
- ('index', 'pycairo.tex', ur'pycairo Documentation',
- ur'Steve Chaplin', 'manual'),
+ ('index', 'Pycairo.tex', u'Pycairo Documentation',
+ u'Steve Chaplin', 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of
@@ -177,6 +190,12 @@ latex_documents = [
# not chapters.
#latex_use_parts = False
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
@@ -184,4 +203,14 @@ latex_documents = [
#latex_appendices = []
# If false, no module index is generated.
-#latex_use_modindex = True
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ ('index', 'pycairo', u'Pycairo Documentation',
+ [u'Steve Chaplin'], 1)
+]
diff --git a/doc/make.bat b/doc/make.bat
new file mode 100644
index 0000000..1f916ca
--- /dev/null
+++ b/doc/make.bat
@@ -0,0 +1,170 @@
+@ECHO OFF
+
+REM Command file for Sphinx documentation
+
+if "%SPHINXBUILD%" == "" (
+ 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 ^<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. text to make text files
+ echo. man to make manual pages
+ 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
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/html.
+ goto end
+)
+
+if "%1" == "dirhtml" (
+ %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
+ goto end
+)
+
+if "%1" == "singlehtml" (
+ %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
+ goto end
+)
+
+if "%1" == "pickle" (
+ %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the pickle files.
+ goto end
+)
+
+if "%1" == "json" (
+ %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can process the JSON files.
+ goto end
+)
+
+if "%1" == "htmlhelp" (
+ %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
+ if errorlevel 1 exit /b 1
+ 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
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; now you can run "qcollectiongenerator" with the ^
+.qhcp project file in %BUILDDIR%/qthelp, like this:
+ echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Pycairo.qhcp
+ echo.To view the help file:
+ echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Pycairo.ghc
+ goto end
+)
+
+if "%1" == "devhelp" (
+ %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished.
+ goto end
+)
+
+if "%1" == "epub" (
+ %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The epub file is in %BUILDDIR%/epub.
+ goto end
+)
+
+if "%1" == "latex" (
+ %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
+ goto end
+)
+
+if "%1" == "text" (
+ %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The text files are in %BUILDDIR%/text.
+ goto end
+)
+
+if "%1" == "man" (
+ %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Build finished. The manual pages are in %BUILDDIR%/man.
+ goto end
+)
+
+if "%1" == "changes" (
+ %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.The overview file is in %BUILDDIR%/changes.
+ goto end
+)
+
+if "%1" == "linkcheck" (
+ %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
+ if errorlevel 1 exit /b 1
+ 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
+ if errorlevel 1 exit /b 1
+ echo.
+ echo.Testing of doctests in the sources finished, look at the ^
+results in %BUILDDIR%/doctest/output.txt.
+ goto end
+)
+
+:end
diff --git a/doc/overview.rst b/doc/overview.rst
index e862335..53c3d9e 100644
--- a/doc/overview.rst
+++ b/doc/overview.rst
@@ -12,7 +12,7 @@ a more 'Pythonic' way.
Features of the Pycairo bindings:
-* Provides an object oriented interface to cairo, using Python 2.2 new style classes.
+* Provides an object oriented interface to cairo.
* Pycairo_Check_Status() is called to check the status of cairo operations, and raise exceptions as appropriate.
* Provides a C API that can be used by other Python extensions.
diff --git a/doc/pycairo_c_api.rst b/doc/pycairo_c_api.rst
index bf0e9e4..9e0b58f 100644
--- a/doc/pycairo_c_api.rst
+++ b/doc/pycairo_c_api.rst
@@ -15,18 +15,24 @@ extension modules that use pycairo.
To access the Pycairo C API
===========================
-Edit the client module file to add the following lines::
+Example showing how to import the pycairo API::
- /* All function, type and macro definitions needed to use the Pycairo/C API
- * are included in your code by the following line
- */
- #include "Pycairo.h"
+ #include "py3cairo.h"
- /* define a variable for the C API */
- static Pycairo_CAPI_t *Pycairo_CAPI;
+ PyMODINIT_FUNC
+ PyInit_client(void)
+ {
+ PyObject *m;
+
+ m = PyModule_Create(&clientmodule);
+ if (m == NULL)
+ return NULL;
+ if (import_cairo() < 0)
+ return NULL;
+ /* additional initialization can happen here */
+ return m;
+ }
- /* import pycairo - add to the init<module> function */
- Pycairo_IMPORT;
Pycairo Objects
@@ -86,33 +92,33 @@ Types::
Functions
=========
-.. cfunction:: cairo_t * PycairoContext_GET(obj)
+.. c:function:: cairo_t * PycairoContext_GET(obj)
get the C cairo_t \* object out of the PycairoContext \*obj
-.. cfunction:: PyObject * PycairoContext_FromContext(cairo_t *ctx, PyTypeObject *type, PyObject *base)
+.. c:function:: PyObject * PycairoContext_FromContext(cairo_t *ctx, PyTypeObject *type, PyObject *base)
-.. cfunction:: PyObject * PycairoFontFace_FromFontFace(cairo_font_face_t *font_face)
+.. c:function:: PyObject * PycairoFontFace_FromFontFace(cairo_font_face_t *font_face)
-.. cfunction:: PyObject * PycairoFontOptions_FromFontOptions(cairo_font_options_t *font_options)
+.. c:function:: PyObject * PycairoFontOptions_FromFontOptions(cairo_font_options_t *font_options)
-.. cfunction:: PyObject * PycairoMatrix_FromMatrix(const cairo_matrix_t *matrix)
+.. c:function:: PyObject * PycairoMatrix_FromMatrix(const cairo_matrix_t *matrix)
-.. cfunction:: PyObject * PycairoPath_FromPath(cairo_path_t *path)
+.. c:function:: PyObject * PycairoPath_FromPath(cairo_path_t *path)
-.. cfunction:: PyObject * PycairoPattern_FromPattern(cairo_pattern_t *pattern, PyObject *base)
+.. c:function:: PyObject * PycairoPattern_FromPattern(cairo_pattern_t *pattern, PyObject *base)
-.. cfunction:: PyObject * PycairoScaledFont_FromScaledFont(cairo_scaled_font_t *scaled_font)
+.. c:function:: PyObject * PycairoScaledFont_FromScaledFont(cairo_scaled_font_t *scaled_font)
-.. cfunction:: PyObject * PycairoSurface_FromSurface(cairo_surface_t *surface, PyObject *base)
+.. c:function:: PyObject * PycairoSurface_FromSurface(cairo_surface_t *surface, PyObject *base)
-.. cfunction:: int PycairoCheck_Status(cairo_status_t status)
+.. c:function:: int PycairoCheck_Status(cairo_status_t status)
diff --git a/doc/reference/surfaces.rst b/doc/reference/surfaces.rst
index 261fc1e..4b092e7 100644
--- a/doc/reference/surfaces.rst
+++ b/doc/reference/surfaces.rst
@@ -257,6 +257,10 @@ those defined in :ref:`FORMAT attributes <constants_FORMAT>`.
.. classmethod:: create_for_data(data, format, width, height[, stride])
+ Not yet available in Python 3
+
+ .. comment block - the old docs
+
:param data: a writable Python buffer object
:param format: the :ref:`FORMAT <constants_FORMAT>` of pixels in the
buffer
@@ -309,6 +313,9 @@ those defined in :ref:`FORMAT attributes <constants_FORMAT>`.
.. method:: get_data()
+ Not yet available in Python 3
+
+ .. comment block - old docs:
:returns: a Python buffer object for the data of the *ImageSurface*, for direct inspection or modification.
.. versionadded:: 1.2
@@ -644,8 +651,8 @@ The Win32PrintingSurface is a multi-page vector surface type.
ignored, and GDI will be used as much as possible to draw to the surface.
The returned surface will be wrapped using the paginated surface to provide
- correct complex rendering behaviour; :meth:`.show_page` and associated
- methods must be used for correct output.
+ correct complex rendering behaviour; :meth:`cairo.Surface.show_page` and
+ associated methods must be used for correct output.
class XCBSurface(:class:`Surface`)