Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doccumentation issues #10681

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ MAJOR_VERSION ?= $(shell scripts/get-version --major)
MAJOR_MINOR_VERSION ?= $(shell scripts/get-version --major-minor)
VERSION ?= $(shell scripts/get-version --full)
DOCKER_TAG ?= latest
MAIN_BRANCH ?= fake-local-branch
export MAJOR_VERSION
export DOCKER_BUILDKIT=1

Expand Down Expand Up @@ -148,7 +149,7 @@ doc: build-tools ## Generate the documentation
--build-arg=MAJOR_VERSION=$(MAJOR_VERSION) \
--build-arg=MAIN_BRANCH=$(MAIN_BRANCH) \
doc
MAJOR_VERSION=$(MAJOR_VERSION) MAIN_BRANCH=$(MAIN_BRANCH) ci/extract-documentation artifacts/documentations/
ci/extract-documentation artifacts/documentations/


.PHONY: transifex
Expand Down
4 changes: 0 additions & 4 deletions ci/extract-documentation
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#!/bin/bash -eux

mkdir --parent "${1}"
DOCKER_BUILDKIT=1 docker build --tag=camptocamp/geomapfish-doc \
--build-arg="MAJOR_VERSION=${MAJOR_VERSION}" \
--build-arg="MAIN_BRANCH=${MAIN_BRANCH}" \
doc
docker run --rm --name=doc --detach camptocamp/geomapfish-doc tail -f /dev/null
docker cp doc:/doc/_build/html/ "${1}/"
docker stop doc
12 changes: 7 additions & 5 deletions doc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ WORKDIR /doc
ARG MAJOR_VERSION
ARG MAIN_BRANCH

RUN ./import_ngeo_config.py --type Configuration integrator/ngeo_configuration.rst \
--type APIConfig integrator/ngeo_api_configuration.rst \
node_modules/ngeo/dist/typedoc.json integrator/ngeo_other_configuration.rst \

RUN ./import_ngeo_config.py \
--type Configuration /ngeo_configuration.rst \
--type APIConfig /ngeo_api_configuration.rst \
node_modules/ngeo/dist/typedoc.json /ngeo_other_configuration.rst \
&& mv integrator/ngeo_config_ref.rst / \
&& mkdir --parent _build/html \
&& sphinx-build -b html -d _build/doctrees . _build/html \
&& ./build.sh
&& sphinx-build -W -b html -d _build/doctrees . _build/html
13 changes: 0 additions & 13 deletions doc/build.sh

This file was deleted.

6 changes: 5 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {"github_user": "camptocamp", "github_repo": "c2cgeoportal", "github_banner": True}
html_theme_options = {
"github_user": "camptocamp",
"github_repo": "c2cgeoportal",
"github_banner": False,
}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
Expand Down
6 changes: 5 additions & 1 deletion doc/import_ngeo_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ def main() -> None:
"""Convert the ngeo config to ReStructuredText."""
parser = argparse.ArgumentParser("Convert the config from the JSON from typedoc to ReStructuredText")
parser.add_argument(
"--type", help="create a separate file for a type", nargs=2, action="append", default=[]
"--type",
help="create a separate file for a type",
nargs=2,
action="append",
default=[],
)
parser.add_argument("input", help="the JSON file from typedoc")
parser.add_argument("other", help="filename for other types")
Expand Down
34 changes: 16 additions & 18 deletions doc/integrator/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ application's main ``__init__.py`` file.

In the file ``env.project``, you can configure the policy with the following variables:

.. code::

AUTHTKT_TIMEOUT # Default to one day.
AUTHTKT_REISSUE_TIME # Default to 2h30, recommended to be 10 times smaller than AUTHTKT_TIMEOUT.
AUTHTKT_MAXAGE # Default to one day, good to have the same value as AUTHTKT_TIMEOUT.
AUTHTKT_SECRET # Should be defined
AUTHTKT_COOKIENAME
AUTHTKT_HTTP_ONLY # Default to true.
AUTHTKT_SECURE # Default to true.
AUTHTKT_SAMESITE # Default to Lax.
``AUTHTKT_TIMEOUT``: Default to one day.
``AUTHTKT_REISSUE_TIME``: Default to 2h30, recommended to be 10 times smaller than ``AUTHTKT_TIMEOUT``.
``AUTHTKT_MAXAGE``: Default to one day, good to have the same value as ``AUTHTKT_TIMEOUT``.
``AUTHTKT_SECRET``: Should be defined
``AUTHTKT_COOKIENAME``: Should be defined
``AUTHTKT_HTTP_ONLY``: Default to ``true``.
``AUTHTKT_SECURE``: Default to ``true``.
``AUTHTKT_SAMESITE``: Default to ``Lax``.

.. note::

