自定义 README
自定义 README
每个 SDK 在其根目录中都包含一个 README.md 文件,提供 SDK 的概述以及使用相关 API 的说明。
默认情况下,Fern 自动生成 README,其中包含使用示例和 API 详细信息。有关生成的 SDK README 的完整示例,请参见 Intercom 的 Python SDK。
虽然每个 SDK 都有自己的 README,但内容可以通过 generators.yml 文件中的 readme 部分进行全局配置。
配置选项
bannerLink
URL for a banner image or link that appears at the top of the README.
introduction
Custom introduction text that appears at the beginning of the README.
apiReferenceLink
URL to your external API documentation or reference guide.
apiName
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.
exampleStyle
Controls whether usage examples show only required parameters (minimal) or all parameters (comprehensive). Currently only supported for Java SDKs. File an issue to request additional languages.
disabledSections
Sections to disable in the README. Supported values: "contributing".
features
Organizes endpoints into named feature sections within the README. Each feature creates a dedicated section with example code snippets for the specified endpoints.
Endpoint configuration
Specifies which endpoint’s code snippet to showcase as the primary example in the README.
defaultEndpoint.method
HTTP method of the default endpoint (e.g., GET, POST, PUT, DELETE).
defaultEndpoint.path
Endpoint path for the default example (e.g., /users, /auth/login).
defaultEndpoint.stream
Whether the endpoint is a streaming endpoint. Defaults to false.
Custom sections
Define a custom section in the generated README for a specific SDK.
customSections.title
The title of the custom section as it will appear in the README.
customSections.language
The target SDK language for this section. The custom section will only appear in README files generated for the specified language.
customSections.content
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.
Available template variables by language:
其他自定义
要超越可用的配置选项,您可以手动编辑 README.md 文件。然后,将其添加到 .fernignore 文件中,以防止在重新生成过程中被覆盖。