Skip to content

Commit 159ccd2

Browse files
(sdks) Document customSections parameter for SDK README customization (#830)
Co-authored-by: promptless[bot] <179508745+promptless[bot]@users.noreply.github.com> Co-authored-by: Devin Logan <[email protected]>
1 parent 2bc75db commit 159ccd2

File tree

2 files changed

+47
-5
lines changed

2 files changed

+47
-5
lines changed

fern/products/cli-api-reference/cli-changelog/2025-09-22.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
## 0.78.4
10-
**`(fix):`** Collapse any combination of optional and nullable to optional<nullable<T>>.
10+
**`(fix):`** Collapse any combination of optional and nullable to `optional<nullable<T>>`.
1111

1212
## 0.78.3
1313
**`(chore):`** Support IR v59 in the Rust SDK generator.

fern/products/sdks/snippets/readme-options.mdx

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ readme:
1010
method: "POST"
1111
path: "/users"
1212
stream: false
13+
customSections:
14+
- title: "Custom Section"
15+
language: "java"
16+
content: |
17+
This is a custom section. Latest package info is {{ group }}:{{ artifact }}:{{ version }}.
18+
- title: "Custom Section"
19+
language: "typescript"
20+
content: |
21+
Custom section for {{ packageName }}
22+
- title: "Another Custom Section"
23+
language: "typescript"
24+
content: |
25+
A second custom section for {{ packageName }}
1326
features:
1427
authentication:
1528
- method: "POST"
@@ -42,10 +55,6 @@ readme:
4255
Sections to disable in the README. Supported values: `"contributing"`.
4356
</ParamField>
4457

45-
<ParamField path="defaultEndpoint" type="ReadmeEndpointSchema" required={false} toc={true}>
46-
Specifies which endpoint's code snippet to showcase as the primary example in the README.
47-
</ParamField>
48-
4958
<ParamField path="features" type="map<string, list<ReadmeEndpointSchema>>" required={false} toc={true}>
5059
Organizes endpoints into named feature sections within the README. Each feature creates a dedicated section with example code snippets for the specified endpoints.
5160
</ParamField>
@@ -64,4 +73,37 @@ Specifies which endpoint's code snippet to showcase as the primary example in th
6473

6574
<ParamField path="defaultEndpoint.stream" type="boolean" required={false} default="false" toc={true}>
6675
Whether the endpoint is a streaming endpoint. Defaults to `false`.
76+
</ParamField>
77+
78+
### Custom sections
79+
80+
Define a custom section in the generated README for a specific SDK.
81+
82+
<ParamField path="customSections.title" type="string" required={true} toc={true}>
83+
The title of the custom section as it will appear in the README.
84+
</ParamField>
85+
<ParamField path="customSections.language" type="'java' | 'typescript'" required={true} toc={true}>
86+
The target SDK language for this section. The custom section will only appear in README files generated for the specified language.
87+
</ParamField>
88+
<ParamField path="customSections.content" type="string" required={true} toc={true}>
89+
The Markdown content of the custom section. You can use template variables in the format `{{ variable }}` that will be dynamically replaced with values specific to each SDK language when the README is generated.
90+
91+
Available template variables by language:
92+
93+
| Language | Variable | Description |
94+
|----------|----------|-------------|
95+
| TypeScript | `packageName` | Name of your package, as specified in the [`package-name` field](/sdks/generators/typescript/configuration#package-name) |
96+
| Python | `packageName` | Name of your package, as specified in the [`package-name` field](/sdks/generators/python/configuration#package-name) |
97+
| Go | `owner` | The owner of your Go module |
98+
| Go | `repo` | The [repository](/sdks/generators/go/publishing#configure-output-location) where your Go module is published |
99+
| Go | `version` | SDK version |
100+
| Java | `group` | Maven `groupId` [from `coordinate` field](/sdks/generators/java/publishing#configure-maven-coordinate) |
101+
| Java | `artifact` | Maven `artifactId` [from `coordinate` field](/sdks/generators/java/publishing#configure-maven-coordinate) |
102+
| Java | `version` | SDK version |
103+
| C#/.NET | `packageName` | Name of your package, as specified in the [`package-name` field](/sdks/generators/csharp/configuration#package-name) |
104+
| PHP | `packageName` | Name of your package, as specified in the [`package-name` field](/sdks/generators/php/configuration#package-name) |
105+
| Ruby | `packageName` | Name of your package, as specified in the [`package-name` field](/sdks/generators/ruby/configuration#package-name) |
106+
| Swift | `gitUrl` | The [URL](/sdks/generators/swift/publishing#verify-package-availability) where your Swift package is published. For example, `https://github.com/fern-api/basic-swift-sdk` |
107+
| Swift | `minVersion` | SDK version |
108+
67109
</ParamField>

0 commit comments

Comments
 (0)