Skip to content

Commit 3979687

Browse files
authored
Update Sphinx theme to Furo (#909)
1 parent 4278e0d commit 3979687

File tree

12 files changed

+47
-37
lines changed

12 files changed

+47
-37
lines changed

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ jobs:
8383
# VERSION with the minimal possible Basilisp dependencies
8484
# versions.
8585
#
86-
# For dependencies to be elligible for minimum version testing,
86+
# For dependencies to be eligible for minimum version testing,
8787
# they should be declared in `pyproject.toml` as such in the
8888
# following format
8989
#

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Fix a bug where `.` characters were not allowed in keyword names (#899)
1616
* Fix a bug where nested quotation marks were not escaped properly by various print functions and at the REPL (#894)
1717

18+
### Other
19+
* Update Sphinx documentation theme (#909)
20+
* Fix a few minor documentation issues (#907)
21+
1822
## [v0.1.0b2]
1923
### Added
2024
* Added filename metadata to compiler exceptions (#844)

docs/compiler.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Since the compiler cannot reason about larger units of code, it cannot make infe
1313

1414
There are three steps to the Basilisp compiler: analysis, generation, and optimization.
1515
After a Basilisp form is read in by the :ref:`reader`, it is passed off to the analyzer to produce an abstract syntax tree.
16-
The generator reads the AST and produces Python code (*not* bytecode) using Python's builtin `ast <https://docs.python.org/3/library/ast.html>`_ module.
16+
The generator reads the AST and produces Python code (*not* bytecode) using Python's builtin :external:py:mod:`ast` module.
1717
Afterwards, the compiler passes the generated AST through a quick optimization phase to remove redundant branches and other artifacts of code generation.
1818
From there, the compiler injects the compiled code into a dynamically-generated Python module which is associated with a Basilisp Namespace and executes the code so the generated objects are available.
1919

@@ -182,7 +182,7 @@ Debugging
182182

183183
The compiler generates Python code by generating Python AST nodes, rather than emitting the raw Python code as text.
184184
This is convenient for the compiler, but inspecting Python AST nodes manually for bugs can be a bit of a challenge even with a debugger.
185-
For this reason, the Basilisp compiler can also use the `ast.unparse <https://docs.python.org/3/library/ast.html#ast.unparse>`_ (`astor <https://github.com/berkerpeksag/astor>`_ in versions of Python prior to 3.9) library to generate raw Python code for visual inspection.
185+
For this reason, the Basilisp compiler can also use the :external:py:func:`ast.unparse` (`astor <https://github.com/berkerpeksag/astor>`_ in versions of Python prior to 3.9) library to generate raw Python code for visual inspection.
186186

187187
Currently, the compiler is configured to automatically generate Python code for all namespaces.
188188
This code generation isn't slow, but it does add an appreciable amount of time to the compilation of each individual namespace.

docs/conf.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,11 @@
66
# full list see the documentation:
77
# http://www.sphinx-doc.org/en/master/config
88

9-
# -- Path setup --------------------------------------------------------------
10-
11-
# If extensions (or modules to document with autodoc) are in another directory,
12-
# add these directories to sys.path here. If the directory is relative to the
13-
# documentation root, use os.path.abspath to make it absolute, like shown here.
14-
#
15-
# import os
16-
# import sys
17-
# sys.path.insert(0, os.path.abspath('.'))
18-
199

2010
# -- Project information -----------------------------------------------------
2111

2212
project = "Basilisp"
23-
copyright = "2018-2023, Chris Rink"
13+
copyright = "2018-2024, Chris Rink"
2414
author = "Chris Rink"
2515

2616
# The short X.Y version
@@ -37,7 +27,11 @@
3727
# Add any Sphinx extension module names here, as strings. They can be
3828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3929
# ones.
40-
extensions = ["sphinx.ext.autodoc", "basilisp.contrib.sphinx"]
30+
extensions = [
31+
"sphinx.ext.autodoc",
32+
"sphinx.ext.intersphinx",
33+
"basilisp.contrib.sphinx",
34+
]
4135

4236
# Add any paths that contain templates here, relative to this directory.
4337
templates_path = ["_templates"]
@@ -74,13 +68,18 @@
7468
# The theme to use for HTML and HTML Help pages. See the documentation for
7569
# a list of builtin themes.
7670
#
77-
html_theme = "sphinx_rtd_theme"
71+
html_theme = "furo"
7872

7973
# Theme options are theme-specific and customize the look and feel of a theme
8074
# further. For a list of options available for each theme, see the
8175
# documentation.
8276
#
83-
html_theme_options = {"collapse_navigation": False}
77+
html_title = "Basilisp"
78+
html_theme_options = {
79+
"source_repository": "https://github.com/basilisp-lang/basilisp/",
80+
"source_branch": "main",
81+
"source_directory": "docs/",
82+
}
8483

8584
# Add any paths that contain custom static files (such as style sheets) here,
8685
# relative to this directory. They are copied after the builtin static files,
@@ -145,7 +144,7 @@
145144
"Basilisp Documentation",
146145
author,
147146
"Basilisp",
148-
"One line description of project.",
147+
"A Clojure-like lisp written for Python",
149148
"Miscellaneous",
150149
)
151150
]
@@ -167,4 +166,8 @@
167166
# A list of files that should not be packed into the epub file.
168167
epub_exclude_files = ["search.html"]
169168

170-
# -- Extension configuration -------------------------------------------------
169+
# -- Options for Intersphinx -------------------------------------------------
170+
171+
intersphinx_mapping = {
172+
"python": ("https://docs.python.org/3", None),
173+
}

docs/contributing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ We accept the following types of contributions:
1212
Bugs may sometimes be fixed in unreleased code, so be sure to look at the `CHANGELOG <https://github.com/basilisp-lang/basilisp/blob/main/CHANGELOG.md>`_ in the ``main`` branch to see if the fix has simply not yet been released.
1313

1414
* **Feature Requests:** Submit a new issue on GitHub reporting a feature request.
15-
Because Basilisp targets a high degree of compatibility with Clojure, feature requests should generally be for features from Clojure which have not yet been implemented in Basilisp.
15+
Basilisp targets a reasonable degree of compatibility with Clojure, so feature requests should generally be for features from Clojure which have not yet been implemented in Basilisp.
1616
Occasionally, new features outside of the scope of Clojure compatibility may be covered, in particular if the feature is related to a Python ecosystem affordance.
1717

1818
* **Documentation:** Documentation is hard.

docs/differencesfromclojure.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ In Clojure, this optimistic equality comparison is performed by the ``==`` funct
4343

4444
.. note::
4545

46-
Basilisp's ``=`` will perform as expected when using Python `Decimal <https://docs.python.org/3/library/decimal.html>`__ typed :ref:`floating_point_numbers`.
46+
Basilisp's ``=`` will perform as expected when using Python :external:py:class:`decimal.Decimal` typed :ref:`floating_point_numbers`.
4747

4848
.. seealso::
4949

@@ -79,8 +79,8 @@ Reader
7979

8080
* Python integers natively support unlimited precision, so there is no difference between regular integers and those suffixed with ``N`` (which are read as ``BigInt``\s in Clojure).
8181
* Floating point numbers are read as Python ``float``\s by default and subject to the limitations of that type on the current Python VM.
82-
Floating point numbers suffixed with ``M`` are read as Python `Decimal <https://docs.python.org/3/library/decimal.html#decimal.Decimal>`_ types and support user-defined precision.
83-
* Ratios are supported and are read in as Python `Fraction <https://docs.python.org/3/library/fractions.html#fractions.Fraction>`_ types.
82+
Floating point numbers suffixed with ``M`` are read as Python :external:py:class:`decimal.Decimal` types and support user-defined precision.
83+
* Ratios are supported and are read in as Python :external:py:class:`fractions.Fraction` types.
8484
* Python natively supports Complex numbers.
8585
The reader will return a complex number for any integer or floating point literal suffixed with ``J``.
8686

@@ -97,7 +97,7 @@ Reader
9797
Regular Expressions
9898
-------------------
9999

100-
Basilisp regular expressions use Python's `regular expression <https://docs.python.org/3/library/re.html>`_ syntax and engine.
100+
Basilisp regular expressions use Python's :external:py:mod:`regular expression <re>` syntax and engine.
101101

102102
.. _repl_differences:
103103

@@ -194,7 +194,7 @@ Type Hinting
194194

195195
Type hints may be applied anywhere they are supported in Clojure (as the ``:tag`` metadata key), but the compiler does not currently use them for any purpose.
196196
Tags provided for ``def`` names, function arguments and return values, and :lpy:form:`let` locals will be applied to the resulting Python AST by the compiler wherever possible.
197-
Particularly in the case of function arguments and return values, these tags maybe introspected from the Python `inspect <https://docs.python.org/3/library/inspect.html>`_ module.
197+
Particularly in the case of function arguments and return values, these tags maybe introspected from the Python :external:py:mod:`inspect` module.
198198
There is no need for type hints anywhere in Basilisp right now, however.
199199

200200
.. _compilation_differences:

docs/gettingstarted.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ For systems where the shebang line allows arguments, you can use ``#!/usr/bin/en
135135
(println "Hello world!")
136136
137137
Finally, Basilisp has a command line option to bootstrap your Python installation such that Basilisp will already be importable whenever Python is started.
138-
This takes advantage of the ``.pth`` file feature supported by the `site <https://docs.python.org/3/library/site.html>`_ package.
138+
This takes advantage of the ``.pth`` file feature supported by the :external:py:mod:`site` package.
139139
Specifically, any file with a ``.pth`` extension located in any of the known ``site-packages`` directories will be read at startup and, if any line of such a file starts with ``import``, it is executed.
140140

141141
.. code-block:: bash

docs/pyinterop.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ Basilisp supports passing type hints through to the underlying generated Python
220220
In Clojure, these tags are type declarations for certain primitive types.
221221
In Clojurescript, tags are type *hints* and they are only necessary in extremely limited circumstances to help the compiler.
222222
In Basilisp, tags are not used by the compiler at all.
223-
Instead, tags applied to function arguments and return values in Basilisp are applied to the underlying Python objects and are introspectable at runtime using the Python `inspect <https://docs.python.org/3/library/inspect.html>`_ standard library module.
223+
Instead, tags applied to function arguments and return values in Basilisp are applied to the underlying Python objects and are introspectable at runtime using the Python :external:py:mod:`inspect` standard library module.
224224

225225
Type hints may be applied to :lpy:form:`def` names, function arguments and return values, and :lpy:form:`let` local forms.
226226

@@ -259,4 +259,4 @@ In Clojure, the ``clojure.core/quot`` function utilizes Java's long division ope
259259

260260
Basilisp has chosen to adopt the same mathematical formulae as Clojure for these three functions, rather than using the Python's built in operators under all cases. This approach offers the advantage of enhanced cross-platform compatibility without requiring modification, and ensures compatibility with examples in `ClojureDocs <https://clojuredocs.org/>`_.
261261

262-
Users still have the option to use the native `operator/floordiv <https://docs.python.org/3/library/operator.html#operator.floordiv>`_, i.e. Python's ``//`` operator, if they prefer so.
262+
Users still have the option to use the native :external:py:func:`operator.floordiv`, i.e. Python's ``//`` operator, if they prefer so.

docs/reader.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Floating point values are represented using ``0-9`` and a trailing decimal value
7171
Like integers, floating point values may be prefixed with a single negative sign ``-``.
7272
By default floating point values are represented by Python's ``float`` type, which does **not** support arbitrary precision by default.
7373
Like in Clojure, floating point literals may be specified with a single ``M`` suffix to specify an arbitrary-precision floating point value.
74-
In Basilisp, a floating point number declared with a trailing ``M`` will return Python's `Decimal <https://docs.python.org/3/library/decimal.html>`_ type, which supports arbitrary floating point arithmetic.
74+
In Basilisp, a floating point number declared with a trailing ``M`` will return Python's :external:py:class:`decimal.Decimal` type, which supports arbitrary floating point arithmetic.
7575

7676
.. _scientific_notation:
7777

@@ -125,7 +125,7 @@ Ratios
125125
Basilisp includes support for ratios.
126126
Ratios are represented as the division of 2 integers which cannot be reduced to an integer.
127127
As with integers and floats, the numerator of a ratio may be prefixed with a single negative sign ``-`` -- a negative sign may not appear in the denominator.
128-
In Basilisp, ratios are backed by Python's `Fraction <https://docs.python.org/3/library/fractions.html>`_ type, which is highly interoperable with other Python numeric types.
128+
In Basilisp, ratios are backed by Python's :external:py:class:`fractions.Fraction` type, which is highly interoperable with other Python numeric types.
129129

130130
.. _strings:
131131

@@ -391,7 +391,7 @@ Reader macros are always dispatched using the ``#`` character.
391391
* ``#'form`` is rewritten as ``(var form)``.
392392
* ``#_form`` causes the reader to completely ignore ``form``.
393393
* ``#!form`` is treated as a single-line comment (like ``;form``) as a convenience to support `shebangs <https://en.wikipedia.org/wiki/Shebang_(Unix)>`_ at the top of Basilisp scripts.
394-
* ``#"str"`` causes the reader to interpret ``"str"`` as a regex and return a Python `re.pattern <https://docs.python.org/3/library/re.html>`_.
394+
* ``#"str"`` causes the reader to interpret ``"str"`` as a regex and return a Python :external:py:mod:`re.pattern <re>`.
395395
* ``#(...)`` causes the reader to interpret the contents of the list as an anonymous function. Anonymous functions specified in this way can name arguments using ``%1``, ``%2``, etc. and rest args as ``%&``. For anonymous functions with only one argument, ``%`` can be used in place of ``%1``.
396396

397397
.. _data_readers:
@@ -407,8 +407,8 @@ User-specified data reader symbols must include a namespace, but builtin data re
407407

408408
Basilisp supports a few builtin data readers:
409409

410-
* ``#inst "2018-09-14T15:11:20.253-00:00"`` yields a Python `datetime <https://docs.python.org/3/library/datetime.html#datetime-objects>`_ object.
411-
* ``#uuid "c3598794-20b4-48db-b76e-242f4405743f"`` yields a Python `UUID <https://docs.python.org/3/library/uuid.html#uuid.UUID>`_ object.
410+
* ``#inst "2018-09-14T15:11:20.253-00:00"`` yields a Python :external:py:class:`datetime.datetime` object.
411+
* ``#uuid "c3598794-20b4-48db-b76e-242f4405743f"`` yields a Python :external:py:class`uuid.UUID` object.
412412

413413
One of the benefits of choosing Basilisp is convenient built-in Python language interop.
414414
However, the immutable data structures of Basilisp may not always play nicely with code written for (and expecting to be used by) other Python code.

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# to maintain consistent output during both development and publishing
33
# on Read The Docs.
44
sphinx>=7.1.0,<8.0.0
5-
sphinx-rtd-theme>=2.0.0,<3.0.0
5+
furo==2024.04.27
66
sphinxcontrib-applehelp>=1.0.8,<2.0.0
77
sphinxcontrib-devhelp>=1.0.6,<2.0.0
88
sphinxcontrib-htmlhelp>=2.0.5,<3.0.0

0 commit comments

Comments
 (0)