Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This adds support for generating C#
README.md
files by interfacing with thegenerator-cli
(via theCsharpGeneratorAgent
type).The following sections are generated for all README.md files:
Implementation
This updates the shared
AbstractGeneratorAgent
type so that it consolidates more of the shared logic required to produceREADME.md
andreference.md
files (e.g. reading thefeatures.yml
, producing the GitHub remote configuration, etc). The generator is expected to implement an interface that looks like the following:The
ReadmeConfigBuilder
used here is scoped to each language, but it shares a similar structure between each implementation (i.e. it interacts with aReadmeSnippetBuilder
and produces the correspondingFernGeneratorCli.LanguageInfo
).Future improvements
There's additional functionality we can consolidate in the new
AbstractReadmeSnippetBuilder
.For now, both of the language-specific implementations have their own representation of the IR's
HttpEndpoint
(which is extended to include aFernFilepath
). Once theHttpEndpoint
itself has theFernFilepath
, we can easily refactor theAbstractReadmeSnippetBuilder
as a generic type, and DRY up many of the helper functions (e.g.buildEndpoints
,getEndpointsForFeature
, etc).