Commit 7139040a authored by Matti Picus's avatar Matti Picus Committed by GitHub

DOC: make some github issues into links, doc fixes (GH-4060)

* DOC: make some github issues into links, doc fixes
* add a doc-requirements.txt for building docs
* use ':issue:' domains for github issues
parent ed5e53c4
This diff is collapsed.
...@@ -948,6 +948,11 @@ def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False, ...@@ -948,6 +948,11 @@ def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False,
See examples in :ref:`determining_where_to_add_types` or See examples in :ref:`determining_where_to_add_types` or
:ref:`primes`. :ref:`primes`.
:param annotate-fullc: If ``True`` will produce a colorized HTML version of
the source which includes entire generated C/C++-code.
:param compiler_directives: Allow to set compiler directives in the ``setup.py`` like this: :param compiler_directives: Allow to set compiler directives in the ``setup.py`` like this:
``compiler_directives={'embedsignature': True}``. ``compiler_directives={'embedsignature': True}``.
See :ref:`compiler-directives`. See :ref:`compiler-directives`.
......
...@@ -44,7 +44,8 @@ extensions = [ ...@@ -44,7 +44,8 @@ extensions = [
'sphinx.ext.imgmath', 'sphinx.ext.imgmath',
'sphinx.ext.todo', 'sphinx.ext.todo',
'sphinx.ext.intersphinx', 'sphinx.ext.intersphinx',
'sphinx.ext.autodoc' 'sphinx.ext.autodoc',
'sphinx_issues', # if this is missing, pip install sphinx-issues
] ]
try: import rst2pdf try: import rst2pdf
...@@ -135,6 +136,9 @@ intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)} ...@@ -135,6 +136,9 @@ intersphinx_mapping = {'python': ('https://docs.python.org/3/', None)}
# The output image format. The default is 'png'. It should be either 'png' or 'svg'. # The output image format. The default is 'png'. It should be either 'png' or 'svg'.
imgmath_image_format = "svg" imgmath_image_format = "svg"
# For sphinx-issues
issues_github_path = "cython/cython"
# -- Options for HTML output --------------------------------------------------- # -- Options for HTML output ---------------------------------------------------
......
:orphan:
This example directory is organized like the ``Cython/docs/src/`` directory, This example directory is organized like the ``Cython/docs/src/`` directory,
with one directory per ``.rst`` file. All files in this directory are tested with one directory per ``.rst`` file. All files in this directory are tested
in the :file:`runtests.py` with the mode `compile`. in the :file:`runtests.py` with the mode `compile`.
...@@ -10,4 +10,6 @@ Also see the `Cython project homepage <https://cython.org/>`_. ...@@ -10,4 +10,6 @@ Also see the `Cython project homepage <https://cython.org/>`_.
src/quickstart/index src/quickstart/index
src/tutorial/index src/tutorial/index
src/userguide/index src/userguide/index
src/reference/index
Contributing <CONTRIBUTING>
src/changes src/changes
:orphan:
🌷️ Thank you for your interest in supporting Cython! 🌷️ 🌷️ Thank you for your interest in supporting Cython! 🌷️
========================================================= =========================================================
......
:orphan:
Compiler Directives Compiler Directives
=================== ===================
......
:orphan:
.. highlight:: cython .. highlight:: cython
*************** ***************
......
:orphan:
.. highlight:: cython .. highlight:: cython
......
...@@ -30,6 +30,8 @@ your code is being compiled with, you can do this: ...@@ -30,6 +30,8 @@ your code is being compiled with, you can do this:
.. literalinclude:: ../../examples/tutorial/external/py_version_hex.pyx .. literalinclude:: ../../examples/tutorial/external/py_version_hex.pyx
.. _libc.math:
Cython also provides declarations for the C math library: Cython also provides declarations for the C math library:
.. literalinclude:: ../../examples/tutorial/external/libc_sin.pyx .. literalinclude:: ../../examples/tutorial/external/libc_sin.pyx
......
...@@ -669,6 +669,8 @@ objects from memory. Clearing is implemented in the ``tp_clear`` slot. ...@@ -669,6 +669,8 @@ objects from memory. Clearing is implemented in the ``tp_clear`` slot.
As we just explained, it is sufficient that one object in the cycle As we just explained, it is sufficient that one object in the cycle
implements ``tp_clear``. implements ``tp_clear``.
.. _trashcan:
Enabling the deallocation trashcan Enabling the deallocation trashcan
---------------------------------- ----------------------------------
...@@ -965,7 +967,8 @@ C inline properties ...@@ -965,7 +967,8 @@ C inline properties
Similar to Python property attributes, Cython provides a way to declare C-level Similar to Python property attributes, Cython provides a way to declare C-level
properties on external extension types. This is often used to shadow Python properties on external extension types. This is often used to shadow Python
attributes through faster C level data access, but can also be used to add certain attributes through faster C level data access, but can also be used to add certain
functionality to existing types when using them from Cython. functionality to existing types when using them from Cython. The declarations
must use `cdef inline`.
For example, the above ``complex`` type could also be declared like this: For example, the above ``complex`` type could also be declared like this:
......
.. glossary:: .. glossary::
Glossary
========
Extension type Extension type
"Extension type" can refer to either a Cython class defined with ``cdef class`` or more generally to any Python type that is ultimately implemented as a native C struct (including the built-in types like `int` or `dict`). "Extension type" can refer to either a Cython class defined with ``cdef class`` or more generally to any Python type that is ultimately implemented as a native C struct (including the built-in types like `int` or `dict`).
Dynamic allocation Dynamic allocation or Heap allocation
Heap allocation
A C variable allocated with ``malloc`` (in C) or ``new`` (in C++) is A C variable allocated with ``malloc`` (in C) or ``new`` (in C++) is
`allocated dynamically/heap allocated <https://en.wikipedia.org/wiki/C_dynamic_memory_allocation>`_. `allocated dynamically/heap allocated <https://en.wikipedia.org/wiki/C_dynamic_memory_allocation>`_.
Its lifetime is until the user deletes it explicitly (with ``free`` in C or ``del`` in C++). Its lifetime is until the user deletes it explicitly (with ``free`` in C or ``del`` in C++).
...@@ -19,9 +21,9 @@ ...@@ -19,9 +21,9 @@
Python object Python object
When using Python, the contents of every variable is a Python object When using Python, the contents of every variable is a Python object
(including Cython extension types). Key features of Python objects are that (including Cython extension types). Key features of Python objects are that
they are passed _by reference_ and that their lifetime is _managed_ automatically they are passed *by reference* and that their lifetime is *managed* automatically
so that they are destroyed when no more references exist to them. so that they are destroyed when no more references exist to them.
In Cython, they are distinct from C types, which are passed _by value_ and whose In Cython, they are distinct from C types, which are passed *by value* and whose
lifetime is managed depending on whether they are allocated on the stack or heap. lifetime is managed depending on whether they are allocated on the stack or heap.
To explicitly declare a Python object variable in Cython use ``cdef object abc``. To explicitly declare a Python object variable in Cython use ``cdef object abc``.
Internally in C, they are referred to as ``PyObject*``. Internally in C, they are referred to as ``PyObject*``.
......
...@@ -227,6 +227,8 @@ Some things to note about this example: ...@@ -227,6 +227,8 @@ Some things to note about this example:
when you try to use them from a dependent package. when you try to use them from a dependent package.
To prevent this, include ``zip_safe=False`` in the arguments to ``setup()``. To prevent this, include ``zip_safe=False`` in the arguments to ``setup()``.
.. _versioning:
Versioning Versioning
========== ==========
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment