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

docs: mkdocs index and nav redesign #5207

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 10 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 doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ include $(MODULE_TOPDIR)/include/Make/Other.make
FILES := $(wildcard *.html)
# So far, we disntinguished user and contributor documentation here by
# extension. This is no longer possible with Markdown.
MDFILES := grass_database.md projectionintro.md
MDFILES := grass_database.md projectionintro.md quickstart.md

default: $(patsubst %,$(HTMLDIR)/%,$(FILES)) $(patsubst %,$(MDDIR)/source/%,$(MDFILES))
9 changes: 9 additions & 0 deletions doc/development/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
MODULE_TOPDIR = ..

include $(MODULE_TOPDIR)/include/Make/Other.make

# So far, we disntinguished user and contributor documentation here by
# extension. This is no longer possible with Markdown.
MDFILES := github_guide.md style_guide.md

default: $(patsubst %,$(MDDIR)/source/%,$(MDFILES))
130 changes: 130 additions & 0 deletions doc/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@

Welcome to the GRASS Quickstart Guide.

If you haven't already downloaded and installed GRASS start by following the

<!-- markdownlint-disable-next-line MD013 -->
[:material-download: Download and Install](https://grass.osgeo.org/download/){ .md-button }

## Tutorials

Get started with GRASS by following the tutorials below.

Get started with GRASS by following the
[tutorials](https://grass-tutorials.osgeo.org/) below.

### **User Tutorials**

:fontawesome-solid-user-graduate: *Tutorial* |
:material-github: *GitHub Repository* |
:octicons-file-code-16: *Library*

<!-- markdownlint-disable MD007 -->
<!-- markdownlint-disable MD030 -->
<!-- markdownlint-disable-next-line MD033 -->
<div class="grid cards" markdown>

- :simple-jupyter: **GRASS in Jupyter Notebooks**

---

- [:fontawesome-solid-user-graduate: Jupyter Notebooks (Linux)](https://grass-tutorials.osgeo.org/content/tutorials/get_started/fast_track_grass_and_python.html)
- [:fontawesome-solid-user-graduate: Jupyter Notebooks (Windows)](https://grass-tutorials.osgeo.org/content/tutorials/get_started/JupyterOnWindows_OSGeo4W_Tutorial.html)

---
[:material-arrow-right-circle: Python](https://grass-tutorials.osgeo.org/#category=Python){ .md-button .md-button--primary }

- :octicons-terminal-24: **Shell Scripting**

---

- [:fontawesome-solid-user-graduate: R with rgrass](https://grass-tutorials.osgeo.org/content/tutorials/get_started/JupyterOnLinux_Tutorial.html)
- [:material-github: rgrass](https://github.com/OSGeo/rgrass)

---
[:material-arrow-right-circle: Shell Tutorials](https://grass-tutorials.osgeo.org/#category=R){ .md-button .md-button--primary }

- :material-language-r: **GRASS for R**

---

- [:fontawesome-solid-user-graduate: R with rgrass](https://grass-tutorials.osgeo.org/content/tutorials/get_started/JupyterOnLinux_Tutorial.html)
- [:material-github: rgrass](https://github.com/OSGeo/rgrass)

---
[:material-arrow-right-circle: R Tutorials](https://grass-tutorials.osgeo.org/#category=R){ .md-button .md-button--primary }

- :fontawesome-solid-computer: **Desktop GUI**

---

- [:fontawesome-solid-user-graduate: Get started with GRASS GIS GUI](https://grass-tutorials.osgeo.org/content/tutorials/get_started/fast_track.html)
- [:fontawesome-solid-user-graduate: GUI Over](https://grass-tutorials.osgeo.org/#category=GUI)

---
[:material-arrow-right-circle: GUI Tutorials](https://grass-tutorials.osgeo.org/?search=jupyter#category=GUI){ .md-button .md-button--primary }

</div>
<!-- markdownlint-enable MD030 -->
<!-- markdownlint-enable MD007 -->

### **Developer Guides**

Whether you are a seasoned open source developer or a first time contributor, we
have resources to help you get started.

---

- [First Time Contributor Guide](github_guide.md)
- [GRASS Style Guide](style_guide.md)

---

<!-- markdownlint-disable MD007 -->
<!-- markdownlint-disable MD030 -->
<!-- markdownlint-disable-next-line MD033 -->
<div class="grid cards" markdown>

- :material-language-c:

---

- [:octicons-file-code-16: GRASS GIS Python Library](https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/index.html)
- [:octicons-file-code-16: PyGRASS Documentation](https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/pygrass_index.html)

---
[:material-arrow-right-circle: All Python Tutorials](https://grass-tutorials.osgeo.org/#category=Python){ .md-button .md-button--primary }

- :material-language-python:

---

- [:octicons-file-code-16: GRASS GIS Python Library](https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/index.html)
- [:octicons-file-code-16: PyGRASS Documentation](https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/pygrass_index.html)

---
[:material-arrow-right-circle: All Python Tutorials](https://grass-tutorials.osgeo.org/#category=Python){ .md-button .md-button--primary }

- :material-plus: **GRASS Addons**

---

- [:material-github: OSGeo/grass-addons](https://github.com/OSGeo/grass-addons)
- [:fontawesome-solid-user-graduate: Got a model? You've got an Addon](https://grass-tutorials.osgeo.org/content/tutorials/get_started/JupyterOnWindows_OSGeo4W_Tutorial.html)

---
[:material-arrow-right-circle: Get Started](addons_helloworld.md){ .md-button .md-button--primary }

- :fontawesome-solid-computer: **GUI**

---

- [:fontawesome-solid-user-graduate: Get started with GRASS GIS GUI](https://grass-tutorials.osgeo.org/content/tutorials/get_started/fast_track.html)
- [:fontawesome-solid-user-graduate: GUI Over](https://grass-tutorials.osgeo.org/#category=GUI)

---
[:material-arrow-right-circle: All GUI Tutorials](https://grass-tutorials.osgeo.org/?search=jupyter#category=GUI){ .md-button .md-button--primary }

</div>
<!-- markdownlint-enable MD030 -->
<!-- markdownlint-enable MD007 -->
8 changes: 4 additions & 4 deletions man/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ DSTFILES := \
$(MDDIR)/source/favicon.ico \
$(MDDIR)/source/grassdocs.css \
$(MDDIR)/scripts/hook_list_scripts.py \
$(MDDIR)/source/index.md \
$(MDDIR)/overrides/partials/footer.html \
$(MDDIR)/overrides/partials/actions.html \
$(MDDIR)/source/tags.md
Expand Down Expand Up @@ -159,10 +160,6 @@ $(HTMLDIR)/index.html: build_index.py build_html.py
$(call build,index)
touch $@

$(MDDIR)/source/index.md: build_index.py build_md.py
$(call build,index)
touch $@

$(HTMLDIR)/keywords.html: $(ALL_HTML)
$(call build_keywords)
touch $@
Expand Down Expand Up @@ -247,6 +244,9 @@ $(HTMLDIR)/parser_standard_options.css: parser_standard_options.css
$(MDDIR)/mkdocs.yml: mkdocs/mkdocs.yml
$(INSTALL_DATA) $< $@

$(MDDIR)/source/index.md: mkdocs/index.md
$(INSTALL_DATA) $< $@

$(MDDIR)/source/grass_logo.svg: grass_logo.svg
$(INSTALL_DATA) $< $@

Expand Down
15 changes: 7 additions & 8 deletions man/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,15 @@ def write_header(f, title, ismain=False, body_width="99%", template="html"):


def write_cmd_overview(f, template="html"):
from build_html import overview_tmpl

if template == "html":
from build_html import overview_tmpl
else:
from build_md import overview_tmpl
f.write(
overview_tmpl.substitute(
grass_version_major=grass_version_major,
grass_version_minor=grass_version_minor,
f.write(
overview_tmpl.substitute(
grass_version_major=grass_version_major,
grass_version_minor=grass_version_minor,
)
)
)


def write_footer(f, index_url, year=None, template="html"):
Expand Down
2 changes: 0 additions & 2 deletions man/build_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ def build_index(ext):

if __name__ == "__main__":
build_index("html")

build_index("md")
122 changes: 0 additions & 122 deletions man/build_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,128 +39,6 @@
"""
)

# TODO: avoid HTML tags
overview_tmpl = string.Template(
r"""<!-- the files grass${grass_version_major}.html & helptext.html file live in lib/init/ -->

<table align="center" border="0" cellspacing="8">
<tbody>
<tr>
<td width="33%" valign="top" class="box"><h3>&nbsp;Quick Introduction</h3>
<ul>
<li class="box"><a href="helptext.html">How to start with GRASS GIS</a></li>
<li class="box"><span>Index of <a href="topics.html">topics</a> and <a href="keywords.html">keywords</a></span></li>
</ul>
<p>
<ul>
<li class="box"><a href="projectionintro.html">Intro: projections and spatial transformations</a></li>
</ul>
<p>
<ul>
<li class="box"><span><a href="https://grasswiki.osgeo.org/wiki/Faq">FAQ - Frequently Asked Questions</a> (Wiki)</span></li>
</ul>
<p>
<ul>
<li class="box"><span><a href="graphical_index.html">Graphical index of functionality</a></span></li>
</ul>
</td>
<td width="33%" valign="top" class="box"><h3>&nbsp;Graphical User Interface</h3>
<ul>
<li class="box"><a href="wxguiintro.html">Intro: Graphical User Interface</a></li>
<li class="box"><span><a href="wxGUI.html">wxGUI</a></span></li>
<li class="box"><a href="wxGUI.components.html">wxGUI components</a></li>
<li class="box"><a href="wxGUI.toolboxes.html">wxGUI toolboxes</a></li>
</ul>

<ul>
<li class="box"><a href="topic_GUI.html">GUI commands</a></li>
</ul>
<h3>&nbsp;Display</h3>
<ul>
<li class="box"><a href="display.html">Display commands manual</a></li>
<li class="box"><a href="displaydrivers.html">Display drivers</a></li>
</ul>
</td>
<td width="33%" valign="top" class="box"><h3>&nbsp;General</h3>
<ul>
<li class="box"><a href="grass.html">GRASS GIS startup manual</a></li>
<li class="box"><a href="general.html">General commands manual</a></li>
</ul>
<h3>&nbsp;Addons</h3>
<ul>
<li class="box"><a href="https://grass.osgeo.org/grass8/manuals/addons/">Addons manual pages</a></li>
</ul>
<h3>&nbsp;Programmer's Manual</h3>
<ul>
<li class="box"><a href="https://grass.osgeo.org/programming8/">Programmer's Manual</a></li>
</ul>
</td>
</tr>
<tr>
<td width="33%" valign="top" class="box"><h3>&nbsp;Raster processing</h3>
<ul>
<li class="box"><a href="rasterintro.html">Intro: 2D raster map processing</a></li>
<li class="box"><a href="raster.html">Raster commands manual</a></li>
</ul>
</td>
<td width="33%" valign="top" class="box"><h3>&nbsp;3D raster processing</h3>
<ul>
<li class="box"><a href="raster3dintro.html">Intro: 3D raster map (voxel) processing</a></li>
<li class="box"><a href="raster3d.html">3D raster (voxel) commands manual</a></li>
</ul></td>
<td width="33%" valign="top" class="box"><h3>&nbsp;Image processing</h3>
<ul>
<li class="box"><a href="imageryintro.html">Intro: image processing</a></li>
<li class="box"><a href="imagery.html">Imagery commands manual</a></li>
</ul></td>
</tr>
<tr>
<td width="33%" valign="top" class="box"><h3>&nbsp;Vector processing</h3>
<ul>
<li class="box"><a href="vectorintro.html">Intro: vector map processing and network analysis</a></li>
<li class="box"><a href="vector.html">Vector commands manual</a></li>
<li class="box"><a href="vectorascii.html">GRASS ASCII vector format specification</a></li>
</ul></td>
<td width="33%" valign="top" class="box"><h3>&nbsp;Database</h3>
<ul>
<li class="box"><a href="databaseintro.html">Intro: database management</a></li>
<li class="box"><a href="sql.html">SQL support in GRASS GIS</a></li>
<li class="box"><a href="database.html">Database commands manual</a></li>
</ul>
</td>
<td width="33%" valign="top" class="box"><h3>&nbsp;Temporal processing</h3>
<ul>
<li class="box"><a href="temporalintro.html">Intro: temporal data processing</a></li>
<li class="box"><a href="temporal.html">Temporal commands manual</a></li>
</ul>
</td>
</tr>
<tr>
<td width="33%" valign="top" class="box"><h3>&nbsp;Cartography</h3>
<ul>
<li class="box"><a href="postscript.html">PostScript commands manual</a></li>
<li class="box"><a href="g.gui.psmap.html">wxGUI Cartographic Composer</a></li>
</ul>
</td>
<td width="33%" valign="top" class="box"><h3>&nbsp;Miscellaneous&nbsp;&amp;&nbsp;Variables</h3>
<ul>
<li class="box"><a href="miscellaneous.html">Miscellaneous commands manual</a></li>
<li class="box"><a href="variables.html">GRASS variables and environment variables</a></li>
</ul>
</td>
<td width="33%" valign="top" class="box"><h3>&nbsp;Python</h3>
<ul>
<li class="box"><a href="https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/index.html">GRASS GIS Python library documentation</a></li>
<li class="box"><a href="https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/pygrass_index.html">PyGRASS documentation</a></li>
<li class="box"><a href="https://grass.osgeo.org/grass${grass_version_major}${grass_version_minor}/manuals/libpython/grass.jupyter.html">GRASS GIS in Jupyter Notebooks</a></li>
</ul>
</td>
</tr>
</tbody>
</table>
"""
)

# footer_tmpl = string.Template(
# r"""
# ____
Expand Down
8 changes: 8 additions & 0 deletions man/mkdocs/grassdocs.css
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,11 @@
.md-typeset table:not([class]) tbody tr:hover {
background-color: transparent;
}

.gs-icon-primary {
color: var(--gs-primary-color);
}

.gs-icon-accent {
color: var(--gs-secondary-color);
}
Loading
Loading