Skip to content

Add Python docs setup #39

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

Merged
merged 5 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 11 additions & 0 deletions python/docs/api/store/aws.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# AWS S3

::: async_tiff.store.S3Store
::: async_tiff.store.S3ConfigInput
options:
show_if_no_docstring: true
::: async_tiff.store.S3Config
options:
show_if_no_docstring: true
::: async_tiff.store.S3Credential
::: async_tiff.store.S3CredentialProvider
14 changes: 14 additions & 0 deletions python/docs/api/store/azure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Microsoft Azure

::: async_tiff.store.AzureStore
::: async_tiff.store.AzureAccessKey
::: async_tiff.store.AzureConfigInput
options:
show_if_no_docstring: true
::: async_tiff.store.AzureConfig
options:
show_if_no_docstring: true
::: async_tiff.store.AzureSASToken
::: async_tiff.store.AzureBearerToken
::: async_tiff.store.AzureCredential
::: async_tiff.store.AzureCredentialProvider
5 changes: 5 additions & 0 deletions python/docs/api/store/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Configuration

::: async_tiff.store.ClientConfig
::: async_tiff.store.BackoffConfig
::: async_tiff.store.RetryConfig
11 changes: 11 additions & 0 deletions python/docs/api/store/gcs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Google Cloud Storage

::: async_tiff.store.GCSStore
::: async_tiff.store.GCSConfigInput
options:
show_if_no_docstring: true
::: async_tiff.store.GCSConfig
options:
show_if_no_docstring: true
::: async_tiff.store.GCSCredential
::: async_tiff.store.GCSCredentialProvider
3 changes: 3 additions & 0 deletions python/docs/api/store/http.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# HTTP

::: async_tiff.store.HTTPStore
4 changes: 4 additions & 0 deletions python/docs/api/store/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# ObjectStore

::: async_tiff.store.from_url
::: async_tiff.store.ObjectStore
3 changes: 3 additions & 0 deletions python/docs/api/store/local.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Local

::: async_tiff.store.LocalStore
3 changes: 3 additions & 0 deletions python/docs/api/store/memory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Memory

::: async_tiff.store.MemoryStore
Binary file added python/docs/assets/logo_no_text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/docs/index.md
18 changes: 18 additions & 0 deletions python/docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% extends "base.html" %}

{% block content %}
{% if page.nb_url %}
<a href="{{ page.nb_url }}" title="Download Notebook" class="md-content__button md-icon">
{% include ".icons/material/download.svg" %}
</a>
{% endif %}

{{ super() }}
{% endblock content %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
43 changes: 43 additions & 0 deletions python/docs/overrides/stylesheets/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
:root,
[data-md-color-scheme="default"] {
/* --md-heading-font: "Oswald"; */
--md-primary-fg-color: #cf3f02;
--md-default-fg-color: #443f3f;
--boxShadowD: 0px 12px 24px 0px rgba(68, 63, 63, 0.08),
0px 0px 4px 0px rgba(68, 63, 63, 0.08);
}
body {
margin: 0;
padding: 0;
/* font-size: 16px; */
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: var(--md-heading-font);
font-weight: bold;
}
.md-typeset h1,
.md-typeset h2 {
font-weight: normal;
color: var(--md-default-fg-color);
}
.md-typeset h3,
.md-typeset h4 {
font-weight: bold;
color: var(--md-default-fg-color);
}
.md-button,
.md-typeset .md-button {
font-family: var(--md-heading-font);
}
.md-content .supheading {
font-family: var(--md-heading-font);
text-transform: uppercase;
color: var(--md-primary-fg-color);
font-size: 0.75rem;
font-weight: bold;
}
149 changes: 149 additions & 0 deletions python/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
site_name: async-tiff
repo_name: developmentseed/async-tiff
repo_url: https://github.com/developmentseed/async-tiff
site_description: A fast, low-level async TIFF reader powered by Rust.
site_author: Development Seed
# Note: trailing slash recommended with mike:
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/#publishing-a-new-version
site_url: https://developmentseed.org/async-tiff/
docs_dir: docs

extra:
social:
- icon: "fontawesome/brands/github"
link: "https://github.com/developmentseed"
- icon: "fontawesome/brands/twitter"
link: "https://twitter.com/developmentseed"
- icon: "fontawesome/brands/linkedin"
link: "https://www.linkedin.com/company/development-seed"
version:
alias: true
provider: mike

nav:
- "index.md"
- API Reference:
- async-tiff.store:
- api/store/index.md
- api/store/aws.md
- api/store/gcs.md
- api/store/azure.md
- api/store/http.md
- api/store/local.md
- api/store/memory.md
- api/store/config.md
# - API Reference:
# - api/rtree.md
# - api/kdtree.md
# - Changelog: CHANGELOG.md

watch:
- python
- docs

theme:
language: en
name: material
custom_dir: docs/overrides
logo: assets/logo_no_text.png
palette:
# Palette toggle for automatic mode
- media: "(prefers-color-scheme)"
toggle:
icon: material/brightness-auto
name: Switch to light mode

# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
primary: default
accent: deep orange
toggle:
icon: material/brightness-7
name: Switch to dark mode

# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: default
accent: deep orange
toggle:
icon: material/brightness-4
name: Switch to system preference

font:
text: Roboto
code: Roboto Mono

features:
- content.code.annotate
- content.code.copy
- navigation.indexes
- navigation.instant
- navigation.tracking
- search.suggest
- search.share

extra_css:
- overrides/stylesheets/extra.css

plugins:
- search
# - social
- mike:
alias_type: "copy"
canonical_version: "latest"
- mkdocstrings:
enable_inventory: true
handlers:
python:
paths: [python]
options:
# We set allow_inspection: false to ensure that all docstrings come
# from the pyi files, not the Rust-facing doc comments.
allow_inspection: false
docstring_section_style: list
docstring_style: google
line_length: 80
separate_signature: true
show_root_heading: true
show_signature_annotations: true
show_source: false
show_symbol_type_toc: true
signature_crossrefs: true
extensions:
- griffe_inherited_docstrings

import:
- https://docs.python.org/3/objects.inv
- https://developmentseed.org/obstore/latest/objects.inv

# https://github.com/developmentseed/titiler/blob/50934c929cca2fa8d3c408d239015f8da429c6a8/docs/mkdocs.yml#L115-L140
markdown_extensions:
- admonition
- attr_list
- codehilite:
guess_lang: false
- def_list
- footnotes
- md_in_html
- pymdownx.arithmatex
- pymdownx.betterem
- pymdownx.caret:
insert: false
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg
- pymdownx.escapeall:
hardbreak: true
nbsp: true
- pymdownx.magiclink:
hide_protocol: true
repo_url_shortener: true
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
- toc:
permalink: true
5 changes: 4 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ python-source = "python"

[tool.uv]
dev-dependencies = [
# To enable following symlinks for pyi files
"griffe>=1.6.0",
"griffe-inherited-docstrings>=1.0.1",
"ipykernel>=6.29.5",
"maturin>=1.7.4",
"mike>=2.1.3",
"mkdocs-material[imaging]>=9.5.40",
"mkdocs-material[imaging]>=9.6.3",
"mkdocs>=1.6.1",
"mkdocstrings-python>=1.13.0",
"mkdocstrings>=0.27.0",
"numpy>=1",
"pip>=24.2",
"pytest-asyncio>=0.24.0",
"pytest>=8.3.3",
"ruff>=0.8.4",
]
24 changes: 20 additions & 4 deletions python/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.