Skip to content

Commit a82f6d0

Browse files
committed
Merge branch 'docs'
2 parents 4209a8c + 83c61fc commit a82f6d0

373 files changed

Lines changed: 77860 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Read the Docs configuration file for MkDocs projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
# Adding the following, ask proposed by readthedocs.io documentation
9+
# makes the build fail after a while for eccessive memory consumption
10+
# See https://github.com/readthedocs/readthedocs.org/issues/10585
11+
build:
12+
os: ubuntu-22.04
13+
tools:
14+
python: "3.10"
15+
16+
mkdocs:
17+
configuration: docs/mkdocs.yml
18+
19+
# Optionally declare the Python requirements required to build your docs
20+
python:
21+
install:
22+
- requirements: docs/requirements.txt

docs/Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM python:3.11-slim
2+
3+
ARG UID=1000
4+
ARG GID=1000
5+
ARG USER=dev
6+
ARG HOME=/home/dev
7+
ARG APP=/app
8+
9+
RUN apt-get update && apt-get install -y --no-install-recommends \
10+
bash ca-certificates \
11+
git curl \
12+
adduser \
13+
libglib2.0-0 \
14+
libcairo2 \
15+
libpango-1.0-0 \
16+
libpangocairo-1.0-0 \
17+
libpangoft2-1.0-0 \
18+
libgdk-pixbuf-2.0-0 \
19+
&& rm -rf /var/lib/apt/lists/* \
20+
&& addgroup --gid "${GID}" "${USER}" \
21+
&& adduser --disabled-password --gecos "" \
22+
--uid "${UID}" --gid "${GID}" \
23+
--home "${HOME}" \
24+
"${USER}"
25+
26+
WORKDIR ${APP}
27+
28+
COPY docs/requirements.txt ${APP}/requirements.txt
29+
COPY mkdocs.yml ${APP}/mkdocs.yml
30+
COPY pdf_event_hook.py ${APP}/pdf_event_hook.py
31+
32+
RUN python -m venv ${APP}/.venv \
33+
&& ${APP}/.venv/bin/pip install --upgrade pip wheel setuptools \
34+
&& ${APP}/.venv/bin/pip install -r ${APP}/requirements.txt
35+
36+
ENV VIRTUAL_ENV=${APP}/.venv
37+
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
38+
39+
RUN chown -R "${UID}:${GID}" "${APP}" "${HOME}"
40+
41+
USER ${USER}
42+
CMD ["bash"]

docs/LICENSE

Lines changed: 66 additions & 0 deletions
Large diffs are not rendered by default.

docs/README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# GeoNode Documentation
2+
3+
## How to write Documentation
4+
5+
GeoNode uses MarkDown, with [Python Markdown](https://python-markdown.github.io/) support and [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) extensions.
6+
7+
### Setup
8+
```bash
9+
python -m venv .venv
10+
. .venv/bin/activate
11+
pip install -r requirements.txt
12+
```
13+
14+
### Develop
15+
```bash
16+
mkdocs serve --livereload
17+
```
18+
19+
### Build
20+
```bash
21+
export ENABLE_PDF_EXPORT=1
22+
mkdocs build
23+
```
24+
25+
## Editing tips
26+
27+
- **Images**:
28+
- Can be embedded with `![](img/geo_limits_003.png)`, where the path is relative to the .md page
29+
- Can flow on the side of the text by appending the align attriute, for example `![](img/geo_limits_003.png) { align=left }`
30+
- Captions (if needed) can be added with a `\\\ caption \\\` block right below the image. E.g.
31+
```
32+
![](img/geo_limits_003.png)
33+
/// caption
34+
Image caption
35+
///
36+
```
37+
- **Links**: Beyond the standard Markdown links, we haveAnchors to headings and other pages is available:
38+
- Anchors can be created by placing this `()[]{ #my-anchor }` anywhere, and can be linked from anywhere with `[My anchor][my-anchor]`
39+
- Links to other pages can be done by referencing the page name (and optionally the heading) `[project license](about.md#license)`
40+
- **[Admonition blocks](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#usage)** can be created with:
41+
```
42+
!!! Warning
43+
The warning text
44+
```
45+
- **Inline emojis** are supported and their code can be searched with [this tool](https://squidfunk.github.io/mkdocs-material/reference/icons-emojis/#search).
46+
- Support for **[content tabs](https://squidfunk.github.io/mkdocs-material/reference/content-tabs/#content-tabs)** is enabled, in case they're useful.
47+
48+
## Reference documentation
49+
50+
- [MkDocs](https://www.mkdocs.org/)
51+
- [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/reference/)
52+
- [Python Markdown](https://python-markdown.github.io/)
53+

docs/mkdocs.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
site_name: GeoNode documentation
2+
repo_name: 'GeoNode/geonode'
3+
repo_url: https://github.com/GeoNode/geonode/
4+
use_directory_urls: true
5+
docs_dir: 'src'
6+
nav:
7+
- Home: index.md
8+
- User Guide:
9+
- User account: "user-guide/user_account.md"
10+
- Catalog Resources: "user-guide/catalog.md"
11+
- Datasets:
12+
- Upload a dataset: "user-guide/datasets/create.md"
13+
- Preview and Styling: "user-guide/datasets/preview.md"
14+
- Update and Replace: "user-guide/datasets/update_replace.md"
15+
- Remote datasets: "user-guide/datasets/remote.md"
16+
- Create empty dataset: "user-guide/datasets/empty.md"
17+
- Sharing: "user-guide/sharing.md"
18+
- Metadata: "user-guide/metadata.md"
19+
- Administration:
20+
- Accessing the panel: "admin/panel.md"
21+
- Users: "admin/user.md"
22+
- Groups: "admin/group.md"
23+
- Social Logins: "admin/social.md"
24+
- OAuth2: "admin/oauth.md"
25+
- Developer Guide:
26+
- API Usage: "development/api.md"
27+
- Setup:
28+
- Install:
29+
- Docker installation:
30+
- Prerequisites: setup/docker/prerequisites.md
31+
- Vanilla Docker installation: setup/docker/vanilla-docker-installation.md
32+
- GeoNode project Docker installation: setup/docker/project-docker-installation.md
33+
- Bare installation:
34+
- Prerequisites: setup/bare/prerequisites.md
35+
- Vanilla bare installation: setup/bare/vanilla-bare-installation.md
36+
- GeoNode project bare installation: setup/bare/project-bare-installation.md
37+
- Configuration:
38+
- Settings: setup/configuration/settings.md
39+
- Environmental Variables: setup/configuration/environmental_variables.md
40+
- Miscellaneous:
41+
- Thesauri: "miscellaneous/thesauri.md"
42+
- Backup And Restore: "miscellaneous/br.md"
43+
44+
extra_css:
45+
- theme/css/extra.css
46+
47+
extra_javascript:
48+
- theme/js/dl-anchors.js
49+
50+
theme:
51+
name: material
52+
logo: theme/img/geonode-logo-white.svg
53+
favicon: theme/img/favicon.ico
54+
custom_dir: 'src/theme'
55+
language: 'en'
56+
features:
57+
- header.autohide
58+
- navigation.instant
59+
- navigation.top
60+
- navigation.tabs
61+
- navigation.tabs.sticky
62+
- navigation.path
63+
- navigation.indexes
64+
- content.code.copy
65+
66+
markdown_extensions:
67+
- admonition
68+
- pymdownx.details
69+
- pymdownx.superfences
70+
- pymdownx.blocks.caption
71+
- pymdownx.tabbed:
72+
alternate_style: true
73+
- pymdownx.emoji:
74+
emoji_index: !!python/name:material.extensions.emoji.twemoji
75+
emoji_generator: !!python/name:material.extensions.emoji.to_svg
76+
- attr_list
77+
- def_list
78+
- toc:
79+
permalink: true
80+
81+
plugins:
82+
- with-pdf: # https://pypi.org/project/mkdocs-with-pdf/
83+
author: GeoSolutions Group
84+
copyright: 'OsGeo ©'
85+
#
86+
#cover: false
87+
#back_cover: true
88+
cover_logo: 'theme/geonode.png'
89+
cover_title: GeoNode Documentation
90+
cover_subtitle: User Guide and Developer Guide
91+
toc_level: 3
92+
output_path: pdf/geonode_documentation.pdf
93+
enabled_if_env: ENABLE_PDF_EXPORT
94+
debug_html: false # set to true to log the html content of the pdf on the console on build
95+
show_anchors: true
96+
verbose: false # set to true to log the pdf generation steps in detail
97+
custom_template_path: 'src/print_template' # includes custom styles.scss for pdf
98+
- search
99+
- autorefs

docs/pdf_event_hook.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# It is for mkdocs-with-pdf plugin
2+
# this file is resplosible for rendering the export pdf icon in case ENABLE_EXPORT_PDF = 1 in build environment
3+
4+
import logging
5+
6+
from bs4 import BeautifulSoup
7+
from mkdocs.structure.pages import Page
8+
9+
10+
def inject_link(html: str, href: str,
11+
page: Page, logger: logging) -> str:
12+
"""Adding PDF View button on navigation bar(using material theme)"""
13+
def _icon_tag():
14+
return BeautifulSoup('<span class="pdf-icon"></span>', 'html.parser')
15+
16+
logger.info(f'(hook on inject_link: {page.title})')
17+
soup = BeautifulSoup(html, 'html.parser')
18+
# you can change the icon location by specify the class name of the dom element that you want to append to
19+
# Find the DOM element with class "export-pdf-li"
20+
export_pdf = soup.find(class_='export-pdf-li')
21+
nav = soup.find(class_='md-header-nav')
22+
if export_pdf:
23+
a = soup.new_tag('a', href=href, title='PDF', target="_blank", **{'class': 'md-tabs__link'})
24+
# Append an img tag with a local image source
25+
a.append(_icon_tag())
26+
a.append("Export PDF")
27+
export_pdf.append(a)
28+
return str(soup)
29+
else:
30+
if not nav:
31+
# after 7.x
32+
nav = soup.find('nav', class_='md-header__inner')
33+
if nav:
34+
a = soup.new_tag('a', href=href, title='PDF', target="_blank", **{'class': 'md-header__button md-header-nav__button md-icon'})
35+
a.append(_icon_tag())
36+
a.append("Export PDF")
37+
nav.append(a)
38+
return str(soup)
39+
40+
return html

docs/requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bs4==0.0.2
2+
mkdocs==1.6.1
3+
mkdocs-material==9.7.0
4+
mkdocs-with-pdf==0.9.3
5+
mkdocs-autorefs==1.4.4

0 commit comments

Comments
 (0)