Skip to content

Commit 3f39371

Browse files
Document HTTP snippets enabled by default with configuration options
Co-Authored-By: Catherine Deskur <[email protected]>
1 parent 3566589 commit 3f39371

File tree

3 files changed

+71
-9
lines changed

3 files changed

+71
-9
lines changed

fern/products/docs/pages/api-references/http-snippets.mdx

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,46 @@ subtitle: HTTP snippets allow users to see API request examples using common HTT
88
![HTTP code snippet selector](./http-snippets.png)
99
</Frame>
1010

11-
## Setup
11+
## Configuration
1212

13-
1. Ensure you have a paid Fern subscription
14-
2. Contact support to request HTTP snippets activation
15-
3. Once enabled, build your production docs
13+
HTTP snippets are now enabled by default for all documentation sites. You can control this behavior using the `settings.http-snippets` configuration in your `docs.yml` file.
1614

17-
<Note>
18-
Currently, HTTP snippets are provided as an all-or-nothing set. You cannot configure which languages are displayed. If you would like this feature, please [open a GitHub issue](https://github.com/fern-api/fern/issues/new?template=docs-feature.yml).
19-
</Note>
15+
### Enable all HTTP snippets (default)
16+
17+
By default, all supported HTTP snippet languages will be displayed:
18+
19+
<CodeBlock title="docs.yml">
20+
```yaml
21+
# HTTP snippets are enabled by default
22+
# No configuration needed
23+
```
24+
</CodeBlock>
25+
26+
### Disable HTTP snippets
27+
28+
To turn off HTTP snippets completely:
29+
30+
<CodeBlock title="docs.yml">
31+
```yaml
32+
settings:
33+
http-snippets: false
34+
```
35+
</CodeBlock>
36+
37+
### Display specific languages
38+
39+
To show only a subset of HTTP snippet languages, provide an array of language identifiers:
40+
41+
<CodeBlock title="docs.yml">
42+
```yaml
43+
settings:
44+
http-snippets:
45+
- python
46+
- ruby
47+
```
48+
</CodeBlock>
49+
50+
This configuration will display only Python and Ruby HTTP snippets, excluding cURL and other languages.
2051
2152
## How It Works
2253
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## HTTP Snippets Now Enabled by Default
2+
3+
HTTP snippets are now enabled by default for all documentation sites, making it easier for developers to see cURL, Python, Ruby, and other HTTP client examples directly in your API reference. Previously, this feature required internal configuration to activate.
4+
5+
You can now control HTTP snippets directly in your `docs.yml` file:
6+
7+
```yaml
8+
# Turn off HTTP snippets
9+
settings:
10+
http-snippets: false
11+
12+
# Or specify only certain languages
13+
settings:
14+
http-snippets:
15+
- python
16+
- ruby
17+
```
18+
19+
If you don't specify any configuration, all HTTP snippet languages will be displayed by default.
20+
21+
<Card
22+
title="Learn more about HTTP snippets"
23+
variant="bordered"
24+
href="/docs/api-references/http-snippets"
25+
/>

fern/products/docs/pages/customization/what-is-docs-yml.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,14 @@ settings:
481481
If set to true, search will display results for pages within the current product and version.
482482
</ParamField>
483483

484-
<ParamField path="settings.http-snippets" type="boolean" required={false} default="false" toc={true}>
485-
If set to true, the HTTP snippets will be displayed in the API Reference.
484+
<ParamField path="settings.http-snippets" type="boolean | array" required={false} default="true" toc={true}>
485+
Controls the display of HTTP snippets in the API Reference. HTTP snippets are now enabled by default.
486+
487+
- Set to `false` to disable HTTP snippets completely
488+
- Set to `true` (or omit) to enable all HTTP snippet languages
489+
- Provide an array of language identifiers (e.g., `["python", "ruby"]`) to display only specific languages
490+
491+
Learn more in the [HTTP snippets documentation](/docs/api-references/http-snippets).
486492
</ParamField>
487493

488494
<ParamField path="settings.hide-404-page" type="boolean" required={false} default="false" toc={true}>

0 commit comments

Comments
 (0)