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 12 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))
Empty file added doc/quickstart.md
Empty file.
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);
}
121 changes: 121 additions & 0 deletions man/mkdocs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
## What is GRASS?

[GRASS](https://grass.osgeo.org/) is a geosptial processing engine for
advance analysis and visualization of geospatial data. It is a powerful tool for
processing and analyzing geospatial data sets. GRASS is a free and open source
software, released under an open source [GNU GPLed](https://www.gnu.org/licenses/gpl.html).

Downloaded and installed GRASS here.

<!-- 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](https://grass-tutorials.osgeo.org/) below.

## Interfaces

GRASS provides a number of interfaces for interacting with the software. The
most common interfaces are:

### [Terminal](grass.md)

The terminal interface is...

```bash

grass -c EPSG:3385 {project directory} --gtext
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
grass -c EPSG:3385 {project directory} --gtext
grass -c EPSG:3385 {project directory} --text

For true no-GUI experience.


Starting GRASS GIS...

__________ ___ __________ _______________
/ ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/
/ / __/ /_/ / /| | \__ \\_ \ / / __ / / \__ \
/ /_/ / _, _/ ___ |___/ /__/ / / /_/ // / ___/ /
\____/_/ |_/_/ |_/____/____/ \____/___//____/

Welcome to GRASS GIS 8.5.0dev (5ffc9ea669)
GRASS GIS homepage: https://grass.osgeo.org
This version running through: Bash Shell (/bin/bash)
Help is available with the command: g.manual -i
See the licence terms with: g.version -c
See citation options with: g.version -x
If required, restart the GUI with: g.gui wxpython
When ready to quit enter: exit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe little too many lines? (That output should be shorter, but even a shorter one would still be little too long for here.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've change the section.



GRASS {project directory}/PERMANENT:{Working directory} >

```

Now you can run GRASS commands in the terminal.

```sh
g.region raster=elevation
r.slope.aspect elevation=elevation slope=slope aspect=aspect
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an alternative to this and that's --exec which I would say is popular for certain use cases.


### Python Scripts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C doc and possibly general tool writing stuff (standard parser options): I wonder if to put it here as sort of next steps ("is this not enough?") or at the end to a separate section. This would be the usage as a modeling platform.


The `grass.script` module provides a Python interface to GRASS. This allows
users to write Python scripts to interact with GRASS. The `grass.script` module
Comment on lines +46 to +49
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to start describing the in-session version grass.script.setup.init.

contains the gs.script.core module which provides the core functionality for the
GRASS Python interface, the `grass.script.raster` module which provides
functionality for working with raster data, and the `grass.script.vector` module
which provides functionality for working with vector data.

```python
import grass.script as gs

gs.run_command('g.region', raster='elevation')
gs.run_command('r.slope.aspect', elevation='elevation', slope='slope', aspect='aspect')
```

### Jupyter Notebooks

Jupyter Notebooks are a great way to interact with GRASS. The `grass.jupyter`
module provides a Jupyter interface to GRASS. This allows users to write Jupyter
Notebooks to interact with GRASS. The `grass.jupyter` module contains the `Map`,
`InteractiveMap`, `Map3D`, `TimeSeriesMap`, and `SeriesMap` classes which
provide functionality for working with maps in Jupyter Notebooks.

```python
import grass.jupyter as gj

slope_map = gj.Map() # Create a new map
slope_map.d_rast(map='slope') # Add the slope raster to the map
slope_map.d_barscale(at=(80, 10)) # Add a bar scale to the map
slope_map.d_legend(raster='slope', at=(80, 90)) # Add a legend to the map
slope_map.show() # Display the map
```

![Slope Map](r_slope_aspect_slope.png)

### [GRASS Desktop GUI](wxguiintro.md)

Add content here.

## [Project Management](grass_database.md)

Add Content here.

## Processing Tools

### GRASS Tool Prefixes

| Prefix | Category | Description | Link |
|--------|----------------------------------|------------------------------------|-------------------------------------------|
| `g.` | General | General GIS management tools | [General Tools](general.md) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just make this presentation of tool, rather than prefixes.

| `r.` | Raster | Raster data processing tools | [Raster Tools](raster.md) |
| `r3.` | 3D Raster | 3D Raster data processing tools | [3D Raster Tools](raster3d.md) |
| `v.` | Vector | Vector data processing tools | [Vector Tools](vector.md) |
| `i.` | Imagery | Imagery processing tools | [Imagery Tools](imagery.md) |
| `t.` | Temporal | Temporal data processing tools | [Temporal Tools](temporal.md) |
| `db.` | Database | Database management tools | [Database Tools](database.md) |
| `d.` | Display | Display and visualization tools | [Display Tools](display.md) |
| `m.` | Miscellaneous | Miscellaneous tools | [Miscellaneous Tools](miscellaneous.md) |
| `ps.` | Postscript | Postscript tools | [Postscript Tools](postscript.md) |

## Data Visualization
Loading
Loading