Skip to content

Commit 507919a

Browse files
authored
Merge pull request #16 from openbridge/mkdocs-hosting
Mkdocs hosting
2 parents e3e278a + 7dfd39e commit 507919a

20 files changed

Lines changed: 370 additions & 50 deletions

.github/workflows/docs.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "mkdocs.yml"
8+
- "requirements-docs.txt"
9+
- "docs/**"
10+
- "api-usage-docs/**"
11+
- "tutorials/**"
12+
- "products/**"
13+
pull_request:
14+
paths:
15+
- "mkdocs.yml"
16+
- "requirements-docs.txt"
17+
- "docs/**"
18+
- "api-usage-docs/**"
19+
- "tutorials/**"
20+
- "products/**"
21+
workflow_dispatch:
22+
23+
concurrency:
24+
group: pages
25+
cancel-in-progress: false
26+
27+
jobs:
28+
build:
29+
runs-on: ubuntu-latest
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.x"
36+
37+
- run: pip install -r requirements-docs.txt
38+
39+
- run: mkdocs build --strict
40+
41+
- uses: actions/upload-pages-artifact@v3
42+
with:
43+
path: site
44+
45+
deploy:
46+
needs: build
47+
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
48+
runs-on: ubuntu-latest
49+
permissions:
50+
pages: write
51+
id-token: write
52+
environment:
53+
name: github-pages
54+
url: ${{ steps.deployment.outputs.page_url }}
55+
steps:
56+
- uses: actions/configure-pages@v5
57+
- uses: actions/deploy-pages@v4
58+
id: deployment

.pytest_cache/v/cache/stepwise

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Changelog
22

33
All notable changes to this project will be documented in this file.
4+
## [0.0.8] - 2026-08-11
5+
6+
### Added
7+
- Restructured Subscriptions API documentation around v2: `api-usage-docs/subscriptions-api.md` now documents v2 (versioned `/v2/...` routes, `product_parameters`, SPP endpoints, remote identity reconciliation) as the primary/recommended API.
8+
- Added `api-usage-docs/subscriptions-api-legacy.md`, preserving the v1 documentation for existing integrations that have not migrated.
9+
410
## [0.0.7] - 2025-01-02
511

612
### Added

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Use these docs in order if you are building a new integration:
4747
Find products and product payload definitions, including valid `stage_id` values.
4848
4. [Remote Identity API](./api-usage-docs/remote-identity-api.md)
4949
Find the identities your account can use and inspect identity health.
50-
5. [Subscriptions API](./api-usage-docs/subscriptions-api.md)
50+
5. [Subscriptions API (v2)](./api-usage-docs/subscriptions-api.md)
5151
Create, inspect, and update subscriptions.
5252
6. [History API](./api-usage-docs/history-api.md)
5353
Request historical backfills after a subscription is active.
@@ -63,7 +63,8 @@ Use these docs in order if you are building a new integration:
6363
| Account and user lookup | [api-usage-docs/account-user-api.md](./api-usage-docs/account-user-api.md) |
6464
| Products | [api-usage-docs/products-api.md](./api-usage-docs/products-api.md) |
6565
| Remote identities | [api-usage-docs/remote-identity-api.md](./api-usage-docs/remote-identity-api.md) |
66-
| Subscriptions | [api-usage-docs/subscriptions-api.md](./api-usage-docs/subscriptions-api.md) |
66+
| Subscriptions (v2) | [api-usage-docs/subscriptions-api.md](./api-usage-docs/subscriptions-api.md) |
67+
| Subscriptions (legacy v1) | [api-usage-docs/subscriptions-api-legacy.md](./api-usage-docs/subscriptions-api-legacy.md) |
6768
| History | [api-usage-docs/history-api.md](./api-usage-docs/history-api.md) |
6869
| OAuth flow and app records | [api-usage-docs/oauth-api.md](./api-usage-docs/oauth-api.md) |
6970
| State records | [api-usage-docs/state-api.md](./api-usage-docs/state-api.md) |

