-
Notifications
You must be signed in to change notification settings - Fork 8
Document api:apiName link syntax for API Reference sections
#4932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+28
−12
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,19 @@ | ||
| --- | ||
| tags: ["ai-features"] | ||
| tags: ["ai-features", "api-reference", "mdx"] | ||
| --- | ||
|
|
||
| ## AI search model update | ||
|
|
||
| Ask Fern now uses [Claude 4.6 Sonnet](https://www.anthropic.com/news/claude-sonnet-4-6) and [Claude 4.5 Haiku](https://www.anthropic.com/news/claude-haiku-4-5). | ||
|
|
||
| <Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/ai-features/ask-fern/overview">Read the docs</Button> | ||
|
|
||
| ## Link to API Reference sections with `api:` syntax | ||
|
|
||
| The `api:` link syntax now supports linking to the root of an API Reference section. Use `api:apiName` to create a link that resolves to the landing page of a specific API Reference at build time. This is useful when your project has multiple APIs. | ||
|
|
||
| ```mdx Markdown | ||
| Explore the [Plant Store API](api:plant-store) reference. | ||
| ``` | ||
|
|
||
| <Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/writing-content/markdown-basics#api-link-syntax">Read the docs</Button> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,23 @@ | ||
| Use the `api:` link syntax to link to an API endpoint in any Markdown content rendered by Fern. Fern resolves the link to the correct URL at build time, so you don't have to hardcode slugs. | ||
| Use `api:` link syntax to link to API endpoints or API Reference sections in any Markdown content. Fern resolves these links at build time, so you don't need to hardcode slugs. | ||
|
|
||
| The format is `api:METHOD/path`, where `METHOD` is an HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) and `/path` is the endpoint path from your API definition. If your project has [multiple APIs](/learn/docs/api-references/generate-api-ref#include-more-than-one-api-reference), prefix the link with the API name: `api:API-NAME:METHOD/path`. | ||
| <AccordionGroup> | ||
| <Accordion title="Link to an endpoint"> | ||
|
|
||
| For example: | ||
| Use `api:METHOD/path`, where `METHOD` is an HTTP method (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) and `/path` is the endpoint path from your API definition. Path parameters use curly braces, such as `api:GET/v2/payments/{paymentId}`. | ||
|
|
||
| For projects with [multiple APIs](/learn/docs/api-references/generate-api-ref#include-more-than-one-api-reference), prefix with the API name: `api:API-NAME:METHOD/path`. | ||
|
|
||
| ```mdx Markdown | ||
| View the [Current user information](api:mcp-tools:GET/api/fern-docs/whoami) endpoint. | ||
| ``` | ||
| </Accordion> | ||
| <Accordion title="Link to the root of an API Reference section"> | ||
|
|
||
| Use `api:apiName`, where `apiName` matches the API name in your `generators.yml` file. This is useful when your project has multiple APIs and you want to link to the root landing page of a specific API Reference. | ||
|
|
||
| <div className="highlight-frame"> | ||
| <div className="highlight-frame-content"> | ||
| View the [Current user information](api:mcp-tools:GET/api/fern-docs/whoami) endpoint. | ||
| </div> | ||
| </div> | ||
|
|
||
| Path parameters are also supported. Include them in the endpoint path with curly braces, such as `api:GET/v2/payments/{paymentId}`. | ||
| ```mdx Markdown | ||
| Explore the [Plant Store API](api:plant-store) reference. | ||
| ``` | ||
| </Accordion> | ||
| </AccordionGroup> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[FernStyles.Current] Avoid time-relative terms like 'now' that become outdated