Skip to content

Commit

Permalink
Use the sphinx-immaterial for the documentation site. (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartfeenstra authored Feb 9, 2024
1 parent 40242cc commit 5e43fe4
Show file tree
Hide file tree
Showing 18 changed files with 98 additions and 66 deletions.
9 changes: 4 additions & 5 deletions documentation/about.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Security and maintenance
^^^^^^^^^^^^^^^^^^^^^^^^
A Betty site is secure and requires almost no maintenance.

.. note::
.. important::
This is about generated sites. You are still advised to install updates to your installation of Betty when they become available.

What is Betty not?
Expand All @@ -41,10 +41,9 @@ Betty does not help you gather or manage the data for your family history. For t

Find Betty on
-------------
- :fab:`twitter` `Twitter <https://twitter.com/Betty_Project>`_
- :fab:`x-twitter` `X <https://twitter.com/Betty_Project>`_
- :fab:`github` `Github <https://github.com/bartfeenstra/betty>`_
- :fab:`python` `PyPI <https://pypi.org/project/betty>`_
- :si-icon:`fontawesome/brands/twitter` `Twitter <https://twitter.com/Betty_Project>`_
- :si-icon:`fontawesome/brands/github` `Github <https://github.com/bartfeenstra/betty>`_
- :si-icon:`fontawesome/brands/python` `PyPI <https://pypi.org/project/betty>`_

In this section
---------------
Expand Down
2 changes: 1 addition & 1 deletion documentation/about/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Betty is copyright Bart Feenstra and contributors, and released under the **GPL*

GNU General Public License, Version 3
-------------------------------------
.. note::
.. seealso::
`Read more <https://www.gnu.org/licenses/gpl-3.0.en.html>`_ about the **GNU General Public License, Version 3** (also known as the **GPL**).

The following is a verbatim copy of the license.
Expand Down
12 changes: 2 additions & 10 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,7 @@
'conf_py_path': '/documentation/',
'betty_replacements': betty_replacements,
}
html_theme = 'sphinx_rtd_theme'
html_theme_options = {
'collapse_navigation': True,
'sticky_navigation': True,
'prev_next_buttons_location': None,
}
html_css_files = [
'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css',
]
html_theme = 'sphinx_immaterial'
highlight_language = 'none'
templates_path = ['_templates']
extensions = [
Expand All @@ -53,7 +45,7 @@
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinx_design',
'sphinx_tabs.tabs',
'sphinx_immaterial',
]
nitpicky = True
modindex_common_prefix = ['betty.']
Expand Down
2 changes: 1 addition & 1 deletion documentation/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Development

This section covers how to develop Betty itself.

.. note::
.. seealso::
Read :doc:`/about/contributing` if you would like to share your improvements to Betty with the wider community.

Getting started
Expand Down
11 changes: 7 additions & 4 deletions documentation/development/extension.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ to enable and configure your extension for their project.

Given an extension ``my_package.my_module.MyExtension``, add the following to your extension's Python package:

.. tabs::
.. tab:: pyproject.toml
.. md-tab-set::

.. md-tab-item:: pyproject.toml

.. code-block:: toml
[project.entry-points.'betty.extensions']
'my_package.my_module.MyExtension' = 'my_package.my_module.MyExtension'
.. tab:: setup.py
.. md-tab-item:: setup.py

.. code-block:: python
SETUP = {
Expand Down Expand Up @@ -69,7 +72,7 @@ are located. This may be anywhere in your Python package.
Dependencies
------------
.. note::
.. important::
Any dependencies on other Python packages must be declared by your extension's Python package.

Extensions have fine-grained control over which other extensions they require, and the order in
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/ancestry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ analyzed, expanded, and ultimately generated into a site.
In code, you will be using :py:class:`betty.model.ancestry.Ancestry`, through which you can
access any entity of any type.

.. tabs::
.. tab:: Python
.. md-tab-set::

.. md-tab-item:: Python

.. code-block:: python
from betty.model.ancestry import Ancestry, Person
Expand All @@ -36,7 +38,8 @@ access any entity of any type.
ancestry.add(person)
assert person is ancestry[Person]['a1b2']
.. tab:: Jinja2
.. md-tab-item:: Jinja2

.. code-block:: jinja
{% set people = ancestry['Person'] %}
Expand Down
18 changes: 12 additions & 6 deletions documentation/usage/extension/cotton_candy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ The :py:class:`betty.extension.CottonCandy` extension provides Betty's default t

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.CottonCandy: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand All @@ -24,8 +27,10 @@ Configuration
-------------
This extension is configurable through Betty Desktop or in the configuration file:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
Expand All @@ -41,7 +46,8 @@ This extension is configurable through Betty Desktop or in the configuration fil
- entity_type: Place
entity_id: Amsterdam
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/extension/deriver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ the event types used within your site as well as the existing events for each pe

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Deriver: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
18 changes: 12 additions & 6 deletions documentation/usage/extension/gramps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ The :py:class:`betty.extension.Gramps` extension loads entities from `Gramps <ht

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Gramps: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand All @@ -24,8 +27,10 @@ Configuration
-------------
This extension is configurable through Betty Desktop or in the configuration file:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
Expand All @@ -34,7 +39,8 @@ This extension is configurable through Betty Desktop or in the configuration fil
family_trees:
- file: ./gramps.gpkg
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/extension/http_api_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ The :py:class:`betty.extension.HttpApiDoc` extension renders interactive and use

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.HttpApiDoc: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/extension/maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ The :py:class:`betty.extension.Maps` extension renders interactive maps using `L

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Maps: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
15 changes: 9 additions & 6 deletions documentation/usage/extension/nginx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ directory.

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Nginx: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand All @@ -25,8 +28,8 @@ Configuration
-------------
This extension is configurable through Betty Desktop or in the configuration file:

.. tabs::
.. tab:: YAML
.. md-tab-set::
.. md-tab-item:: YAML
.. code-block:: yaml
extensions:
Expand All @@ -35,7 +38,7 @@ This extension is configurable through Betty Desktop or in the configuration fil
www_directory_path: /var/www/betty
https: true
.. tab:: JSON
.. md-tab-item:: JSON
.. code-block:: json
{
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/extension/privatizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,17 @@ Source

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Privatizer: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/extension/trees.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ The :py:class:`betty.extension.Trees` extension renders interactive family trees

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Trees: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
9 changes: 6 additions & 3 deletions documentation/usage/extension/wikipedia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ render them on the entity's page.

Enable this extension through Betty Desktop, or in your project's :doc:`configuration file </usage/project/configuration>` as follows:

.. tabs::
.. tab:: YAML
.. md-tab-set::

.. md-tab-item:: YAML

.. code-block:: yaml
extensions:
betty.extension.Wikipedia: {}
.. tab:: JSON
.. md-tab-item:: JSON

.. code-block:: json
{
Expand Down
2 changes: 1 addition & 1 deletion documentation/usage/project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ You can create and tailor projects through the :doc:`Betty Desktop application</
or through the :doc:`command line </usage/cli>` using :doc:`configuration files </usage/project/configuration>`.


.. note::
.. important::
Betty will consider the directory your project configuration file is located in to be your project directory,
and assumes that the directory will not be used for anything else besides your Betty project.

Expand Down
Loading

0 comments on commit 5e43fe4

Please sign in to comment.