SKILL.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ Load these on demand — do not load all at once. Pick the file(s) relevant to t
6262
| Authentication & refresh tokens | `api-usage-docs/authentication-api.md` |
6363
| Getting account/user IDs | `api-usage-docs/account-user-api.md` |
6464
| Getting started / full flow walkthrough | `api-usage-docs/getting-started.md` |
65-
| Subscriptions CRUD | `api-usage-docs/subscriptions-api.md` |
65+
| Subscriptions CRUD (v2) | `api-usage-docs/subscriptions-api.md` |
66+
| Subscriptions CRUD (legacy v1) | `api-usage-docs/subscriptions-api-legacy.md` |
6667
| Products & stage IDs | `api-usage-docs/products-api.md` |
6768
| Remote identities & identity types (`/ri`, `/sri`, `/rit`) | `api-usage-docs/remote-identity-api.md` |
6869
| OAuth flow & OAuth app records | `api-usage-docs/oauth-api.md` |

api-usage-docs/service-amazon-advertising-api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ GET /service/amzadv/profiles-only/{remote_identity_id}
3030
| Parameter | Type | Description |
3131
|---|---|---|
3232
| `profile_types` | string | Comma-separated filter: `seller`, `vendor`, `dsp`, `attribution`. Omit to return all types. |
33+
| `is_manager` | string | `true` if the identity is connected to a manager account, `false` otherwise. |
3334

3435
**Example request**
3536

3637
```http
37-
GET https://service.api.openbridge.io/service/amzadv/profiles-only/112?profile_types=seller,vendor
38+
GET https://service.api.openbridge.io/service/amzadv/profiles-only/112?profile_types=seller,vendor&is_manager=false
3839
Authorization: Bearer <jwt>
3940
```
4041

api-usage-docs/service-ob-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Additional keys inside `storage_parameters` depend on the storage type and are p
7676

7777
**Supported `storage` values**
7878

79-
See [Storages](../products/storages.md) for all supported storage types and their required fields.
79+
See [Destinations](../products/destinations.md) for all supported storage types and their required fields.
8080

8181
---
8282

api-usage-docs/subscriptions-api-legacy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Before creating a subscription you will need your **account ID**, **user ID**, a
3434

3535
### Get Account ID and User ID
3636

37-
See [Account and User API](./account-api.md) for the endpoints that return your account ID and user ID. Use the `id` field from each response as `account` and `user` respectively in subscription requests.
37+
See [Account and User API](./account-user-api.md) for the endpoints that return your account ID and user ID. Use the `id` field from each response as `account` and `user` respectively in subscription requests.
3838

3939
---
4040

api-usage-docs/subscriptions-api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Before creating a subscription you will need your **account ID**, **user ID**, a
3636

3737
### Get Account ID and User ID
3838

39-
See [Account and User API](./account-api.md) for the endpoints that return your account ID and user ID. Use the `id` field from each response as `account` and `user` respectively in subscription requests.
39+
See [Account and User API](./account-user-api.md) for the endpoints that return your account ID and user ID. Use the `id` field from each response as `account` and `user` respectively in subscription requests.
4040

4141
---
4242

