Skip to content

Commit 87ec10d

Browse files
Release v0.1.6
1 parent d85bf33 commit 87ec10d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

types.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,29 @@ func (c *CustomSection) String() string {
410410
return fmt.Sprintf("%#v", c)
411411
}
412412

413+
// Controls the verbosity of usage examples in README generation
414+
type ExampleStyle string
415+
416+
const (
417+
ExampleStyleMinimal ExampleStyle = "minimal"
418+
ExampleStyleComprehensive ExampleStyle = "comprehensive"
419+
)
420+
421+
func NewExampleStyleFromString(s string) (ExampleStyle, error) {
422+
switch s {
423+
case "minimal":
424+
return ExampleStyleMinimal, nil
425+
case "comprehensive":
426+
return ExampleStyleComprehensive, nil
427+
}
428+
var t ExampleStyle
429+
return "", fmt.Errorf("%s is not a valid %T", s, t)
430+
}
431+
432+
func (e ExampleStyle) Ptr() *ExampleStyle {
433+
return &e
434+
}
435+
413436
type GithubRemote struct {
414437
// A full repo url (i.e. https://github.com/fern-api/fern)
415438
RepoUrl string `json:"repoUrl" url:"repoUrl"`
@@ -1005,6 +1028,8 @@ type ReadmeConfig struct {
10051028
// Specifies the list of features supported by a specific generator.
10061029
// The features are rendered in the order they're specified.
10071030
Features []*ReadmeFeature `json:"features,omitempty" url:"features,omitempty"`
1031+
// Controls whether usage examples show only required parameters (minimal) or all parameters (comprehensive). Defaults to comprehensive.
1032+
ExampleStyle *ExampleStyle `json:"exampleStyle,omitempty" url:"exampleStyle,omitempty"`
10081033

10091034
extraProperties map[string]interface{}
10101035
_rawJSON json.RawMessage

0 commit comments

Comments
 (0)