-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: transliterate user defined content (#359)
Use `jsii-rosetta` to transliterate assemblies before constructing the reflect TypeSystem. This makes it so README code snippets as well as `@example` code blocks for inline documentation are also transliterated, providing a full language specific page. > Currently still in draft because it uses an unpublished version of `@jsii/spec` and `jsii-rosetta` pending a jsii release. ### Implementation Notes Previously, the `Documentation` class accepted a **required** `reflect.Assembly` property. This meant that the creation of the type-system was the responsibility of the caller. This API is somewhat cumbersome, and now that the assemblies need to be transliterated beforehand, this is even more so. The PR changes the input to the `Documentation` class, so that it only requires local paths that contain assembly files, it then proceeds to transliterate those assemblies and create the type-system on its own. Since the creation of the type-system is an `async` process, the `Documentation` class offers a `static async` function that needs to be awaited on, instead of directly using the constructor, which is now private. So the usage now becomes: ```ts const docs = await Documentation.forLocalPackage(rootPath, assembliesPath); const page = docs.render().render(); ``` In addition, a new functionality of generating documentation for remote packages was added: ```ts const docs = await Documentation.forRemotePackage('@aws-cdk/aws-ecr', '1.110.1'); const page = docs.render().render(); ``` BREAKING CHANGE: The `Documentation` class can no longer be directly instantiated, use static factory methods instead.
- Loading branch information
Showing
33 changed files
with
10,382 additions
and
5,414 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.