Skip to content

Commit

Permalink
feat(docs): hiding endpoints (#5582)
Browse files Browse the repository at this point in the history
  • Loading branch information
zachkirsch authored Jan 11, 2025
1 parent df0a16c commit 3abfe07
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions fern/pages/fern-docs/content/customize-api-ref.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ navigation:
</Frame>

### Styling endpoints
To customize the display of an endpoint, you can expand the endpoint description to include a `title` and `slug`, or set the endpoint as `hidden`.
To customize the display of an endpoint, you can add a `title`. You can also use `slug` to customize the endpoint URL.

<Tabs>
<Tab title="OpenAPI Specification">
```yaml title="docs.yml"
```yaml title="docs.yml" {6-7}
navigation:
- api: API Reference
layout:
Expand All @@ -126,7 +126,7 @@ To customize the display of an endpoint, you can expand the endpoint description
```
</Tab>
<Tab title="Fern Definition">
```yaml title="docs.yml"
```yaml title="docs.yml" {6-7}
navigation:
- api: API Reference
layout:
Expand All @@ -143,6 +143,37 @@ To customize the display of an endpoint, you can expand the endpoint description
<img src="custom-endpoint.png" alt="Setting an endpoint title" />
</Frame>

### Hiding endpoints
You can hide an endpoint from the API reference by setting `hidden` to `true`. The endpoint will still be accessible at its URL.

<Tabs>
<Tab title="OpenAPI Specification">
```yaml title="docs.yml" {9-9}
navigation:
- api: API Reference
layout:
- user:
- endpoint: POST /user
title: Create a User
slug: user-creation
- DELETE /user/{username}
hidden: true
```
</Tab>
<Tab title="Fern Definition">
```yaml title="docs.yml" {9-9}
navigation:
- api: API Reference
layout:
- user:
- endpoint: user.create
title: Create a User
slug: user-creation
- user.delete
hidden: true
```
</Tab>
</Tabs>

### Adding custom sections
You can add arbitrary folders in the sidebar by adding a `section` to your API Reference layout. A section can comprise entire groups of endpoints, individual endpoints, or even just Markdown pages. Sections can be customized by adding properties like a `icon`, `summary`, `slug` (or `skip-slug`), and `contents`.
Expand Down

0 comments on commit 3abfe07

Please sign in to comment.