File: envapi.rst

package info (click to toggle)
sphinx 8.2.3-12
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid
  • size: 26,960 kB
  • sloc: python: 105,864; javascript: 6,474; perl: 449; makefile: 178; sh: 37; xml: 19; ansic: 2
file content (106 lines) | stat: -rw-r--r-- 2,610 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
Build environment API
=====================

.. module:: sphinx.environment

.. class:: BuildEnvironment

   **Attributes**

   .. attribute:: app

      Reference to the :class:`.Sphinx` (application) object.

   .. attribute:: config

      Reference to the :class:`.Config` object.

   .. attribute:: project

      Target project.  See :class:`.Project`.

   .. attribute:: srcdir

      Source directory.

   .. attribute:: doctreedir

      Directory for storing pickled doctrees.

   .. attribute:: events

      An :class:`.EventManager` object.

   .. attribute:: found_docs

      A set of all existing docnames.

   .. attribute:: metadata

      Dictionary mapping docnames to "metadata" (see :ref:`metadata`).

   .. attribute:: titles

      Dictionary mapping docnames to the docutils node for their main title.

   .. autoattribute:: docname

   .. autoattribute:: parser

   **Per-document attributes**

   .. attribute:: current_document

      Temporary data storage while reading a document.

      Extensions may use the mapping interface provided by
      ``env.current_document`` to store data relating to the current document,
      but should use a unique prefix to avoid name clashes.

      .. important::
         Only the following attributes constitute the public API.
         The type itself and any methods or other attributes remain private,
         experimental, and will be changed or removed without notice.

      .. attribute:: current_document.docname
         :type: str

         The document name ('docname') for the current document.

      .. attribute:: current_document.default_role
         :type: str

         The default role for the current document.
         Set by the :dudir:`default-role` directive.

      .. attribute:: current_document.default_domain
         :type: Domain | None

         The default domain for the current document.
         Set by the :rst:dir:`default-domain` directive.

      .. attribute:: current_document.highlight_language
         :type: str

         The default language for syntax highlighting.
         Set by the :rst:dir:`highlight` directive to override
         the :confval:`highlight_language` config value.

      .. attribute:: current_document._parser
         :type: Parser | None

         *This attribute is experimental and may be changed without notice.*

         The parser being used to parse the current document.

   **Utility methods**

   .. automethod:: doc2path

   .. automethod:: relfn2path

   .. automethod:: note_dependency

   .. automethod:: new_serialno

   .. automethod:: note_reread