Skip to content

Commit de38e3e

Browse files
authored
Merge pull request #38 from dylan-lang/toc-entries-for-definitions
Toc entries for definitions
2 parents 61d941f + fe342cb commit de38e3e

File tree

4 files changed

+155
-71
lines changed

4 files changed

+155
-71
lines changed

documentation/source/conf.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@
44
# list see the documentation:
55
# https://www.sphinx-doc.org/en/master/usage/configuration.html
66

7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
13-
# import os
14-
# import sys
15-
# sys.path.insert(0, os.path.abspath('.'))
7+
# Use the local repo to build the docs, as a very minimal test.
8+
import os
9+
import sys
10+
sys.path.insert(0, os.path.abspath('../../sphinxcontrib'))
1611

1712

1813
# -- Project information -----------------------------------------------------
@@ -22,7 +17,7 @@
2217
author = 'Dylan Hackers'
2318

2419
# The full version, including alpha/beta/rc tags
25-
release = 'v0.2.0'
20+
release = 'v1.1.0'
2621

2722

2823
# -- General configuration ---------------------------------------------------
@@ -31,7 +26,9 @@
3126
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3227
# ones.
3328
extensions = [
29+
'dylan.domain',
3430
]
31+
primary_domain = 'dylan'
3532

3633
# Add any paths that contain templates here, relative to this directory.
3734
templates_path = ['_templates']
@@ -52,4 +49,4 @@
5249
# Add any paths that contain custom static files (such as style sheets) here,
5350
# relative to this directory. They are copied after the builtin static files,
5451
# so a file named "default.css" will overwrite the builtin "default.css".
55-
html_static_path = ['_static']
52+
html_static_path = []

documentation/source/index.rst

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ Roles
3636
configured by `dylan_drm_index`_. The partial URL is appended to the base URL
3737
configured by the `dylan_drm_url`_.
3838

39+
For example, this link to :drm:`<object>` was produced with the markup
40+
``:drm:`<object>```, which assumes the above configuration setting of ``primary_domain
41+
= 'dylan'``.
42+
43+
.. The above usage of the :drm: role is explicitly included as a very minimal test to
44+
make sure that when this documentation is built it at least uses some of the code in
45+
dylandomain.py; please don't remove it.
46+
3947
4048
Configurables
4149
-------------
@@ -53,7 +61,7 @@ Configurables
5361
partial URLs. Each line is a correspondence. The first word is the Dylan
5462
name, followed by whitespace, then the remainder is the partial URL. Defaults
5563
to partial URLs corresponding to the copy of the `Dylan Reference Manual`:t:
56-
at `<http://opendylan.org>`_.
64+
at `opendylan.org <https://opendylan.org>`_.
5765

5866

5967
Library, module, and binding documentation
@@ -443,6 +451,17 @@ Directive options
443451
Directive options appear immediately after the directive with no intervening
444452
blank lines.
445453

454+
``:no-contents-entry:``
455+
^^^^^^^^^^^^^^^^^^^^^^^
456+
457+
Tells Sphinx not to add a Table of Contents (ToC) entry for this Dylan object. This
458+
may be especially useful for `dylan:method::`_ directives because sometimes they can
459+
unnecessarily clutter the ToC. If the `dylan:method::`_ directives are all colocated
460+
with the `dylan:generic-function::`_ directive then it may be sufficient to only
461+
include the latter in the ToC. (This option is provided by Sphinx itself.)
462+
463+
:Syntax: ``:no-contents-entry:``
464+
446465
``:library:``
447466
^^^^^^^^^^^^^
448467

sphinxcontrib/dylan/domain/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
from .dylandomain import DylanDomain
1212

1313
def setup (app):
14+
# https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_config_value
1415
app.add_config_value('dylan_drm_url', 'https://opendylan.org/books/drm/', 'html')
16+
# https://www.sphinx-doc.org/en/master/extdev/appapi.html#sphinx.application.Sphinx.add_domain
1517
app.add_domain(DylanDomain)

0 commit comments

Comments
 (0)