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: Generate manual from markdown using mkdocs #3849

Draft
wants to merge 105 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 86 commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
a01ab38
very first draft
landam Jun 16, 2024
307432f
re-enable html builds
landam Jun 16, 2024
5aa3564
rename "md" dir to "markdown"
landam Jun 16, 2024
d33bcb9
add converted md file from html using pandoc
landam Jun 16, 2024
e2fd51c
fix various compilation issues
landam Jun 16, 2024
78cbd32
run mkdocs
landam Jun 16, 2024
40b6de9
fix md newline
landam Jun 16, 2024
6d49dae
short commit hash
landam Jun 16, 2024
f0c5311
--md-description: skip main header
landam Jun 16, 2024
f725352
avoid duplicated header for now
landam Jun 16, 2024
bbbeee2
move mkdocs from doc/ to man/
landam Jun 16, 2024
7b7c244
build index file
landam Jun 16, 2024
134ff95
mkdocs: disable directory_urls
landam Jun 17, 2024
3343ae3
lib/init: process md files
landam Jun 17, 2024
f5c4e8b
typo
landam Jun 17, 2024
1f38a1e
implement topic index
landam Jun 17, 2024
93dfcad
implement keyword index
landam Jun 17, 2024
5f3ce2b
enable html keywords index
landam Jun 17, 2024
cd58012
fix grass_logo
landam Jun 17, 2024
f132228
Update man/build_keywords.py
landam Jun 18, 2024
139c5fa
Update man/build_keywords.py
landam Jun 18, 2024
ee88da9
Update man/build_keywords.py
landam Jun 18, 2024
e11b985
Update man/build_keywords.py
landam Jun 18, 2024
71d8df2
Update man/build_keywords.py
landam Jun 18, 2024
6d816e5
Update man/build_keywords.py
landam Jun 18, 2024
58ce945
Update man/build_keywords.py
landam Jun 18, 2024
a72d2ea
Update man/build_keywords.py
landam Jun 18, 2024
adf5af6
change style to material
landam Jun 18, 2024
1b4a3fa
Merge branch 'main' into markdown_docs
landam Jun 18, 2024
13a51fb
implement full_index
landam Jun 18, 2024
0e8e272
logo tuning
landam Jun 18, 2024
97e78ff
fix html keywords
landam Jun 18, 2024
a7c1d33
module md header changed
landam Jun 18, 2024
542ead1
include images
landam Jun 18, 2024
d8ff3de
mkdocs cosmetics
landam Jun 18, 2024
2e34f65
Update man/build_full_index.py
landam Jun 26, 2024
4ecb894
Update man/build_full_index.py
landam Jun 26, 2024
146bb42
Update man/build_full_index.py
landam Jun 26, 2024
2671a0e
Update man/build_full_index.py
landam Jun 26, 2024
2a9a0e5
Update man/build_graphical_index.py
landam Jun 26, 2024
5adea99
Update man/build_graphical_index.py
landam Jun 26, 2024
3b1c8cd
Merge branch 'main' into markdown_docs
landam Jun 26, 2024
cff3253
Update man/build_keywords.py
landam Jun 26, 2024
60fa3b1
Update man/build_graphical_index.py
landam Jun 26, 2024
580fcef
Update man/build_full_index.py
landam Jun 26, 2024
1c9556b
Merge branch 'main' into markdown_docs
landam Aug 8, 2024
08a966c
merge 28bbce8dd772f48d38ef02743ba239207c950c57 + flake8
landam Aug 8, 2024
eef0b70
code block fix in md files
landam Aug 8, 2024
119a0bc
md requiremensts: add mkdocs-material
landam Aug 9, 2024
6c42777
fix compilation issue in gui/scripts
landam Aug 19, 2024
5ab2d36
Update man/build_md.py
landam Aug 19, 2024
d48461b
Update man/build_topics.py
landam Aug 19, 2024
2d78ccf
Update utils/mkmarkdown.py
landam Aug 19, 2024
52d356d
Update utils/mkmarkdown.py
landam Aug 19, 2024
816a49c
Update utils/mkmarkdown.py
landam Aug 19, 2024
40dbcb0
Update utils/mkmarkdown.py
landam Aug 19, 2024
753fab7
Update utils/mkmarkdown.py
landam Aug 19, 2024
84c55e6
Update utils/mkmarkdown.py
landam Aug 19, 2024
e9f31cb
Update man/build_md.py
landam Aug 19, 2024
44736a5
Update man/build_keywords.py
landam Aug 19, 2024
b36d707
Merge branch 'main' into markdown_docs
landam Aug 19, 2024
4ec91d5
fix compilation issue in 'man' dir
landam Aug 19, 2024
e71d72b
fix compilation issue in 'raster' dir
landam Aug 19, 2024
96c5b53
simplify mddesc
landam Aug 19, 2024
9460dee
parser: flag's description may be optional
landam Aug 19, 2024
3e3366b
point logo to index.html
landam Aug 20, 2024
f6255d8
mkdocs: customize site_name
landam Aug 20, 2024
e14483d
fix module indices
landam Aug 20, 2024
d56baaa
fix keywords
landam Aug 20, 2024
fbc81f0
fix guiscript
landam Aug 20, 2024
722b382
implement manual_gallery
landam Aug 20, 2024
d101d51
implement parser_standard_options
landam Aug 20, 2024
b7486e4
Update man/build_keywords.py
landam Aug 20, 2024
0cc3123
Update man/parser_standard_options.py
landam Aug 20, 2024
78b17f5
fix commit ref
landam Aug 20, 2024
723ee55
replace html meta comments with yaml metadata block
landam Aug 20, 2024
c7633b0
introduce build.py
landam Aug 20, 2024
46ff26a
fix building indices
landam Aug 20, 2024
1a74615
full index: avoid HTML tag in MD
landam Aug 20, 2024
7fcf163
simplify title
landam Aug 20, 2024
fa20022
Update man/build_topics.py
landam Aug 20, 2024
5458f76
Update man/build_md.py
landam Aug 20, 2024
b58d65b
Update man/build_md.py
landam Aug 20, 2024
2f6ed6d
Update man/build_full_index.py
landam Aug 20, 2024
0b000be
Update man/build_manual_gallery.py
landam Aug 20, 2024
deb7cac
Update man/build_class.py
landam Aug 20, 2024
fab2a0f
Update man/build.py
landam Aug 20, 2024
a6e625b
Update lib/gis/parser_rest_md.c
landam Aug 20, 2024
77d9f42
Merge branch 'main' into markdown_docs
landam Aug 20, 2024
3f05ec9
extend footer
landam Aug 20, 2024
50edf87
REQUIREMENTS.md: add pip install mkdocs mkdocs-material
neteler Aug 21, 2024
9ebb183
beautify footer
landam Aug 21, 2024
987d992
rename target dir to mkdocs
landam Aug 21, 2024
33a91b9
fix build_class
landam Aug 21, 2024
72dec30
add missing footer
landam Aug 22, 2024
4daa36b
apply black
landam Aug 22, 2024
d3b31d3
apply ruff suggestions
landam Aug 22, 2024
516386d
fix pathlib import
landam Aug 22, 2024
05cd9af
Update utils/mkmarkdown.py
landam Aug 22, 2024
4428a64
apply ruff
landam Aug 22, 2024
682d266
remove auto-generated md files
landam Sep 19, 2024
64ed659
Merge branch 'main' into markdown_docs
landam Sep 19, 2024
9d129e1
Update man/build_keywords.py
landam Sep 19, 2024
00a8c8f
solve conflicts
landam Sep 30, 2024
33753b1
Merge branch 'main' into markdown_docs
landam Sep 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
106 changes: 106 additions & 0 deletions db/databaseintro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
### Attribute management in general

