├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── feature_request.md └── workflows │ └── docs.yml ├── .gitignore ├── .pre-commit-config.yaml ├── LICENSE ├── README.md ├── docs ├── chapter_01 │ ├── basemaps.ipynb │ └── intro.ipynb ├── chapter_02 │ ├── colorbar.ipynb │ └── heatmap.ipynb ├── index.md ├── overrides │ └── main.html └── template.ipynb ├── mkdocs.yml └── requirements.txt /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a bug report to help us improve 4 | labels: bug 5 | --- 6 | 7 | 8 | 9 | ### Environment Information 10 | 11 | - Package version: 12 | - Python version: 13 | - Operating System: 14 | 15 | ### Description 16 | 17 | Describe what you were trying to get done. 18 | Tell us what happened, what went wrong, and what you expected to happen. 19 | 20 | ### What I Did 21 | 22 | ``` 23 | Paste the command(s) you ran and the output. 24 | If there was a crash, please include the traceback here. 25 | ``` 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: Ask questions 3 | url: https://github.com/giswqs/mkdocs-template/discussions/categories/q-a 4 | about: Please ask and answer questions here. 5 | - name: Ideas 6 | url: https://github.com/giswqs/mkdocs-template/discussions/categories/ideas 7 | about: Please share your ideas here. 8 | - name: Ask questions from the GEE community 9 | url: https://gis.stackexchange.com/questions/tagged/google-earth-engine 10 | about: To get answers from questions in the GEE commminuty, please ask and answer questions here. 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: Submit a feature request to help us improve 4 | labels: Feature Request 5 | --- 6 | 7 | 8 | 9 | ### Description 10 | 11 | Describe the feature (e.g., new functions/tutorials) you would like to propose. 12 | Tell us what can be achieved with this new feature and what's the expected outcome. 13 | 14 | ### Source code 15 | 16 | ``` 17 | Paste your source code here if have sample code to share. 18 | ``` 19 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: docs 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | deploy: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v3 11 | - uses: actions/setup-python@v4 12 | with: 13 | python-version: "3.11" 14 | - name: Install dependencies 15 | run: | 16 | python -m pip install --upgrade pip 17 | pip install --user --no-cache-dir Cython 18 | pip install --user -r requirements.txt 19 | - name: Discover typos with codespell 20 | run: | 21 | pip install codespell 22 | codespell --skip=".*,.git/*,*.csv,*.geojson,*.json,*.js,*.html,*cff,*.pdf" --ignore-words-list="aci,acount,acounts,fallow,hart,hist,nd,ned,ois,wqs" 23 | - name: Install dependencies 24 | run: pip install mkdocs-material mkdocstrings mkdocs-git-revision-date-plugin mkdocs-jupyter mkdocs-pdf-export-plugin ipykernel 25 | - name: deploy 26 | run: mkdocs gh-deploy --force 27 | env: 28 | RUN_GITHUB_ACTION: ${{ secrets.RUN_GITHUB_ACTION }} 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/pre-commit/pre-commit-hooks 3 | rev: v5.0.0 4 | hooks: 5 | - id: check-toml 6 | - id: check-yaml 7 | - id: end-of-file-fixer 8 | types: [python] 9 | - id: trailing-whitespace 10 | - id: requirements-txt-fixer 11 | - id: check-added-large-files 12 | args: ["--maxkb=500"] 13 | 14 | - repo: https://github.com/psf/black 15 | rev: 25.1.0 16 | hooks: 17 | - id: black-jupyter 18 | 19 | - repo: https://github.com/codespell-project/codespell 20 | rev: v2.4.1 21 | hooks: 22 | - id: codespell 23 | args: 24 | [ 25 | "--ignore-words-list=aci,acount,acounts,fallow,ges,hart,hist,nd,ned,ois,wqs,watermask,tre,mape", 26 | "--skip=*.csv,*.geojson,*.json,*.yml*.js,*.html,*cff,*.pdf", 27 | ] 28 | 29 | - repo: https://github.com/kynan/nbstripout 30 | rev: 0.8.1 31 | hooks: 32 | - id: nbstripout 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Qiusheng Wu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mkdocs-template 2 | A template for turning Jupyter notebooks and markdown files into a website. 3 | 4 | Steps to use this template: 5 | 6 | - Click the **Use this template** green button on this GitHub repo and fill in the details to create a repo under your account. 7 | - Clone the newly created repo to your computer and open it using a Text Editor (e.g., Visual Studio Code). 8 | - Use the Text Editor to search `mkdocs-template` and replace it with your repo name. 9 | - Add/remove dependencies in `requirements.txt` if need. 10 | - Add folders (e.g., `chapter_01`) and files (e.g., `intro.ipynb`, `index.md`) to the `docs` folder. 11 | - Open `mkdocs.yml` and make several changes, including `site_name`, `site_url`, `repo_url`, and `nav`. If you don't want the notebooks to be executed when building the website, set `execute: False` under `plugins`. 12 | - Customize the issue template (`.github/ISSUE_TEMPLATE/config.yml`) if needed. 13 | - Commit the changes using Git and push changes to GitHub. 14 | - Enable GitHub Pages through GitHub Settings - Pages. 15 | - Check out the website at https://username.github.io/repo-name. -------------------------------------------------------------------------------- /docs/chapter_01/basemaps.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import leafmap.foliumap as leafmap" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "m = leafmap.Map()\n", 19 | "m.add_basemap(\"HYBRID\")\n", 20 | "m" 21 | ] 22 | } 23 | ], 24 | "metadata": { 25 | "interpreter": { 26 | "hash": "31f05ea183a4718249d13ada7f166c6bdba1d00716247af5c11c23af8d5923f1" 27 | }, 28 | "kernelspec": { 29 | "display_name": "Python 3.9.9 ('geo')", 30 | "language": "python", 31 | "name": "python3" 32 | }, 33 | "language_info": { 34 | "codemirror_mode": { 35 | "name": "ipython", 36 | "version": 3 37 | }, 38 | "file_extension": ".py", 39 | "mimetype": "text/x-python", 40 | "name": "python", 41 | "nbconvert_exporter": "python", 42 | "pygments_lexer": "ipython3", 43 | "version": "3.9.9" 44 | } 45 | }, 46 | "nbformat": 4, 47 | "nbformat_minor": 2 48 | } 49 | -------------------------------------------------------------------------------- /docs/chapter_01/intro.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import leafmap.foliumap as leafmap" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "m = leafmap.Map()\n", 19 | "m" 20 | ] 21 | } 22 | ], 23 | "metadata": { 24 | "interpreter": { 25 | "hash": "31f05ea183a4718249d13ada7f166c6bdba1d00716247af5c11c23af8d5923f1" 26 | }, 27 | "kernelspec": { 28 | "display_name": "Python 3.9.9 ('geo')", 29 | "language": "python", 30 | "name": "python3" 31 | }, 32 | "language_info": { 33 | "codemirror_mode": { 34 | "name": "ipython", 35 | "version": 3 36 | }, 37 | "file_extension": ".py", 38 | "mimetype": "text/x-python", 39 | "name": "python", 40 | "nbconvert_exporter": "python", 41 | "pygments_lexer": "ipython3", 42 | "version": "3.9.9" 43 | } 44 | }, 45 | "nbformat": 4, 46 | "nbformat_minor": 2 47 | } 48 | -------------------------------------------------------------------------------- /docs/chapter_02/colorbar.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import leafmap.foliumap as leafmap" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "Map = leafmap.Map()\n", 19 | "\n", 20 | "url = \"https://elevation.nationalmap.gov/arcgis/services/3DEPElevation/ImageServer/WMSServer?\"\n", 21 | "Map.add_wms_layer(\n", 22 | " url,\n", 23 | " layers=\"3DEPElevation:Hillshade Elevation Tinted\",\n", 24 | " name=\"USGS 3DEP Elevation\",\n", 25 | " format=\"image/png\",\n", 26 | " transparent=True,\n", 27 | ")" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "colors = [\"006633\", \"E5FFCC\", \"662A00\", \"D8D8D8\", \"F5F5F5\"]\n", 37 | "vmin = 0\n", 38 | "vmax = 4000\n", 39 | "\n", 40 | "Map.add_colorbar(colors=colors, vmin=vmin, vmax=vmax)\n", 41 | "\n", 42 | "Map" 43 | ] 44 | } 45 | ], 46 | "metadata": { 47 | "interpreter": { 48 | "hash": "31f05ea183a4718249d13ada7f166c6bdba1d00716247af5c11c23af8d5923f1" 49 | }, 50 | "kernelspec": { 51 | "display_name": "Python 3.9.9 ('geo')", 52 | "language": "python", 53 | "name": "python3" 54 | }, 55 | "language_info": { 56 | "codemirror_mode": { 57 | "name": "ipython", 58 | "version": 3 59 | }, 60 | "file_extension": ".py", 61 | "mimetype": "text/x-python", 62 | "name": "python", 63 | "nbconvert_exporter": "python", 64 | "pygments_lexer": "ipython3", 65 | "version": "3.9.9" 66 | } 67 | }, 68 | "nbformat": 4, 69 | "nbformat_minor": 2 70 | } 71 | -------------------------------------------------------------------------------- /docs/chapter_02/heatmap.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": null, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import leafmap.foliumap as leafmap" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": {}, 16 | "outputs": [], 17 | "source": [ 18 | "filepath = \"https://raw.githubusercontent.com/giswqs/leafmap/master/examples/data/us_cities.csv\"" 19 | ] 20 | }, 21 | { 22 | "cell_type": "code", 23 | "execution_count": null, 24 | "metadata": {}, 25 | "outputs": [], 26 | "source": [ 27 | "m = leafmap.Map()\n", 28 | "m.add_heatmap(\n", 29 | " filepath,\n", 30 | " latitude=\"latitude\",\n", 31 | " longitude=\"longitude\",\n", 32 | " value=\"pop_max\",\n", 33 | " name=\"Heat map\",\n", 34 | " radius=20,\n", 35 | ")\n", 36 | "m" 37 | ] 38 | } 39 | ], 40 | "metadata": { 41 | "interpreter": { 42 | "hash": "31f05ea183a4718249d13ada7f166c6bdba1d00716247af5c11c23af8d5923f1" 43 | }, 44 | "kernelspec": { 45 | "display_name": "Python 3.9.9 ('geo')", 46 | "language": "python", 47 | "name": "python3" 48 | }, 49 | "language_info": { 50 | "codemirror_mode": { 51 | "name": "ipython", 52 | "version": 3 53 | }, 54 | "file_extension": ".py", 55 | "mimetype": "text/x-python", 56 | "name": "python", 57 | "nbconvert_exporter": "python", 58 | "pygments_lexer": "ipython3", 59 | "version": "3.9.9" 60 | } 61 | }, 62 | "nbformat": 4, 63 | "nbformat_minor": 2 64 | } 65 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | 2 | A template for turning Jupyter notebooks and markdown files into a website. 3 | 4 | Steps to use this template: 5 | 6 | - Click the **Use this template** green button on this GitHub repo and fill in the details to create a repo under your account. 7 | - Clone the newly created repo to your computer and open it using a Text Editor (e.g., Visual Studio Code). 8 | - Use the Text Editor to search `mkdocs-template` and replace it with your repo name. 9 | - Add/remove dependencies in `requirements.txt` if need. 10 | - Add folders (e.g., `chapter_01`) and files (e.g., `intro.ipynb`, `index.md`) to the `docs` folder. 11 | - Open `mkdocs.yml` and make several changes, including `site_name`, `site_url`, `repo_url`, and `nav`. If you don't want the notebooks to be executed when building the website, set `execute: False` under `plugins`. 12 | - Customize the issue template (`.github/ISSUE_TEMPLATE/config.yml`) if needed. 13 | - Commit the changes using Git and push changes to GitHub. 14 | - Enable GitHub Pages through GitHub Settings - Pages. 15 | - Check out the website at https://username.github.io/repo-name. -------------------------------------------------------------------------------- /docs/overrides/main.html: -------------------------------------------------------------------------------- 1 | {% extends "base.html" %} 2 | 3 | {% block content %} 4 | {% if page.nb_url %} 5 | 6 | {% include ".icons/material/download.svg" %} 7 | 8 | {% endif %} 9 | 10 | {{ super() }} 11 | {% endblock content %} 12 | -------------------------------------------------------------------------------- /docs/template.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "attachments": {}, 5 | "cell_type": "markdown", 6 | "id": "0", 7 | "metadata": {}, 8 | "source": [ 9 | "[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/giswqs/mkdocs-template/blob/master/docs/template.ipynb)\n", 10 | "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/giswqs/mkdocs-template/HEAD?labpath=docs%2Ftemplate.ipynb)" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": null, 16 | "id": "1", 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "# !pip install leafmap" 21 | ] 22 | }, 23 | { 24 | "cell_type": "code", 25 | "execution_count": null, 26 | "id": "2", 27 | "metadata": {}, 28 | "outputs": [], 29 | "source": [] 30 | } 31 | ], 32 | "metadata": { 33 | "kernelspec": { 34 | "display_name": "Python 3", 35 | "language": "python", 36 | "name": "python3" 37 | }, 38 | "language_info": { 39 | "codemirror_mode": { 40 | "name": "ipython", 41 | "version": 3 42 | }, 43 | "file_extension": ".py", 44 | "mimetype": "text/x-python", 45 | "name": "python", 46 | "nbconvert_exporter": "python", 47 | "pygments_lexer": "ipython3", 48 | "version": "3.10.8" 49 | } 50 | }, 51 | "nbformat": 4, 52 | "nbformat_minor": 5 53 | } 54 | -------------------------------------------------------------------------------- /mkdocs.yml: -------------------------------------------------------------------------------- 1 | site_name: Mkdocs Template 2 | site_description: A website template for using mkdocs 3 | site_author: Qiusheng Wu 4 | site_url: https://giswqs.github.io/mkdocs-template 5 | 6 | repo_url: https://github.com/giswqs/mkdocs-template 7 | 8 | copyright: "Copyright © 2022 - 2025 Qiusheng Wu" 9 | 10 | theme: 11 | palette: 12 | - scheme: default 13 | # primary: blue 14 | # accent: indigo 15 | toggle: 16 | icon: material/toggle-switch-off-outline 17 | name: Switch to dark mode 18 | - scheme: slate 19 | primary: indigo 20 | accent: indigo 21 | toggle: 22 | icon: material/toggle-switch 23 | name: Switch to light mode 24 | name: material 25 | icon: 26 | repo: fontawesome/brands/github 27 | features: 28 | - navigation.instant 29 | - search.highlight 30 | custom_dir: "docs/overrides" 31 | font: 32 | text: Google Sans 33 | code: Regular 34 | 35 | plugins: 36 | - search 37 | - mkdocstrings 38 | - git-revision-date 39 | - mkdocs-jupyter: 40 | include_source: True 41 | ignore_h1_titles: True 42 | execute: True 43 | allow_errors: false 44 | ignore: ["name.ipynb"] 45 | execute_ignore: ["path/*.ipynb"] 46 | 47 | markdown_extensions: 48 | - attr_list 49 | - toc: 50 | permalink: true 51 | 52 | # extra: 53 | # analytics: 54 | # provider: google 55 | # property: G-XXX 56 | 57 | nav: 58 | - Home: index.md 59 | - Notebook: 60 | - template.ipynb 61 | - Chapter 1: 62 | - chapter_01/intro.ipynb 63 | - chapter_01/basemaps.ipynb 64 | - Chapter 2: 65 | - chapter_02/colorbar.ipynb 66 | - chapter_02/heatmap.ipynb 67 | - YouTube Channel: https://youtube.com/@giswqs 68 | - Report Issues: https://github.com/giswqs/mkdocs-template/issues 69 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | --find-links=https://girder.github.io/large_image_wheels GDAL 2 | geemap 3 | geopandas 4 | leafmap 5 | --------------------------------------------------------------------------------