Expand Down Expand Up @@ -158,23 +156,23 @@ Some service of GeoMapFish has some host restriction if you mix the domain.
Application authentication
~~~~~~~~~~~~~~~~~~~~~~~~~~

To be considered as authenticated we should have the correct `Cookie` header,
we also check the `Referrer` header to be sure that the user is coming from the same domain.
If he is equals to the `Host` header, we consider that the user is coming from the same domain.
To be considered as authenticated we should have the correct ``Cookie`` header,
we also check the ``Referer`` header to be sure that the user is coming from the same domain.
If he is equals to the ``Host`` header, we consider that the user is coming from the same domain.
If your server and client application are not on the same domain, to make the login working,
you should add the client application domain name (with port) in the vars in `vars/authorized_referers`.
you should add the client application domain name (with port) in the vars in ``vars/authorized_referers``.

This check is also done on the `came_from` parameter during the login process.
This check is also done on the ``came_from`` parameter during the login process.

Shortener
~~~~~~~~~

If you use the shortener service to create link on application on another domain name, you should add
this domain name in the vars in `vars/shortener/allowed_hosts`.
this domain name in the vars in ``vars/shortener/allowed_hosts``.

Admin
~~~~~

We provide a view for the admin interface, to be able to clear the cache per OGC server.
If for an unknown reason you have not the same host in the `Host` header and `came_from` parameter, you should
add the domain of the `came_from` parameter in the vars in `vars/admin_interface/allowed_hosts`.
If for an unknown reason you have not the same host in the ``Host`` header and ``came_from`` parameter, you should
add the domain of the ``came_from`` parameter in the vars in ``vars/admin_interface/allowed_hosts``.
2 changes: 1 addition & 1 deletion doc/integrator/c2cwsgiutils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
C2C WSGI Utils
==============

``c2cwsgiutils`` is a framework assisting in development, integration and administration of WSGI applications.
``c2cwsgiutils`` is a framework assisting in development, integration and administration of WSGI applications.
``c2cgeoportal`` uses ``c2cwsgiutils``.
See its `documentation <https://github.com/camptocamp/c2cwsgiutils/#camptocamp-wsgi-utilities>`__.

Expand Down
1 change: 1 addition & 0 deletions doc/integrator/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ For OpenShift projects:
tinyows -.-> postgres;

classDef data fill:#5ba6ff,color:black;

For standalone projects:

.. mermaid::
Expand Down
2 changes: 1 addition & 1 deletion doc/integrator/extend_application.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ For that you will need to create a new folder named ``geoportal_custom``.

An this folder, add a file named ``authentication.py`` with the content you need, the original content is:

.. code:: python:
.. code:: python

from pyramid.config import Configurator

Expand Down
9 changes: 5 additions & 4 deletions doc/integrator/fulltext_search.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ Note that some tree items' metadata are used by the ``theme2fts`` script:
that is to say that considered tree item will match when searching for the search aliases.
* ``searchLabelPattern``: Template string for the label of tree items in the search results, for example:
``{name} ({theme})``. The supported parameters are:
* name: name of the tree item
* parent: parent of the item (may be a group, a block or a theme)
* block: name of the block to which the item belongs
* theme: name of the theme to which the item belongs

* ``name``: name of the tree item
* ``parent``: parent of the item (may be a group, a block or a theme)
* ``block``: name of the block to which the item belongs
* ``theme``: name of the theme to which the item belongs


Security
Expand Down
2 changes: 1 addition & 1 deletion doc/integrator/headers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You may wish to override the values being written. All this is done in the confi
cache_control_max_age: 600 # 10 minutes
access_control_max_age: 600 # 10 minutes
access_control_allow_origin: [] # list oh hosts (e.g. https://example.com) or '*'
headers: {} @ list of additional headers
headers: {} # list of additional headers

Where ``<view>`` can be: ``dynamic``, ``index``, ``api``, ``apihelp``, ``profile``, ``raster``, ``error``,
``themes``, ``config``, ``print``, ``fulltextsearch``, ``mapserver``, ``tinyows``, ``layers``,
Expand Down
9 changes: 5 additions & 4 deletions doc/integrator/https.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-----
HTTPS
-----

Expand All @@ -12,7 +13,7 @@ There are two ways to manage this:
* application and SSL certificate on the same server

Application behind a proxy
~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------

If the application is placed behind some proxy that removes the SSL encryption
(plain HTTP is used between the proxy and the server), then some specific
Expand All @@ -35,7 +36,7 @@ value of ``request.scheme``. For example::
};

Application and SSL certificate on the same server
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------------------------------

If the SSL certificate and the application are located on the same server, all
requests will be redirected to https. So you should change the scheme to https
Expand All @@ -52,7 +53,7 @@ In case you load http external resources into your application, you should use
the resourceproxy service as described below.