GRASS can be linked to one or many database management systems (DBMS).
The *db.\** set of commands provides basic SQL support for attribute
management, while the *v.db.\** set of commands operates on the vector
map (see [Vector introduction](vectorintro.html)).

### Available drivers

Available drivers are listed in [SQL support in GRASS GIS](sql.html).

**Notes**:\
The DBF driver provides only very limited SQL support (as DBF is not an
SQL DB) while the other DBMS backends (such as SQLite, PostgreSQL, MySQL
etc) provide full SQL support since the SQL commands are sent directly
to the DBMS. For this reason, the SQLite driver is the default DBMI
backend.

### DB connection management

The current database management settings are shown or modified with
[db.connect](db.connect.html) for current mapset. Available DBMI drivers
are listed with [db.drivers](db.drivers.html). Some DBMI backends
require a user/password for driver/database to be set with
[db.login](db.login.html). In order to test a driver, run
[db.test](db.test.html).

### Attribute data import and export

Attribute data can be imported with [db.in.ogr](db.in.ogr.html) from
various formats and exported with [db.out.ogr](db.out.ogr.html). To
internally copy a a full table or selectively parts of it, use
[db.copy](db.copy.html).

Further conversion tools:

- [MDB Tools](http://sourceforge.net/projects/mdbtools): Convert
MS-Access data to SQL, DBF, etc.
- [Using OpenOffice.org with SQL
Databases](https://grasswiki.osgeo.org/wiki/Openoffice.org_with_SQL_Databases)

### SQL commands

GRASS supports two main SQL operations, execution of an SQL statement
([db.execute](db.execute.html)) and selection of data from a table
([db.select](db.select.html)). See the [SQL help page](sql.html) for
examples.

### Managing the default DBMI settings

Per default vector map attributes are stored in SQLite tables. This
default definition can be modified with [db.connect](db.connect.html).
If an external DBMS is used, [db.login](db.login.html) may be required.

### Creating a database

Specific commands are explained on the individual driver pages (these
pages are only available if driver was compiled in this installation):

- DBF: see [DBF](grass-dbf.html) page
- SQLite: [SQLite](grass-sqlite.html) page
- mySQL: [mySQL](grass-mysql.html) and [meSQL](grass-mesql.html) pages
- ODBC: [ODBC](grass-odbc.html) page (connect to Oracle, etc.)
- PostgreSQL: [PostgreSQL](grass-pg.html) and PostGIS page

### Metadata

All columns for a given table are listed with
[db.columns](db.columns.html). The command
[db.describe](db.describe.html) describes a table in detail. To list all
available tables for a given database, run [db.tables](db.tables.html).

### Table maintenance

To drop a column from a selected attribute table, use
[db.dropcolumn](db.dropcolumn.html). With
[db.droptable](db.droptable.html) an attribute table can be deleted.

### Database Schema

Currently schema support only works for PostgreSQL connections. Default
schema can be set with [db.connect](db.connect.html). Note that the
default schema will be used by all db.\* modules.

[db.tables](db.tables.html) returns \'schema.table\' if schemas are
available in the database.

### Migrating to a different database engine

To migrate a GRASS database table (or a GRASS vector map) to a different
DBMI engine, the best solution is to create a new MAPSET, define the
DBMI settings accordingly with [db.connect](db.connect.html) and if
needed, [db.login](db.login.html). Then the table of interest can be
copied over with [db.copy](db.copy.html) from the original MAPSET.
Likewise, a vector map including its table(s) are copied from the
original MAPSET to the current MAPSET with [g.copy](g.copy.html).

### See also

- [Introduction into raster data processing](rasterintro.html)
- [Introduction into 3D raster data (voxel)
processing](raster3dintro.html)
- [Introduction into vector data processing](vectorintro.html)
- [Introduction into image processing](imageryintro.html)
- [Introduction into temporal data processing](temporalintro.html)
- [Projections and spatial transformations](projectionintro.html)
52 changes: 52 additions & 0 deletions db/db.columns/db.columns.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
## DESCRIPTION

*db.columns* lists all columns for a give table. Connection to databases
are supported through dbf, shp, odbc and pg drivers.

## NOTE

If parameters for database connection are already set with
[db.connect](db.connect.html), they are taken as default values and do
not need to be spcified each time.

## EXAMPLES

### List columns of a PostgreSQL attribute table

```
db.columns table=zipcodes_wake driver=pg database=grassdb
```

*If the database parameters are already set, the columns can be listed
directly*\

```
db.columns table=zipcodes_wake
```

### List columns from Shape file with DBF attribute table

```
db.columns table=zipcodes_wake driver=dbf database=/grassdata/nc_spm_08/PERMANENT/dbf/
```

### List columns of table in SQLite database

Note that the SQLite backend is the default setting.

```
db.columns driver=sqlite table=archsites database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
```

## SEE ALSO

*[db.connect](db.connect.html), [db.describe](db.describe.html),
[db.drivers](db.drivers.html), [db.droptable](db.droptable.html),
[db.execute](db.execute.html), [db.login](db.login.html),
[db.tables](db.tables.html), [GRASS SQL interface](sql.html)*

[GRASS SQL interface](sql.html)

## AUTHOR

Radim Blazek, ITC-Irst, Trento, Italy
136 changes: 136 additions & 0 deletions db/db.connect/db.connect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
## DESCRIPTION

*db.connect* allows the user to set database connection parameters.
These parameters are then taken as default values by modules so that the
user does not need to enter the parameters each time.

The default database backend in GRASS GIS is [SQLite](grass-sqlite.html)
(since version 7).

## NOTES

Values are stored in the mapset\'s `VAR` file; the connection is not
tested for validity.

The **-p** flag will display the current connection parameters.

The **-c** flag will silently check if the connection parameters have
been set, and if not will set them to use GRASS\'s default values.
(useful in scripts before you attempt to create a new database table)

To connect a vector map to a database table, use
*[v.db.connect](v.db.connect.html)* or
*[v.db.addtable](v.db.addtable.html)*.

## EXAMPLES

### SQLite (default backend)

Local storage:\

```
db.connect -d
db.connect -p
db.tables -p
```

The SQLite database file is created automatically when used the first
time.

See [SQLite](grass-sqlite.html) database driver for details.

### PostgreSQL (local connection)

Local storage, database tables stored in database \"mydb\" (may require
the use of *[db.login](db.login.html)*):\

```
db.connect driver=pg database=mydb
db.login user=myname pass=secret
db.connect -p
db.tables -p
```

See [PostgreSQL](grass-pg.html) database driver for details.

### PostgreSQL (network connection)

Network storage, database tables stored in database \"mydb\" (may
require the use of *[db.login](db.login.html)*):\

