Skip to content

Commit

Permalink
Add JSON examples to the documentation site.
Browse files Browse the repository at this point in the history
  • Loading branch information
bartfeenstra committed Jan 16, 2024
1 parent 3435420 commit d1f7a27
Show file tree
Hide file tree
Showing 12 changed files with 269 additions and 75 deletions.
1 change: 1 addition & 0 deletions documentation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
'sphinx.ext.viewcode',
'sphinx_autodoc_typehints',
'sphinx_design',
'sphinx_tabs.tabs',
]
nitpicky = True
modindex_common_prefix = ['betty.']
Expand Down
73 changes: 56 additions & 17 deletions documentation/usage/extension/cotton_candy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,68 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.CottonCandy: {}
extensions:
betty.extension.CottonCandy: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.CottonCandy": {}
}
}
Configuration
-------------
This extension is configurable through Betty Desktop or in the configuration file:

.. code-block:: yaml
extensions:
betty.extension.CottonCandy:
configuration:
primary_inactive_color: '#ffc0cb'
primary_active_color: '#ff69b4'
link_inactive_color: '#149988'
link_active_color: '#2a615a'
featured_entities:
- entity_type: Person
entity_id: P123
- entity_type: Place
entity_id: Amsterdam
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.CottonCandy:
configuration:
primary_inactive_color: '#ffc0cb'
primary_active_color: '#ff69b4'
link_inactive_color: '#149988'
link_active_color: '#2a615a'
featured_entities:
- entity_type: Person
entity_id: P123
- entity_type: Place
entity_id: Amsterdam
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.CottonCandy": {
"configuration" : {
"primary_inactive_color": "#ffc0cb",
"primary_active_color": "#ff69b4",
"link_inactive_color": "#149988",
"link_active_color": "#2a615a",
"featured_entities": [
{
"entity_type": "Person",
"entity_id": "P123"
},
{
"entity_type": "Place",
"entity_id": "Amsterdam"
}
]
}
}
}
}
All configuration options
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
17 changes: 14 additions & 3 deletions documentation/usage/extension/deriver.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,21 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Deriver: {}
extensions:
betty.extension.Deriver: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Deriver": {}
}
}
Configuration
-------------
Expand Down
50 changes: 40 additions & 10 deletions documentation/usage/extension/gramps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,52 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Gramps: {}
extensions:
betty.extension.Gramps: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Gramps": {}
}
}
Configuration
-------------
This extension is configurable through Betty Desktop or in the configuration file:

.. code-block:: yaml
extensions:
betty.extension.Gramps:
configuration:
family_trees:
- file: ./gramps.gpkg
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Gramps:
configuration:
family_trees:
- file: ./gramps.gpkg
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Gramps": {
"configuration" : {
"family_trees": [
{
"file": "./gramps.gpkg"
}
]
}
}
}
}
All configuration options
Expand Down
17 changes: 14 additions & 3 deletions documentation/usage/extension/http_api_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.HttpApiDoc: {}
extensions:
betty.extension.HttpApiDoc: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.HttpApiDoc": {}
}
}
Configuration
-------------
Expand Down
17 changes: 14 additions & 3 deletions documentation/usage/extension/maps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,21 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Maps: {}
extensions:
betty.extension.Maps: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Maps": {}
}
}
Configuration
-------------
Expand Down
45 changes: 36 additions & 9 deletions documentation/usage/extension/nginx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,49 @@ automatically when using the ``Dockerfile``.

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

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Nginx: {}
extensions:
betty.extension.Nginx: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Nginx": {}
}
}
Configuration
-------------
This extension is configurable through Betty Desktop or in the configuration file:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Nginx:
configuration:
www_directory_path: /var/www/betty
https: true
extensions:
betty.extension.Nginx:
configuration:
www_directory_path: /var/www/betty
https: true
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Nginx": {
"configuration" : {
"www_directory_path": "/var/www/betty",
"https": true,
}
}
}
}
All configuration options
^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
17 changes: 14 additions & 3 deletions documentation/usage/extension/privatizer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,21 @@ Source

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

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Privatizer: {}
extensions:
betty.extension.Privatizer: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Privatizer": {}
}
}
Configuration
-------------
Expand Down
17 changes: 14 additions & 3 deletions documentation/usage/extension/trees.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Trees: {}
extensions:
betty.extension.Trees: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Trees": {}
}
}
Configuration
-------------
Expand Down
17 changes: 14 additions & 3 deletions documentation/usage/extension/wikipedia.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,21 @@ 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:

.. code-block:: yaml
.. tabs::
.. tab:: YAML
.. code-block:: yaml
extensions:
betty.extension.Wikipedia: {}
extensions:
betty.extension.Wikipedia: {}
.. tab:: JSON
.. code-block:: json
{
"extensions": {
"betty.extension.Wikipedia": {}
}
}
Configuration
-------------
Expand Down
Loading

0 comments on commit d1f7a27

Please sign in to comment.