Loading non https external resources
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------------------------------------

If you want to load non https external resources in your https application, you
should use the ``resourceproxy`` service and add the list of hosts you want to access in your project
Expand All @@ -74,7 +75,7 @@ For example:
``https://geoportail.camptocamp.com/main/resourceproxy?target=rfinfo&values=(175,2633)``

Local certificate checks
~~~~~~~~~~~~~~~~~~~~~~~~
------------------------

Certain c2cgeoportal features open a http session to your c2cgeoportal services,
for example the ``checker`` or the ``lingua_extractor``.
Expand Down
8 changes: 4 additions & 4 deletions doc/integrator/ngeo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,18 @@ The dynamic values names are:
Ngeo configuration options
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ngeo_configuration.rst
.. include:: //ngeo_configuration.rst

Ngeo API configuration options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ngeo_api_configuration.rst
.. include:: //ngeo_api_configuration.rst

Ngeo internal object configuration options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. include:: ngeo_config_ref.rst
.. include:: ngeo_other_configuration.rst
.. include:: //ngeo_config_ref.rst
.. include:: //ngeo_other_configuration.rst


CSS style
Expand Down
74 changes: 59 additions & 15 deletions doc/integrator/ngeo_config_ref.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,107 @@ Define additional types used in the config

.. _integrator_guide_ngeo_properties_GeoJSON.FeatureCollection:

~~~~~~~~~~~~~~~~~
FeatureCollection
~~~~~~~~~~~~~~~~~
-----------------

See `FeatureCollection <https://datatracker.ietf.org/doc/html/rfc7946#section-3.3>`_.


.. _integrator_guide_ngeo_properties_OlFeature:

~~~~~~~~~~
ol.Feature
~~~~~~~~~~
----------

See `ol.Feature <https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html>`_.


.. _integrator_guide_ngeo_properties_OlGeomGeometry:

~~~~~~~~~~~~~~~~
ol.geom.Geometry
~~~~~~~~~~~~~~~~
----------------

See `ol.geom.Geometry <https://openlayers.org/en/latest/apidoc/module-ol_geom_Geometry-Geometry.html>`_.


.. _integrator_guide_ngeo_properties_OlControlControl:

~~~~~~~~~~~~~~~~~~
ol.control.Control
~~~~~~~~~~~~~~~~~~
------------------

See `ol.control.Control <https://openlayers.org/en/latest/apidoc/module-ol_control_Control-Control.html>`_.


.. _integrator_guide_ngeo_properties_OlInteractionInteraction:

~~~~~~~~~~~~~~~~~~~~~~~~~~
ol.interaction.interaction
~~~~~~~~~~~~~~~~~~~~~~~~~~
--------------------------

See `ol.control.Control <https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html>`_.
See `ol.interaction.interaction <https://openlayers.org/en/latest/apidoc/module-ol_interaction_Interaction-Interaction.html>`_.


.. _integrator_guide_ngeo_properties_Bloodhound.BloodhoundOptions:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bloodhound.BloodhoundOptions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
----------------------------

See `Bloodhound Usage <https://github.com/twitter/typeahead.js/blob/master/doc/bloodhound.md#usage>`_.



.. _integrator_guide_ngeo_properties_Twitter.Typeahead.Dataset:

~~~~~~~~~~~~~~~~~~~~~~~~~
Twitter.Typeahead.Dataset
~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------

See `Typeahead Dataset <https://github.com/corejavascript/typeahead.js/blob/master/doc/jquery_typeahead.md#datasets>`_.

.. _integrator_guide_ngeo_properties_zextractorfunction:

ZExtractorFunction
------------------

.. code: javascript

(point: number[]) => number;

.. _integrator_guide_ngeo_properties_regexp:

RegExp
------

See `RegExp <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp>`_.

.. _integrator_guide_ngeo_properties_canvaslinecap:

lineCap
-------

See `lineCap <https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap#options>`_.

.. _integrator_guide_ngeo_properties_canvaslinejoin:

lineJoin
--------

See `lineJoin <https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin#options>`_.

.. _integrator_guide_ngeo_properties_olcontrolzoomoptions:

ol.control.ZoomOptions
----------------------

See `ol.control.ZoomOptions <https://openlayers.org/en/latest/apidoc/module-ol_control_Zoom-Zoom.html>`_.

.. _integrator_guide_ngeo_properties_olinteractiondefaultsoptions:

ol.interaction.DefaultsOptions
------------------------------

See `ol.interaction.DefaultsOptions <https://openlayers.org/en/latest/apidoc/module-ol_interaction_defaults.html>`_.

.. _integrator_guide_ngeo_properties_initoptions:

i18next.InitOptions
-------------------

See `i18next.InitOptions <https://www.i18next.com/overview/api#init>`_.
Loading
Loading