```
db.connect driver=pg database=mydb
db.login user=myname pass=secret host=myserver.com port=6666
db.connect -p
db.tables -p
```

See [PostgreSQL](grass-pg.html) database driver for details.

### MySQL (local connection)

Local storage, database tables stored in database \"mydb\" (may require
the use of *[db.login](db.login.html)*):\

```
db.connect driver=mysql database=mydb
db.login user=myname pass=secret
db.connect -p
db.tables -p
```

See [MySQL](grass-mysql.html) database driver for details.

### MySQL (network connection)

Network storage, database tables stored in database \"mydb\" (may
require the use of *[db.login](db.login.html)*):\

```
db.connect driver=mysql database=mydb
db.login user=myname pass=secret host=myserver.com
db.connect -p
db.tables -p
```

See [MySQL](grass-mysql.html) database driver for details.

### ODBC

Network storage, database tables stored in database \"mydb\" (may
require the use of *[db.login](db.login.html)*):\

```
db.connect driver=odbc database=mydb
db.login user=myname pass=secret
db.connect -p
db.tables -p
```

See [ODBC](grass-odbc.html) database driver for details.

### DBF (local, not recommended)

Local storage (the dbf/ subdirectory in the mapset must exist or must be
created by the user):\

```
db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
db.tables -p
```

