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

New doc style with sphinx-immaterial. Harmonize with Geotrek-rando #4358

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ENV TZ=UTC

WORKDIR /opt/geotrek-admin
RUN mkdir -p /opt/geotrek-admin/var/log /opt/geotrek-admin/var/cache
RUN useradd -M -s /bin/false geotrek && chown geotrek:geotrek -R /opt
RUN useradd -m -d /opt/geotrek-admin -s /bin/false geotrek && chown geotrek:geotrek -R /opt

# Install postgis because raster2pgsl is required by manage.py loaddem
RUN apt-get update -qq && apt-get install -y -qq \
Expand Down
94 changes: 74 additions & 20 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import sphinx_rtd_theme # noqa
import datetime
import os

root = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))

extensions = [
'sphinx.ext.todo',
'sphinx_rtd_theme',
"sphinx_immaterial"
]

html_theme = 'sphinx_immaterial'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand All @@ -16,29 +19,78 @@
master_doc = 'index'

# General information about the project.
project = 'Geotrek'
project = 'Geotrek-admin'
copyright = f'2013-{datetime.date.today().year}, Makina Corpus'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '2.109'
# The full version, including alpha/beta/rc tags.
release = '2.109.3+dev'

exclude_patterns = ['_build']

pygments_style = 'sphinx'

html_theme = 'sphinx_rtd_theme'

html_logo = "_static/logo.svg"

# Material theme options (see theme.conf for more information)
html_theme_options = {
"logo_only": True,
'style_external_links': True,
"icon": {
"repo": "fontawesome/brands/github",
"edit": "material/file-edit-outline",
},
"site_url": "https://geotrek.fr/",
"repo_url": "https://github.com/GeotrekCE/Geotrek-admin/",
"repo_name": "Geotrek-admin",
"edit_uri": "blob/main/docs",
"globaltoc_collapse": True,
"features": [
"navigation.expand",
# "navigation.tabs",
# "toc.integrate",
"navigation.sections",
# "navigation.instant",
# "header.autohide",
"navigation.top",
# "navigation.tracking",
# "search.highlight",
"search.share",
"toc.follow",
"toc.sticky",
"content.tabs.link",
"announce.dismiss",
],
"palette": [
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "green",
"accent": "light green",
"toggle": {
"icon": "material/weather-night",
"name": "Switch to dark mode",
},
},
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "green",
"accent": "light green",
"toggle": {
"icon": "material/weather-sunny",
"name": "Switch to light mode",
},
},
],
"social": [
{
"icon": "fontawesome/brands/github",
"link": "https://github.com/GeotrekCE/Geotrek-admin"
},
{
"icon": "fontawesome/brands/linkedin",
"link": "https://www.linkedin.com/company/geotrek-application",
},
],
"toc_title_is_page_title": True,
}

html_favicon = "_static/favicon.png"

html_static_path = ['_static']
Expand All @@ -47,17 +99,19 @@
htmlhelp_basename = 'Geotrekdoc'

latex_documents = [
('index', 'Geotrek.tex', 'Geotrek Documentation',
('index', 'Geotrek.tex', 'Geotrek-admin Documentation',
'Makina Corpus', 'manual'),
]

man_pages = [
('index', 'geotrek', 'Geotrek Documentation',
('index', 'geotrek', 'Geotrek-admin Documentation',
['Makina Corpus'], 1)
]

html_sidebars = {
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
}
texinfo_documents = [
('index', 'Geotrek', 'Geotrek Documentation',
'Makina Corpus', 'Geotrek', 'One line description of project.',
('index', 'Geotrek', 'Geotrek-admin Documentation',
'Makina Corpus', 'Geotrek-admin', 'One line description of project.',
'Miscellaneous'),
]
6 changes: 4 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Welcome to Geotrek's documentation!
===================================
Geotrek-admin's documentation
=============================

Geotrek-admin is backend management data for Geotrek-rando, Geotrek-mobile and Geotrek-widget.

.. toctree::
:caption: 💡 About
Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-c ../dev-requirements.in

sphinx-rtd-theme>=1.0.0
sphinx_immaterial
sphinx>=4.0.0
sphinx-autobuild
sphinx-intl
76 changes: 45 additions & 31 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,109 +2,123 @@
# This file is autogenerated by pip-compile with Python 3.8
# by the following command:
#
# pip-compile --strip-extras docs/requirements.in
# pip-compile
#
alabaster==0.7.13
# via sphinx
babel==2.15.0
annotated-types==0.7.0
# via pydantic
appdirs==1.4.4
# via sphinx-immaterial
babel==2.16.0
# via
# sphinx
# sphinx-intl
certifi==2024.8.30
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# requests
charset-normalizer==3.3.2
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# requests
click==8.1.3
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# sphinx-intl
colorama==0.4.6
# via sphinx-autobuild
docutils==0.20.1
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# sphinx
# sphinx-rtd-theme
idna==3.7
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# requests
imagesize==1.4.1
# via sphinx
importlib-metadata==6.8.0
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# sphinx
jinja2==3.1.4
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# sphinx
livereload==2.6.3
livereload==2.7.0
# via sphinx-autobuild
markupsafe==2.1.5
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# jinja2
# sphinx-immaterial
packaging==24.0
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# sphinx
pydantic==2.9.2
# via
# pydantic-extra-types
# sphinx-immaterial
pydantic-core==2.23.4
# via pydantic
pydantic-extra-types==2.10.0
# via sphinx-immaterial
pygments==2.18.0
# via sphinx
pytz==2023.3.post1
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# babel
requests==2.32.3
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# sphinx
six==1.16.0
# via
# -c docs/../requirements.txt
# livereload
# sphinx-immaterial
snowballstemmer==2.2.0
# via sphinx
sphinx==7.1.2
# via
# -r docs/requirements.in
# -r requirements.in
# sphinx-autobuild
# sphinx-immaterial
# sphinx-intl
# sphinx-rtd-theme
# sphinxcontrib-jquery
sphinx-autobuild==2021.3.14
# via -r docs/requirements.in
# via -r requirements.in
sphinx-immaterial==0.11.14
# via -r requirements.in
sphinx-intl==2.2.0
# via -r docs/requirements.in
sphinx-rtd-theme==2.0.0
# via -r docs/requirements.in
# via -r requirements.in
sphinxcontrib-applehelp==1.0.4
# via sphinx
sphinxcontrib-devhelp==1.0.2
# via sphinx
sphinxcontrib-htmlhelp==2.0.1
# via sphinx
sphinxcontrib-jquery==4.1
# via sphinx-rtd-theme
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.3
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
tornado==6.4
tornado==6.4.1
# via livereload
typing-extensions==4.12.2
# via
# -c ../requirements.txt
# annotated-types
# pydantic
# pydantic-core
# pydantic-extra-types
# sphinx-immaterial
urllib3==2.2.2
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# requests
zipp==3.20.2
# via
# -c docs/../requirements.txt
# -c ../requirements.txt
# importlib-metadata

# The following packages are considered to be unsafe in a requirements file:
Expand Down
Loading