From 20858a6f5868bc4a65b5e251e45d5111661c3a15 Mon Sep 17 00:00:00 2001 From: Marcelo Prates Date: Fri, 16 May 2025 22:18:01 -0300 Subject: [PATCH] Enhance documentation with detailed usage examples and feature descriptions for Prettymaps. --- docs/api.md | 6 ++++-- docs/index.md | 23 +++++++++++++++++++++- docs/usage.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 78 insertions(+), 5 deletions(-) diff --git a/docs/api.md b/docs/api.md index 35c271c..1653154 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,5 +1,7 @@ # API Reference -This page will contain the API reference for Prettymaps. +This section is auto-generated from the Prettymaps source code. -_More details coming soon!_ \ No newline at end of file +::: prettymaps.draw + +::: prettymaps.fetch \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index a40e10b..eb36ba9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,3 +1,24 @@ # Prettymaps Documentation -Welcome to the Prettymaps documentation site. \ No newline at end of file +Welcome to the Prettymaps documentation site. + +Prettymaps is a minimal Python library to draw beautiful maps from OpenStreetMap data. +It allows you to easily generate artistic, customizable maps for any location in the world. + +## Features + +- Fetches and visualizes OpenStreetMap data with minimal code +- Highly customizable layers and styles +- Supports elevation, hillshading, and keypoints +- Preset system for reusable map styles +- Export to PNG, SVG, and plotter-friendly formats + +## Quick Example + +```python +import prettymaps + +prettymaps.plot("Porto Alegre, Brazil") +``` + +Explore the [Usage](usage.md) and [API Reference](api.md) for more details. \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md index 01e3b00..ee2f4d3 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -1,5 +1,55 @@ # Usage -This page will describe how to use Prettymaps. +## Installation -_More details coming soon!_ \ No newline at end of file +Install Prettymaps and its dependencies: + +```sh +pip install prettymaps +``` + +## Basic Usage + +Generate a map for a location: + +```python +import prettymaps + +prettymaps.plot("Paris, France") +``` + +## Customizing Layers and Styles + +You can customize which map layers to show and their appearance: + +```python +layers = { + "perimeter": {}, + "streets": {"width": 8}, + "buildings": {}, + "water": {}, +} +style = { + "perimeter": {"fc": "#f2efe9", "ec": "#333"}, + "streets": {"fc": "#cccccc"}, + "buildings": {"fc": "#b0b0b0"}, + "water": {"fc": "#aadaff"}, +} +prettymaps.plot("Berlin, Germany", layers=layers, style=style) +``` + +## Saving Maps + +You can save the generated map to a file: + +```python +prettymaps.plot("Tokyo, Japan", save_as="tokyo_map.png") +``` + +## Advanced Features + +- **Keypoints:** Highlight specific places or features on the map. +- **Presets:** Save and reuse your favorite map styles. +- **Hillshade:** Add elevation shading for a 3D effect. + +See the [API Reference](api.md) for all available options. \ No newline at end of file