From f6c49c7928c62f18ad4b5525c12b64323de3e14e Mon Sep 17 00:00:00 2001 From: Sergey Vartanov Date: Sat, 10 Sep 2022 13:37:34 +0300 Subject: [PATCH] Update documentation syntax for new Moire version. In Moire `\code` tag is now has language, if exists, in its first argument. This was changed for better syntax highlighting support. --- README.md | 27 ++++++++++++++------------- doc/INSTALL.md | 3 ++- doc/moi/contributing.moi | 4 ++-- doc/moi/install.moi | 8 ++++---- doc/moi/readme.moi | 40 ++++++++++++++++++++-------------------- 5 files changed, 42 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 34c2719..43de302 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ See Usage example ------------- -```bash +```shell map-machine render -b=2.284,48.860,2.290,48.865 ``` will automatically download OSM data and write output SVG map of the specified area to `out/map.svg`. See [Map generation](#map-generation). -```bash +```shell map-machine tile -b=2.361,48.871,2.368,48.875 ``` @@ -157,7 +157,7 @@ Map generation Command `render` is used to generate SVG map from OpenStreetMap data. You can run it using: -```bash +```shell map-machine render \ -b=,,, \ -o= \ @@ -167,7 +167,7 @@ map-machine render \ ### Example ### -```bash +```shell map-machine render \ --boundary-box=2.284,48.860,2.290,48.865 \ --output=out/esplanade_du_trocadéro.svg @@ -209,13 +209,13 @@ plus [map configuration options](#map-options) Specify tile coordinates: -```bash +```shell map-machine tile --tile // ``` or specify any geographical coordinates inside a tile: -```bash +```shell map-machine tile \ --coordinates=, \ --zoom= @@ -225,7 +225,7 @@ Tile will be stored as SVG file `out/tiles/tile___.svg` and PN Example: -```bash +```shell map-machine tile -c=55.7510637,37.6270761 -z=18 ``` @@ -235,7 +235,7 @@ will generate SVG file `out/tiles/tile_18_158471_81953.svg` and PNG file `out/ti Specify boundary box to get the minimal set of tiles that covers the area: -```bash +```shell map-machine tile \ --boundary-box=,,, \ --zoom= @@ -245,7 +245,7 @@ The boundary box will be extended to the boundaries of the minimal tileset that Example: -```bash +```shell map-machine tile -b=2.361,48.871,2.368,48.875 ``` @@ -256,7 +256,7 @@ Tile server Command `server` is used to run tile server for slippy maps. -``` +```shell map-machine server ``` @@ -271,19 +271,19 @@ Stop server interrupting the process with Ctrl + C. Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19: -```bash +```shell map-machine tile -b=2.364,48.854,2.367,48.857 -z=16-19 ``` Run tile server on 127.0.0.1:8080: -```bash +```shell map-machine server ``` Use JavaScript code for [Leaflet](https://leafletjs.com/): -```js +```javascript var map = L.map('mapid').setView([48.8555, 2.3655], 18); L.tileLayer('http://127.0.0.1:8080/tiles/{z}/{x}/{y}', { @@ -311,6 +311,7 @@ Map configuration options used by `render` and `tile` commands: | Option | Description | |---|---| +| `--scheme` ` or ` | scheme identifier (look for `.yml` file) or path to a YAML scheme file, default value: `default` | | `--buildings` `` | building drawing mode: no, flat, isometric, isometric-no-parts, default value: `flat` | | `--mode` `` | map drawing mode: normal, author, time, white, black, default value: `normal` | | `--overlap` `` | how many pixels should be left around icons and text, default value: 12 | diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 7ca8acc..aed6c8c 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -22,4 +22,5 @@ pip install git+https://github.com/enzet/map-machine ```shell brew install cairo geos pip install git+https://github.com/enzet/map-machine -``` \ No newline at end of file +``` + diff --git a/doc/moi/contributing.moi b/doc/moi/contributing.moi index 79b97f7..818bd45 100644 --- a/doc/moi/contributing.moi +++ b/doc/moi/contributing.moi @@ -6,7 +6,7 @@ Thank you for your interest in the Map Machine project. Since the primary goal ❗ \b {IMPORTANT} ❗ Before committing please enable Git hooks: -\code {git config --local core.hooksPath data/githooks} {shell} +\code {shell} {git config --local core.hooksPath data/githooks} This will allow you to automatically check your commit message and code before committing and pushing changes. This will crucially speed up pull request merging and make Git history neat and uniform. @@ -18,7 +18,7 @@ Activate virtual environment. E.g. for fish shell, run \m {source venv/bin/acti Install the project in editable mode: -\code {pip install -e .} {shell} +\code {shell} {pip install -e .} Install formatter, linter and test system\: \m {pip install black flake8 mypy pytest pytest-cov}. diff --git a/doc/moi/install.moi b/doc/moi/install.moi index 3338a7c..5851aa0 100644 --- a/doc/moi/install.moi +++ b/doc/moi/install.moi @@ -10,14 +10,14 @@ Map Machine requires \ref {https://www.python.org} {Python} 3.9, \ref {https://p \3 {Ubuntu} {ubuntu} -\code { +\code {shell} { apt install libcairo2-dev libgeos-dev pip install git+https://github.com/enzet/map-machine -} {shell} +} \3 {macOS} {macos} -\code { +\code {shell} { brew install cairo geos pip install git+https://github.com/enzet/map-machine -} {shell} \ No newline at end of file +} diff --git a/doc/moi/readme.moi b/doc/moi/readme.moi index 0cf095e..37f6a86 100644 --- a/doc/moi/readme.moi +++ b/doc/moi/readme.moi @@ -23,11 +23,11 @@ See \2 {Usage example} {usage-example} -\code {map-machine render -b=2.284,48.860,2.290,48.865} {bash} +\code {shell} {map-machine render -b=2.284,48.860,2.290,48.865} will automatically download OSM data and write output SVG map of the specified area to \m {out/map.svg}. See \ref {#map-generation} {Map generation}. -\code {map-machine tile -b=2.361,48.871,2.368,48.875} {bash} +\code {shell} {map-machine tile -b=2.361,48.871,2.368,48.875} will automatically download OSM data and write output PNG tiles that cover the specified area to the \m {out/tiles} directory. See \ref {#tile-generation} {Tile generation}. @@ -198,7 +198,7 @@ Requirements\: Python 3.9/* or higher*/. {install \ref {https://libgeos.org} {GEOS library},} {install Python packages with the command\:} -\code {pip install git+https://github.com/enzet/map-machine} {shell} +\code {shell} {pip install git+https://github.com/enzet/map-machine} For more detailed instructions, see \ref {doc/INSTALL.md} {instructions}. @@ -206,17 +206,17 @@ For more detailed instructions, see \ref {doc/INSTALL.md} {instructions}. Command \m {render} is used to generate SVG map from OpenStreetMap data. You can run it using\: -\code {map-machine render \\ +\code {shell} {map-machine render \\ -b=\formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\ -o=\formal {output file name} \\ -z=\formal {OSM zoom level} \\ - \formal {other arguments}} {bash} + \formal {other arguments}} \3 {Example} {example} -\code {map-machine render \\ +\code {shell} {map-machine render \\ --boundary-box=2.284,48.860,2.290,48.865 \\ - --output=out/esplanade_du_trocadéro.svg} {bash} + --output=out/esplanade_du_trocadéro.svg} will download OSM data to \m {cache/2.284,48.860,2.290,48.865.osm} and write an output SVG map of the specified area to \m {out/esplanade_du_trocadéro.svg}. @@ -238,19 +238,19 @@ plus \ref {#map-options} {map configuration options} Specify tile coordinates\: -\code {map-machine tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}} {bash} +\code {shell} {map-machine tile --tile \formal {OSM zoom level}/\formal {x}/\formal {y}} or specify any geographical coordinates inside a tile\: -\code {map-machine tile \\ +\code {shell} {map-machine tile \\ --coordinates=\formal {latitude},\formal {longitude} \\ - --zoom=\formal {OSM zoom levels}} {bash} + --zoom=\formal {OSM zoom levels}} Tile will be stored as SVG file \m {out/tiles/tile___.svg} and PNG file \m {out/tiles/tile___.svg}, where \m {x} and \m {y} are tile coordinates. \m {--zoom} option will be ignored if it is used with \m {--tile} option. Example\: -\code {map-machine tile -c=55.7510637,37.6270761 -z=18} {bash} +\code {shell} {map-machine tile -c=55.7510637,37.6270761 -z=18} will generate SVG file \m {out/tiles/tile_18_158471_81953.svg} and PNG file \m {out/tiles/tile_18_158471_81953.png}. @@ -258,15 +258,15 @@ will generate SVG file \m {out/tiles/tile_18_158471_81953.svg} and PNG file \m { Specify boundary box to get the minimal set of tiles that covers the area\: -\code {map-machine tile \\ +\code {shell} {map-machine tile \\ --boundary-box=\formal {min longitude},\formal {min latitude},\formal {max longitude},\formal {max latitude} \\ - --zoom=\formal {OSM zoom levels}} {bash} + --zoom=\formal {OSM zoom levels}} The boundary box will be extended to the boundaries of the minimal tileset that covers the area, then it will be extended a bit more to avoid some artifacts on the edges rounded to 3 digits after the decimal point. Map with new boundary box coordinates will be written to the cache directory as SVG and PNG files. All tiles will be stored as SVG files \m {out/tiles/tile___.svg} and PNG files \m {out/tiles/tile___.svg}, where \m {x} and \m {y} are tile coordinates. Example\: -\code {map-machine tile -b=2.361,48.871,2.368,48.875} {bash} +\code {shell} {map-machine tile -b=2.361,48.871,2.368,48.875} will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the way to 18/132796/90169 and two cached files \m {cache/2.360,48.869,2.370,48.877_18.svg} and \m {cache/2.360,48.869,2.370,48.877_18.png}. @@ -274,7 +274,7 @@ will generate 36 PNG tiles at zoom level 18 from tile 18/132791/90164 all the wa Command \m {server} is used to run tile server for slippy maps. -\code {map-machine server} +\code {shell} {map-machine server} Stop server interrupting the process with \kbd {Ctrl} + \kbd {C}. @@ -284,15 +284,15 @@ Stop server interrupting the process with \kbd {Ctrl} + \kbd {C}. Create a minimal amount of tiles that cover specified boundary box for zoom levels 16, 17, 18, and 19\: -\code {map-machine tile -b=2.364,48.854,2.367,48.857 -z=16-19} {bash} +\code {shell} {map-machine tile -b=2.364,48.854,2.367,48.857 -z=16-19} Run tile server on 127.0.0.1\:8080\: -\code {map-machine server} {bash} +\code {shell} {map-machine server} Use JavaScript code for \ref {https://leafletjs.com/} {Leaflet}\: -\code {var map = L.map('mapid').setView([48.8555, 2.3655], 18); +\code {javascript} {var map = L.map('mapid').setView([48.8555, 2.3655], 18); L.tileLayer('http://127.0.0.1:8080/tiles/\{z\}/\{x\}/\{y\}', \{ maxZoom: 19, @@ -303,11 +303,11 @@ L.tileLayer('http://127.0.0.1:8080/tiles/\{z\}/\{x\}/\{y\}', \{ id: 'map_machine', tileSize: 256, zoomOffset: 0 -\}).addTo(map);} {js} +\}).addTo(map);} HTML code\: -\code {
} {html} +\code {html} {
} \2 {Map options} {map-options}