Skip to content
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
merged.txt
.wrangler
i18n/
build/
1 change: 0 additions & 1 deletion docs/.vscode/spellright.dict
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cloudflare
ddex
delegater
delegaters
docusaurus
erc
ern
ern3
Expand Down
49 changes: 10 additions & 39 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Dependencies

Install dependencies, run:
Install dependencies:

```sh
npm install
Expand All @@ -12,61 +12,34 @@ npm install

## Development Server

To run the docs locally, run:
To run the docs locally:

```sh
npm run start
npm run dev
```

To develop on Cloudflare pages and test the whole stack, run:
To develop on Cloudflare pages and test the whole stack:

```sh
npm run pages:dev
```

---

## Generate REST API docs
## Updating the API Spec

### Configure

Open `docusaurus.config.js` and find the `config:plugins:docusaurus-plugin-openapi-docs:config`
section values.

Edit the commented fields to suit your needs

```js
config: {
api: {
specPath: 'docs/developers/openapi.yaml', // synced from https://api.audius.co/v1/swagger.yaml
outputDir: 'docs/developers/api', // output directory for generated *.mdx and sidebar.js files
sidebarOptions: {
groupPathsBy: 'tag', // generate a sidebar.js slice that groups operations by tag
},
},
},
```

> [!NOTE]
>
> Use `npm run gen:api-docs` (below) to sync the live spec and keep the base URL set to `https://api.audius.co/v1`.

### Updating the Live API Docs

1. From the repo root, run:
The API reference uses Stoplight Elements and loads the OpenAPI spec from `/openapi.yaml`. To sync the latest spec from the live API:

```sh
npm run gen:api-docs
npm run sync:api-spec
```

This script:

- Downloads `https://api.audius.co/v1/swagger.yaml`
- Rewrites any legacy `discoveryprovider.audius.co` hosts to `api.audius.co`
- Saves the patched spec to `docs/developers/openapi.yaml`
- Regenerates every API doc (and `docs/developers/api/sidebar.ts`) from the live spec

> Powered by [docusaurus-plugin-openapi-docs](https://github.com/PaloAltoNetworks/docusaurus-openapi-docs)
- Saves the patched spec to `docs/public/openapi.yaml`
- Deduplicates server entries

---

Expand All @@ -80,9 +53,7 @@ npm run build

## Publish

Running the following commands will create a public test site to view your changes.

To deploy to docs.audius.co, ensure the commands are run from the `main` branch.
To deploy to docs.audius.co, run from the `main` branch:

```sh
npm run build
Expand Down
3 changes: 0 additions & 3 deletions docs/babel.config.js

This file was deleted.

14 changes: 0 additions & 14 deletions docs/crowdin.yml

This file was deleted.

13 changes: 0 additions & 13 deletions docs/docs.code-workspace

This file was deleted.

Loading