Skip to content

Commit

Permalink
Improve doc with admonitions
Browse files Browse the repository at this point in the history
  • Loading branch information
bruhnild committed Jan 10, 2025
1 parent c5add73 commit ffc9b7f
Show file tree
Hide file tree
Showing 15 changed files with 1,836 additions and 1,611 deletions.
13 changes: 13 additions & 0 deletions docs/_static/extra_css.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/* Remove icon */
.ns-only p.admonition-title::before,
.ns-only-fr p.admonition-title::before,
.ns-detail-fr p.admonition-title::before {
display: none;
}

/* Re-init padding since icon is not displayed anymore */
.ns-only p.admonition-title,
.ns-only-fr p.admonition-title,
.ns-detail-fr p.admonition-title {
padding-left: .6rem !important;
}
46 changes: 37 additions & 9 deletions docs/advanced-configuration/application-settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,44 @@ recipients emails (``ADMINS``, ``MANAGERS``) and email server configuration.
You can test your configuration with the following command. A fake email will
be sent to the managers:

.. code-block:: bash
.. md-tab-set::
:name: sendtestemail-tabs

sudo geotrek sendtestemail --managers
.. md-tab-item:: Default configuration

.. code-block:: bash
sudo geotrek sendtestemail --managers
.. md-tab-item:: Example

.. code-block:: bash
docker compose run --rm web ./manage.py sendtestemail --managers
.. _API:

API
----------------

API_IS_PUBLIC
API is public
~~~~~~~~~~~~~~

Set to ``True`` if you want the API V2 to be available for everyone without authentication (mandatory to use Geotrek-Rando). Set to ``False`` if you don't want to share through API informations marked as 'published'.

Example::
.. md-tab-set::
:name: api-is-public-tabs

.. md-tab-item:: Default configuration

API_IS_PUBLIC = True
.. code-block:: python
API_IS_PUBLIC = False
Default::
.. md-tab-item:: Example

True
.. code-block:: python
API_IS_PUBLIC = True
.. note::
- This API provides access to promotion content (Treks, POIs, Touristic Contents ...).
Expand Down Expand Up @@ -90,9 +107,20 @@ services on each instance.

Start by stopping everything:

.. code-block:: bash
.. md-tab-set::
:name: shutdown-service-tabs

.. md-tab-item:: Default configuration

.. code-block:: bash
sudo systemctl stop geotrek
.. md-tab-item:: Example

sudo systemctl stop geotrek
.. code-block:: bash
docker compose down
Control number of workers and request timeouts
---------------------------------------------------
Expand Down
40 changes: 27 additions & 13 deletions docs/advanced-configuration/attachments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,48 @@ Attachments
View attachments in the browser
---------------------------------

MAPENTITY_CONFIG for medias
Mapentity config for medias
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attached files are downloaded by default by browser, with the following line, files will be opened in the browser :

Example::
.. md-tab-set::
:name: mapentityconfig-medias-tabs

.. md-tab-item:: Default configuration

MAPENTITY_CONFIG['SERVE_MEDIA_AS_ATTACHMENT'] = False
.. code-block:: python
MAPENTITY_CONFIG['SERVE_MEDIA_AS_ATTACHMENT'] = True
Default::
.. md-tab-item:: Example

True
.. code-block:: python
MAPENTITY_CONFIG['SERVE_MEDIA_AS_ATTACHMENT'] = False
Resizing uploaded pictures
----------------------------

PAPERCLIP_RESIZE_ATTACHMENTS_ON_UPLOAD
Paperclip resize attachments on upload
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Attached pictures can be resized at upload by enabling this parameter :

Example::
.. md-tab-set::
:name: paperclip-resize-attachments-medias-tabs

.. md-tab-item:: Default configuration

PAPERCLIP_RESIZE_ATTACHMENTS_ON_UPLOAD = True
.. code-block:: python
PAPERCLIP_RESIZE_ATTACHMENTS_ON_UPLOAD = False
Default::
.. md-tab-item:: Example

False
.. code-block:: python
PAPERCLIP_RESIZE_ATTACHMENTS_ON_UPLOAD = True
These corresponding height/width parameters can be overriden to select resized image size:

Expand All @@ -47,7 +61,7 @@ These corresponding height/width parameters can be overriden to select resized i
Prohibit usage of big pictures and small width / height
---------------------------------------------------------

PAPERCLIP_MAX_BYTES_SIZE_IMAGE
Paperclip max bytes size images
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want to prohibit the usage of heavy pictures:
Expand Down Expand Up @@ -101,7 +115,7 @@ Here is the default value for this setting, which you can extend if needed:
It will verify that the mimetype of the file matches the extension.

PAPERCLIP_EXTRA_ALLOWED_MIMETYPES
Paperclip extra alloawed mimetypes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can add extra allowed mimetypes for a given extension with the following syntax:
Expand All @@ -110,7 +124,7 @@ Example::