docs-hosting-recommendation.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Building & Serving the Docs
2+
3+
This repo's markdown docs are built into a searchable site with [MkDocs](https://www.mkdocs.org/) and the [Material theme](https://squidfunk.github.io/mkdocs-material/), published via GitHub Pages at **https://openbridge.github.io/embedded-api/**. This file covers how to build/serve locally and how deployment works. (For the original discussion of hosting-platform options — MkDocs vs. Docusaurus vs. Mintlify/ReadMe/GitBook — see git history on this file.)
4+
5+
## Prerequisites
6+
7+
```
8+
pip install -r requirements-docs.txt
9+
```
10+
11+
Installs `mkdocs`, `mkdocs-material`, and `mkdocs-llmstxt-md` (pinned in `requirements-docs.txt`).
12+
13+
## Local development
14+
15+
```
16+
mkdocs serve
17+
```
18+
19+
Starts a live-reloading dev server — edits to any `.md` file under `api-usage-docs/`, `tutorials/`, or `products/` refresh automatically. Because `site_url` is set to `https://openbridge.github.io/embedded-api/` (matching the real GitHub Pages URL), mkdocs serves locally under that same path prefix: `http://127.0.0.1:8000/embedded-api/`, not the bare root.
20+
21+
```
22+
mkdocs build
23+
```
24+
25+
Builds the static site into `site/` (gitignored — regenerated on every build, never committed).
26+
27+
```
28+
mkdocs build --strict
29+
```
30+
31+
Same as above, but treats broken internal links/anchors as errors instead of warnings. This is also what CI runs.
32+
33+
## Project layout
34+
35+
| Path | What it is |
36+
|---|---|
37+
| `mkdocs.yml` | Site config: theme, nav structure, markdown extensions |
38+
| `docs/index.md` | Hand-written landing page |
39+
| `docs/api-usage-docs`, `docs/tutorials`, `docs/products` | Symlinks to the existing top-level content directories — edit content in `api-usage-docs/`, `tutorials/`, `products/` directly, not under `docs/` |
40+
| `site/` | Generated build output — gitignored |
41+
| `requirements-docs.txt` | Pinned Python deps for building the site |
42+
43+
`api-usage-docs/data-model.md` is intentionally excluded from the build (`exclude_docs` in `mkdocs.yml`) since it's gitignored/internal and shouldn't be published even unlinked. Verified this exclusion also holds for the raw-markdown/llms.txt output below — it doesn't leak in either.
44+
45+
## Raw markdown for AI/LLM consumption
46+
47+
`SKILL.md` in this repo already lets local tools (Claude Code, etc.) read the source `.md` files directly from a git checkout — that's unaffected by any of this. The gap this closes is for AI agents/tools that only have **web access** to the deployed site and would otherwise have to scrape rendered HTML.
48+
49+
The `mkdocs-llmstxt-md` plugin adds three things, generated automatically on every build:
50+
51+
- **Per-page raw markdown**: every rendered page `<path>/index.html` gets a sibling `<path>/index.md` with the original source. E.g. `/embedded-api/api-usage-docs/getting-started/index.html``/embedded-api/api-usage-docs/getting-started/index.md`.
52+
- Note: this is `<path>/index.md`, not the bare `<path>.md` sibling that fastmcp/Mintlify use — MkDocs' default directory-URL layout (`<path>/index.html`) makes a same-directory `index.md` the natural fit, and a bare `<path>.md` file would collide with the `<path>/` directory on most web servers. Functionally equivalent for AI consumption; just a different URL shape.
53+
- **`/llms.txt`** — a page index (title + link per doc) at the site root, pointing at the working `index.md` URLs above.
54+
- **`/llms-full.txt`** — the entire doc set concatenated into one file.
55+
56+
No config was needed beyond adding `- llmstxt-md` to `plugins:` in `mkdocs.yml` — all three are on by default. Verified locally: builds cleanly through the `docs/api-usage-docs`, `docs/tutorials`, `docs/products` symlinks, respects `exclude_docs`, and serves the expected content/content-type (`text/markdown`) at runtime.
57+
58+
## GitHub Actions & deployment
59+
60+
`.github/workflows/docs.yml` has two jobs:
61+
62+
- **`build`** — runs on push to `main`, on pull requests touching docs-related paths (`mkdocs.yml`, `requirements-docs.txt`, `docs/**`, `api-usage-docs/**`, `tutorials/**`, `products/**`), and on manual dispatch. Installs `requirements-docs.txt`, runs `mkdocs build --strict`, and uploads `site/` as a Pages artifact.
63+
- **`deploy`** — runs only after `build` succeeds on a push to `main` (never on PRs, so untrusted PR content never publishes). Publishes the artifact via GitHub's official `actions/deploy-pages` action to **https://openbridge.github.io/embedded-api/**.
64+
65+
One-time repo setting required (not part of this repo's files): Settings → Pages → Build and deployment → Source = **GitHub Actions**. Once that's set and this config is merged to `main`, every push to `main` auto-deploys; the first deploy (or any manual re-run) can also be triggered from the Actions tab via the `workflow_dispatch` trigger.
66+
67+
## Content fixes already made
68+
69+
A round of pre-existing broken links and anchors (not caused by the MkDocs setup — these were always broken on GitHub too, just never validated) were fixed to get `--strict` passing:
70+
71+
- Relative links that didn't resolve, e.g. `./account-api.md``account-user-api.md`, `../products/storages.md``destinations.md`, and several `service-api.md` references from `products/` and `tutorials/` files that needed either a corrected path or a redirect to the specific per-service doc (`service-amazon-advertising-api.md`, `service-facebook-api.md`, `service-google-api.md`, `service-shopify-api.md`) where that content now actually lives.
72+
- Anchor mismatches in `product-overview.md` (added a missing `## Mixed Amazon Seller and Vendor Products` header the table of contents already pointed at) and `identity-configuration.md` (TOC anchor updated to match a since-renamed header).

0 commit comments

Comments
 (0)