Skip to content

Commit 60c6479

Browse files
committed
second pass
1 parent b360423 commit 60c6479

File tree

8 files changed

+112
-20
lines changed

8 files changed

+112
-20
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,6 @@ dmypy.json
135135
# Virtualenv
136136
venv
137137

138+
/docs/src/api
139+
138140
.DS_Store

CONTRIBUTING.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Contributing
2+
3+
Issues and pull requests are more than welcome.
4+
5+
**dev install**
6+
7+
```bash
8+
git clone https://github.com/stac-utils/stac-fastapi.git
9+
cd stac-fastapi
10+
python -m pip install -e stac_fastapi/api[dev]
11+
```
12+
13+
**pre-commit**
14+
15+
This repo is set to use `pre-commit` to run *ruff*, *pydocstring* and mypy when committing new code.
16+
17+
```bash
18+
pre-commit install
19+
```
20+
21+
### Docs
22+
23+
```bash
24+
git clone https://github.com/stac-utils/stac-fastapi.git
25+
cd stac-fastapi
26+
python pip install -e stac_fastapi/api["docs"]
27+
```
28+
29+
Hot-reloading docs:
30+
31+
```bash
32+
$ mkdocs serve -f docs/mkdocs.yml
33+
```
34+
35+
To manually deploy docs (note you should never need to do this because GitHub
36+
Actions deploys automatically for new commits.):
37+
38+
```bash
39+
Create API documentations
40+
$ pdocs as_markdown \
41+
--output_dir docs/src/api/ \
42+
--exclude_source \
43+
--overwrite \
44+
stac_fastapi.opensearch
45+
46+
# deploy
47+
$ mkdocs gh-deploy -f docs/mkdocs.yml
48+
```

Dockerfile.docs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@ COPY . /opt/src
1111
WORKDIR /opt/src
1212

1313
RUN python -m pip install \
14-
stac_fastapi/api \
15-
stac_fastapi/types \
16-
stac_fastapi/elasticsearch
14+
stac_fastapi/core \
15+
stac_fastapi/elasticsearch \
16+
stac_fastapi/opensearch
17+
18+
# CMD ["pdocs", \
19+
# "as_markdown", \
20+
# "--output_dir", \
21+
# "docs/src/api/", \
22+
# "--exclude_source", \
23+
# "--overwrite", \
24+
# "stac_fastapi.core"]
1725

1826
CMD ["pdocs", \
1927
"as_markdown", \
2028
"--output_dir", \
21-
"docs/elasticsearch/", \
29+
"docs/src/api/", \
2230
"--exclude_source", \
2331
"--overwrite", \
24-
"stac_fastapi.elasticsearch"]
32+
"stac_fastapi"]

docker-compose.docs.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ services:
88
dockerfile: Dockerfile.docs
99
platform: linux/amd64
1010
environment:
11-
- POSTGRES_USER=username
12-
- POSTGRES_PASS=password
13-
- POSTGRES_DBNAME=postgis
14-
- POSTGRES_HOST_READER=database
15-
- POSTGRES_HOST_WRITER=database
16-
- POSTGRES_PORT=5432
11+
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
12+
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
13+
- STAC_FASTAPI_VERSION=2.1
14+
- APP_HOST=0.0.0.0
15+
- APP_PORT=8082
16+
- RELOAD=true
17+
- ENVIRONMENT=local
18+
- WEB_CONCURRENCY=10
19+
- ES_HOST=opensearch
20+
- ES_PORT=9202
21+
- ES_USE_SSL=false
22+
- ES_VERIFY_CERTS=false
23+
- BACKEND=opensearch
1724
volumes:
1825
- .:/opt/src

docs/mkdocs.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ site_description: STAC FastAPI.
44
# Repository
55
repo_name: "stac-utils/stac-fastapi-elasticsearch-opensearch"
66
repo_url: "https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch"
7-
edit_uri: "blob/main/docs/src/"
7+
edit_uri: "blob/makedocs/docs/src/"
88

99
docs_dir: 'src'
1010
site_dir: 'build'
@@ -17,16 +17,38 @@ extra:
1717

1818
# Layout
1919
nav:
20-
- Home: "index.md"
20+
- Home: index.md
2121
- Tips and Tricks: tips-and-tricks.md
22-
- ELASTICSEARCH:
23-
- packages: elasticsearch/stac_fastapi/index.md
22+
- API:
2423
- stac_fastapi.elasticsearch:
25-
- module: elasticsearch/stac_fastapi/elasticsearch/index.md
26-
- app: elasticsearch/stac_fastapi/elasticsearch/app.md
27-
- config: elasticsearch/stac_fastapi/elasticsearch/config.md
28-
- database_logic: elasticsearch/stac_fastapi/elasticsearch/database_logic.md
29-
- version: elasticsearch/stac_fastapi/elasticsearch/version.md
24+
- app: api/stac_fastapi/elasticsearch/app.md
25+
- module: api/stac_fastapi/elasticsearch/index.md
26+
- config: api/stac_fastapi/elasticsearch/config.md
27+
- database_logic: api/stac_fastapi/elasticsearch/database_logic.md
28+
- index: api/stac_fastapi/elasticsearch/index.md
29+
- version: api/stac_fastapi/elasticsearch/version.md
30+
- stac_fastapi.opensearch:
31+
- app: api/stac_fastapi/opensearch/app.md
32+
- module: api/stac_fastapi/opensearch/index.md
33+
- config: api/stac_fastapi/opensearch/config.md
34+
- database_logic: api/stac_fastapi/opensearch/database_logic.md
35+
- index: api/stac_fastapi/opensearch/index.md
36+
- version: api/stac_fastapi/opensearch/version.md
37+
- stac_fastapi.core:
38+
- module: api/stac_fastapi/core/index.md
39+
- base_database_logic: api/stac_fastapi/core/base_database_logic.md
40+
- base_settings: api/stac_fastapi/core/base_settings.md
41+
- core: api/stac_fastapi/core/core.md
42+
- extensions:
43+
- module: api/stac_fastapi/core/extensions/index.md
44+
- filter: api/stac_fastapi/core/extensions/filter.md
45+
- query: api/stac_fastapi/core/extensions/query.md
46+
- models:
47+
- module: api/stac_fastapi/core/models/index.md
48+
- links: api/stac_fastapi/core/models/links.md
49+
- search: api/stac_fastapi/core/models/search.md
50+
- serializers: api/stac_fastapi/core/serializers.md
51+
- version: api/stac_fastapi/core/version.md
3052
- Development - Contributing: "contributing.md"
3153
- Release Notes: "release-notes.md"
3254

docs/src/contributing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CONTRIBUTING.md

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../README.md

docs/src/stylesheets/extra.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
:root {
2+
--md-primary-fg-color: rgb(13, 118, 160);
3+
}

0 commit comments

Comments
 (0)