Skip to content
Open
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
  •  
  •  
  •  
10 changes: 5 additions & 5 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
uses: actions/checkout@v5

- name: Install Node v20
uses: actions/setup-node@v5
uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
cache-dependency-path: tools/package-lock.json

- name: Install dependencies
run: npm ci
working-directory: tools

- name: Check Markdown Tables
run: |
shopt -s globstar
npx markdown-table-formatter docs/**/*.{md,mdx} --check
shell: bash
run: npm run test:tables
working-directory: tools
22 changes: 9 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
cache-dependency-path: tools/package-lock.json
- run: npm ci
working-directory: tools
- run: npm run lint
working-directory: tools
- run: npm run build
links:
name: Check Links
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run test:links
working-directory: tools
mdx:
name: Validate mdx
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
- uses: actions/setup-node@v6
with:
node-version: 20
cache: npm
cache-dependency-path: tools/package-lock.json
- run: npm ci
working-directory: tools
- run: npm run test:build
working-directory: tools
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
node_modules/
dist/
.idea
xml_output/
xml_output/
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

85 changes: 8 additions & 77 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,82 +22,13 @@ See the [README](https://github.com/discord/discord-api-docs/blob/main/README.md

## Markdown Syntax

This repository uses special markdown syntax that helps style the resulting web version of the documentation.
Our documentation uses standard [Markdown](https://www.markdownguide.org/basic-syntax/) syntax with some additional [MDX](https://mdxjs.com/) features.

### H6 Headings
We also support the following formatting from Mintlify:

H6 headings should be used above tables and code blocks to properly label them.

### Linking

Links between docs can be achieved by using a hash symbol (#), plus the markdown file name, plus a slash, and finally the dash-separated anchor. For instance, to link to the above H6 heading section:

```md
[Links to README.md H6](#README/h6-headings)
```

### Alert Boxes

Alert boxes are created by placing a line with 3 colons (`:::`) before and after the text. The first 3 colons must be followed by a label specifying the alert box type. For example, to create a warning alert:

```
:::warn
Something that requires warning here
:::
```

Currently the following types are available: `info`, `warn`, `danger` and `preview`

![Available alert types](static/images/alerts.webp)

### MDX Components

There are a few reusable MDX components that can be used on pages with the `mdx` extension.

#### Collapsibles

Collapsibles allow you to show/hide content on a page that may be secondary to the page's primary content. They have four fields that can be set: `title`, `description`, `icon`, and an `open` flag (which makes the collapsible element open by default).

Available options for `icon`:

- `"list"`
- `"view"`
- `"question"`
- `"code"`
- `"warning"`

###### Example

![Collapsible MDX Component with the list icon](static/images/mdx-collapsible.webp)

```markdown
<Collapsible title="Title" description="Description text" icon="list">
Collapsed content
</Collapsible>
```

#### Buttons

Buttons are simply... clickable buttons. They take `href` and `color` as arguments, but currently we only use `"brand"` as a value for `color`.

###### Example

![Button MDX Component](static/images/mdx-button.webp)

```markdown
<LinkButton to="https://discord.com/developers/docs/getting-started" color="brand" text="click the button!" />
```

#### Cards

Cards let you display links in a card format. They accept two arguments, `title` and `link`.

###### Example

![Card MDX Component](static/images/mdx-card.webp)

```markdown
<Card title="Card Title" link="https://discord.com/developers/docs/getting-started">
This is the content inside of the card~
</Card>
```
- [Format Text](https://www.mintlify.com/docs/create/text)
- [Format Code](https://www.mintlify.com/docs/create/code)
- [Images & Embeds](https://www.mintlify.com/docs/create/image-embeds)
- [Files](https://www.mintlify.com/docs/create/files)
- [Lists & Tables](https://www.mintlify.com/docs/create/list-table)
- [Available Components](https://www.mintlify.com/docs/components/accordions)
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
# Discord API Documentation
# Discord for Developers Documentation

This repo contains the official Discord API documentation, which can be viewed online [HERE](https://discord.com/developers/docs/intro). Before submitting pull-requests, please remember to _fully_ read the [Contributing](CONTRIBUTING.md) guidelines.
This repo contains the official Discord for Developers documentation, which can be viewed online [HERE](https://discord.com/developers/docs/intro). Before submitting pull-requests, please remember to _fully_ read the [Contributing](CONTRIBUTING.md) guidelines.

This repository reflects the Discord API as it is meant to be accessed by third-party applications. It omits features and capabilities that are not generally available, or are not fully supported for third-party usage.
This repository reflects the Discord Developer Platform as it is meant to be accessed by third-party applications. It omits features and capabilities that are not generally available, or are not fully supported for third-party usage.

We welcome your contributions!

- Issue tracker: Discord API bugs
- Discussions: Discord API feature and improvement requests
- Issue tracker: [Discord API bugs](https://github.com/discord/discord-api-docs/issues)
- Discussions: [Discord API feature and improvement requests](https://github.com/discord/discord-api-docs/discussions/categories/api-feature-requests-ideas)
- Pull Requests: See [Contributing.md](https://github.com/discord/discord-api-docs/blob/main/CONTRIBUTING.md) for types of changes accepted and specific markdown syntax used in the documentation.

### Local Preview

Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command

```
npm i -g mintlify
```

Run the `mintlify dev` in the `discord` directory to see your changes locally.

```
cd discord
mintlify dev
```

Your local browser should open automatically to the correct page, but if not, navigate to:

```
http://localhost:3000/developers/docs/intro
```

## Need some help?

Here are some Discord servers that can help you out with everything Discord API:
Expand Down
38 changes: 38 additions & 0 deletions discord/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Top level styles
StylesPath = ./vale
MinAlertLevel = suggestion
IgnoredScopes = code, tt, img, url, a
SkippedScopes = script, style, pre, figure, code

# Vocabularies
Vocab = Mintlify, Discord

# This is required since Vale doesn't officially support MDX
[formats]
mdx = md

# MDX support
[*.mdx]
BasedOnStyles = Vale
Vale.Terms = NO # Enforces really harsh capitalization rules, keep off

# `import ...`, `export ...`
# `<Component ... />`
# `<Component>...</Component>`
# `{ ... }`
# Words with underscores
# Markdown links [text](url)
# Content within square brackets (markdown link text)
TokenIgnores = (?sm)((?:import|export) .+?$), \
(?<!`)(<\w+ ?.+ ?\/>)(?!`), \
(<[A-Z]\w+>.+?<\/[A-Z]\w+>), \
(\w*_\w*), \
(\[.+?\]\(.+?\)), \
(\[.+?\])

# Exclude:
# `<Component \n ... />`
BlockIgnores = (?sm)^(<\w+\n .*\s\/>)$, \
(?sm)^({.+.*})

CommentDelimiters = {/*, */}
Loading