Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 8 additions & 21 deletions fern/products/sdks/guides/configure-readme.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,13 @@ title: Customize README
description: Guide to configuring the README in your SDK
---

By default, the README for your SDKs is generated programmatically. You can override this by configuring the `readme` section in `generators.yml` to control the content and structure of generated README files across all your SDKs.
You can add custom introductions, showcase key endpoints, and organize your SDK documentation with feature sections.
By default, the README for your SDKs is generated programmatically. You can customize the content and structure of these README files across all of your SDKs by configuring the `readme` section in `generators.yml`.

```yaml title="generators.yml"
readme:
introduction: "Welcome to our API"
apiReferenceLink: "https://docs.example.com"
apiName: "Example Product"
disabledSections:
- "contributing"
defaultEndpoint:
method: "POST"
path: "/users"
features:
authentication:
- method: "POST"
path: "/auth/login"
users:
- method: "GET"
path: "/users"
```

For more detailed information on `readme` configuration, see the [`generators.yml` documentation](/sdks/reference/generators-yml#readme)
## Configuration options

<Markdown src="/products/sdks/snippets/readme-options.mdx" />

## Additional customization

For customization beyond these configuration options, you can [manually modify the README](/products/sdks/custom-code.mdx) and add it to your `.fernignore` file to prevent it from being overwritten during regeneration.
68 changes: 2 additions & 66 deletions fern/products/sdks/reference/generators-yml-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -330,74 +330,10 @@ metadata:
</ParamField>

## readme
Controls what goes into the generated README files across all SDKs, allowing you to customize the content and structure of your SDK documentation.

```yaml
readme:
bannerLink: "https://example.com/banner"
introduction: "Welcome to our API"
apiReferenceLink: "https://docs.example.com"
apiName: "Example Product"
disabledSections:
- "contributing"
defaultEndpoint:
method: "POST"
path: "/users"
stream: false
features:
authentication:
- method: "POST"
path: "/auth/login"
- "GET /auth/profile"
users:
- method: "GET"
path: "/users"
- method: "POST"
path: "/users"
```

<ParamField path="bannerLink" type="string" required={false} toc={true}>
URL for a banner image or link that appears at the top of the README.
</ParamField>

<ParamField path="introduction" type="string" required={false} toc={true}>
Custom introduction text that appears at the beginning of the README.
</ParamField>

<ParamField path="apiReferenceLink" type="string" required={false} toc={true}>
URL to your external API documentation or reference guide.
</ParamField>

<ParamField path="apiName" type="string" required={false} toc={true}>
Name of the API that appears in the README. Will appear as `Your Api Name SDK` or `Your Api Name API` throughout the README. Defaults to organization name if not set.
</ParamField>

<ParamField path="disabledSections" type="string[]" required={false} toc={true}>
Sections to disable in the README. Supported values: `"contributing"`.
</ParamField>

<ParamField path="defaultEndpoint" type="ReadmeEndpointSchema" required={false} toc={true}>
Specifies which endpoint's code snippet to showcase as the primary example in the README.
</ParamField>

<ParamField path="features" type="map<string, list<ReadmeEndpointSchema>>" required={false} toc={true}>
Groups endpoints by feature name for organized README sections. Each feature becomes a section in the README with example code snippets for the listed endpoints.
</ParamField>

### defaultEndpoint
Specifies which endpoint's code snippet to showcase as the primary example in the README.

<ParamField path="method" type="string" required={true} toc={true}>
HTTP method of the default endpoint (e.g., `GET`, `POST`, `PUT`, `DELETE`).
</ParamField>

<ParamField path="path" type="string" required={true} toc={true}>
Endpoint path for the default example (e.g., `/users`, `/auth/login`).
</ParamField>
Controls what goes into the generated README files across all SDKs, allowing you to customize the content and structure of your SDK documentation.

<ParamField path="stream" type="boolean" required={false} default="false" toc={true}>
Whether the endpoint is a streaming endpoint. Defaults to `false`.
</ParamField>
<Markdown src="/products/sdks/snippets/readme-options.mdx" />

## default-group
Which group to use when none is specified.
Expand Down
67 changes: 67 additions & 0 deletions fern/products/sdks/snippets/readme-options.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
```yaml
readme:
bannerLink: "https://example.com/banner"
introduction: "Welcome to our API"
apiReferenceLink: "https://docs.example.com"
apiName: "Example Product"
disabledSections:
- "contributing"
defaultEndpoint:
method: "POST"
path: "/users"
stream: false
features:
authentication:
- method: "POST"
path: "/auth/login"
- "GET /auth/profile"
users:
- method: "GET"
path: "/users"
- method: "POST"
path: "/users"
```

<ParamField path="bannerLink" type="string" required={false} toc={true}>
URL for a banner image or link that appears at the top of the README.
</ParamField>

<ParamField path="introduction" type="string" required={false} toc={true}>
Custom introduction text that appears at the beginning of the README.
</ParamField>

<ParamField path="apiReferenceLink" type="string" required={false} toc={true}>
URL to your external API documentation or reference guide.
</ParamField>

<ParamField path="apiName" type="string" required={false} toc={true}>
Name of the API that appears in the README. Will appear as `Your Api Name SDK` or `Your Api Name API` throughout the README. Defaults to organization name if not set.
</ParamField>

<ParamField path="disabledSections" type="string[]" required={false} toc={true}>
Sections to disable in the README. Supported values: `"contributing"`.
</ParamField>

<ParamField path="defaultEndpoint" type="ReadmeEndpointSchema" required={false} toc={true}>
Specifies which endpoint's code snippet to showcase as the primary example in the README.
</ParamField>

<ParamField path="features" type="map<string, list<ReadmeEndpointSchema>>" required={false} toc={true}>
Organizes endpoints into named feature sections within the README. Each feature creates a dedicated section with example code snippets for the specified endpoints.
</ParamField>

### Endpoint configuration

Specifies which endpoint's code snippet to showcase as the primary example in the README.

<ParamField path="defaultEndpoint.method" type="string" required={true} toc={true}>
HTTP method of the default endpoint (e.g., `GET`, `POST`, `PUT`, `DELETE`).
</ParamField>

<ParamField path="defaultEndpoint.path" type="string" required={true} toc={true}>
Endpoint path for the default example (e.g., `/users`, `/auth/login`).
</ParamField>

<ParamField path="defaultEndpoint.stream" type="boolean" required={false} default="false" toc={true}>
Whether the endpoint is a streaming endpoint. Defaults to `false`.
</ParamField>