PAPERCLIP_EXTRA_ALLOWED_MIMETYPES['gpx'] = ['text/xml']

PAPERCLIP_ALLOWED_EXTENSIONS
Paperclip allowed extensions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also entirely deactivate these checks with the following:
Expand Down
33 changes: 18 additions & 15 deletions docs/advanced-configuration/edition.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Text form fields are enhanced using `TinyMCE <http://tinymce.com>`_.

Its configuration can be customized using advanced settings (see above paragraph).

TINYMCE_DEFAULT_CONFIG
TinyMCE default config
~~~~~~~~~~~~~~~~~~~~~~~

For example, in order to control which buttons are to be shown, and which tags are to be kept when cleaning-up, add this bloc :
Expand All @@ -30,7 +30,7 @@ Example::
Max characters count
---------------------

MAPENTITY_CONFIG for characters
Mapentity for characters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add ``MAX_CHARACTERS_BY_FIELD`` setting to be able to define a maximum number of characters for text fields.
Expand All @@ -49,7 +49,7 @@ Example::
Copyright on pictures
------------------------

THUMBNAIL_COPYRIGHT_FORMAT
Thumbnail copyright format
~~~~~~~~~~~~~~~~~~~~~~~~~~~

If you want copyright added to your pictures, change this parameter like so :
Expand All @@ -64,7 +64,7 @@ Example::

You can also add ``{legend}``: ``"{title}-:-{author}-:-{legend}"``

THUMBNAIL_COPYRIGHT_SIZE
Thumbnail copyright size
~~~~~~~~~~~~~~~~~~~~~~~~~~

Change the size of thumbnail
Expand All @@ -83,8 +83,7 @@ In Facebook developper dashboard, create a Facebook app dedicated to Geotrek-ran

.. image:: /images/facebookappid.png


FACEBOOK_APP_ID
Facebook App ID
~~~~~~~~~~~~~~~~

In ``custom.py`` set Facebook App ID:
Expand Down Expand Up @@ -230,18 +229,22 @@ Test your modifications by exporting a trek or a content to PDF from Geotrek-adm
PDF as booklet
----------------

USE_BOOKLET_PDF
~~~~~~~~~~~~~~~~
Use booklet for PDF:

Use booklet for PDF
.. md-tab-set::
:name: use-booklet-pdf-tabs

Example::
.. md-tab-item:: Default configuration

USE_BOOKLET_PDF = True
.. code-block:: python
USE_BOOKLET_PDF = False
Default::
.. md-tab-item:: Example

False
.. code-block:: python
USE_BOOKLET_PDF = True
.. note::
- During the synchro, pois details will be removed, and the pages will be merged.
Expand Down Expand Up @@ -272,7 +275,7 @@ For more information, check out Ubuntu documentation.
Custom colors in public document template
------------------------------------------

MAPENTITY_CONFIG for custom colors in PDF
Mapentity for custom colors in PDF
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Trek export geometries are translucid red by default. In order to control the apparence of objects in public trek PDF exports, use the following setting:
Expand All @@ -286,7 +289,7 @@ See *Leaflet* reference documentation for detail about layers apparence.
Primary color in PDF templates
-------------------------------

PRIMARY_COLOR
Primary color
~~~~~~~~~~~~~~

You can override ``PRIMARY_COLOR`` to change emphase text in PDF export.
Expand Down
33 changes: 22 additions & 11 deletions docs/advanced-configuration/feedback-report-settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,24 @@ Feedback reports settings
Send acknowledge email
------------------------

SEND_REPORT_ACK
Send report ack
~~~~~~~~~~~~~~~~

If ``False``, no email will be sent to the sender of any feedback on Geotrek-rando website.

Example::
.. md-tab-set::
:name: send-report-ack-tabs

SEND_REPORT_ACK = True
.. md-tab-item:: Default configuration

Default::
.. code-block:: python
SEND_REPORT_ACK = False
.. md-tab-item:: Example

False
.. code-block:: python
SEND_REPORT_ACK = True
.. _suricate-support:

Expand Down Expand Up @@ -223,22 +229,27 @@ Make sure to run these three commands daily to maintain synchronization and upda
geotrek check_timers
geotrek sync_suricate
Display reports with status defined colors
--------------------------------------------

ENABLE_REPORT_COLORS_PER_STATUS
Enable report colors per status
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Go to the Configuration site and select colors to display for each status (`/admin/feedback/reportstatus/`).

Example::
.. md-tab-set::
:name: enable-report-colors-per-status-tabs

ENABLE_REPORT_COLORS_PER_STATUS = True
.. md-tab-item:: Default configuration

Default::
.. code-block:: python
ENABLE_REPORT_COLORS_PER_STATUS = False
.. md-tab-item:: Example

False
.. code-block:: python
ENABLE_REPORT_COLORS_PER_STATUS = True
Use timers to receive alerts for your reports
-------------------------------------------------
Expand Down
Loading

0 comments on commit ffc9b7f

Please sign in to comment.