Skip to content

Commit e6dacb0

Browse files
committed
docs: Expand templating guide
1 parent 8faf105 commit e6dacb0

8 files changed

Lines changed: 397 additions & 53 deletions

File tree

docs/api.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ rendered as part of the document.
1616
- :ref:`context`, the dynamic content of a Jinja template
1717

1818
- :py:class:`~sphinxnotes.render.Template`,
19-
the Jinja template for rendering context to markup text
20-
(reStructuredText or Markdown)
19+
the Jinja template for rendering context to markup text
20+
(reStructuredText or Markdown)
2121

2222
2. Render: the ``pending_node`` node will be rendered at the appropriate
2323
:py:class:`~sphinxnotes.render.Phase`, depending on
2424
:py:attr:`~sphinxnotes.render.pending_node.template.phase`.
2525

26+
For a task-oriented explanation of template variables, extra context, and phase
27+
selection, see :doc:`tmpl`.
28+
2629
Node
2730
-----
2831

@@ -64,6 +67,8 @@ Context refers to the dynamic content of a Jinja template. It can be:
6467
Template
6568
--------
6669

70+
See :doc:`tmpl` for the higher-level guide.
71+
6772
.. autoclass:: sphinxnotes.render.Template
6873
:members:
6974

@@ -73,6 +78,9 @@ Template
7378
Extra Context
7479
-------------
7580

81+
See :doc:`tmpl` for built-in extra-context names such as ``_doc`` and
82+
``_sphinx``, plus usage examples.
83+
7684
.. autoclass:: sphinxnotes.render.GlobalExtraContxt
7785

7886
.. autoclass:: sphinxnotes.render.ParsePhaseExtraContext
@@ -86,6 +94,8 @@ Extra Context
8694
Base Roles and Directives
8795
-------------------------
8896

97+
For a minimal end-to-end example of a custom directive, start with :doc:`usage`.
98+
8999
Base Role Classes
90100
~~~~~~~~~~~~~~~~~
91101

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@
122122
sys.path.insert(0, os.path.abspath('../src/'))
123123
extensions.append('sphinxnotes.render')
124124

125+
extensions.append('sphinxnotes.data')
126+
125127
# CUSTOM CONFIGURATION
126128

127129
autodoc_default_options = {
@@ -130,6 +132,7 @@
130132

131133
intersphinx_mapping['python'] = ('https://docs.python.org/3', None)
132134
intersphinx_mapping['sphinx'] = ('https://www.sphinx-doc.org/en/master', None)
135+
intersphinx_mapping['data'] = ('https://sphinx.silverrainz.me/data', None)
133136

134137
def setup(app):
135138
app.add_object_type('event', 'event') # for intersphinx

docs/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,17 @@ Getting Started
4242
This extension is not intended to be used directly by Sphinx users.
4343
It is for Sphinx extension developers.
4444

45+
If you are new to the project, read :doc:`usage` first, then :doc:`tmpl`,
46+
and finally :doc:`dsl` and :doc:`api` as reference material.
47+
4548
.. ADDITIONAL CONTENT END
4649
4750
Contents
4851
========
4952

5053
.. toctree::
5154
:caption: Contents
55+
:maxdepth: 2
5256

5357
usage
5458
tmpl

0 commit comments

Comments
 (0)