See [DBF](grass-dbf.html) database driver for details.

## SEE ALSO

*[db.columns](db.columns.html), [db.copy](db.copy.html),
[db.drivers](db.drivers.html), [db.login](db.login.html),
[db.tables](db.tables.html), [v.db.addtable](v.db.addtable.html),
[v.db.connect](v.db.connect.html)*

[GRASS SQL interface](sql.html)

## AUTHORS

Main author: Radim Blazek, ITC-Irst, Trento, Italy\
GRASS 7 improvements: Martin Landa, Markus Metz
72 changes: 72 additions & 0 deletions db/db.copy/db.copy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## DESCRIPTION

*db.copy* allows the user to copy a table between two databases.
Databases can be connected through different drivers (see examples
below).

## NOTES

Attribute tables can be copied using *db.copy* and, when to be
associated to a vector map, assigned to the map with
*[v.db.connect](v.db.connect.html)*. Current connection settings are
saved in the file *\$LOCATION/vector_map/dbln*.

## EXAMPLES

### From DBF to PostgreSQL

*Storing table \'geonames.dbf\' (in current directory) into PostgreSQL
through ODBC:*\

```
db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
from_table=geonames to_driver=pg to_database="host=pgserver,dbname=testdb" \
to_table=geonames
```

### From PostgreSQL to DBF

```
db.copy from_driver=pg from_database="host=pgserver.example.org,dbname=testdb" \
from_table=origtable to_driver=dbf \
to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf' to_table=origtable
```

### From PostgreSQL to PostgreSQL with condition

```
db.copy from_driver=pg from_database="host=localhost,dbname=testdb" \
from_table=geonames to_driver=pg to_database="host=localhost,dbname=testdb" \
to_table=selection where="cat < 500"
```

### From DBF to SQLite

```
db.copy from_driver=dbf from_database='$GISDBASE/$LOCATION_NAME/PERMANENT/dbf' \
from_table=geonames_features to_driver=sqlite \
to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' to_table=geonames_features

# convenient viewer:
sqlitebrowser $HOME/grassdata/nc_spm_08/user1/sqlite/sqlite.db
```

### From SQLite to DBF

```
db.copy from_driver=sqlite from_database='$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db' \
from_table=ammprv to_driver=dbf to_database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/' \
to_table=ammprv
```

## SEE ALSO

*[db.connect](db.connect.html), [db.drivers](db.drivers.html),
[db.login](db.login.html), [v.db.connect](v.db.connect.html),
[v.clean](v.clean.html)*

[GRASS SQL interface](sql.html)

## AUTHOR

Radim Blazek, ITC-irst, Trento, Italy
Loading
Loading