-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docs): respect custom README content when writing to a custom path
On the `docs-readme` output target it's possible to set a custom output location with the `.dir` property and the README files generation for components will then be output to relative paths (like `my-component/readme.md`) within that directory. This fixes a bug where that behavior didn't properly respect any manually-entered content in those readme files, so that if, for instance, you set the output to `custom-readme-output` and had `"My Custom Text"` at the top of `custom-readme-output/components/my-component/readme.md` then running a build would overwrite your custom text. This changes things so that we read the content of the custom readme and use that as the basis for the new text that we're going to write to disk. This has the effect of preserving the custom text that a user might have input. fixes #5400
- Loading branch information
1 parent
ab5bc2b
commit b569ea7
Showing
5 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
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
31 changes: 31 additions & 0 deletions
31
test/docs-json/custom-readme-output/components/my-component/readme.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
This file is in a custom location, set with `.dir` on the `docs-readme` OT. | ||
|
||
The content here above the 'auto-generation' comment shouldn't be overwritten. | ||
|
||
This is a regression test for the issue reported in ionic-team/stencil#5400. | ||
|
||
<!-- Auto Generated Below --> | ||
|
||
|
||
## Methods | ||
|
||
### `onDidDismiss<T>(arg: T) => Promise<ImportedInterface<T>>` | ||
|
||
A comment, which should be included, I should think! | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Description | | ||
| ----- | ---- | ----------- | | ||
| `arg` | `T` | | | ||
|
||
#### Returns | ||
|
||
Type: `Promise<ImportedInterface<T>>` | ||
|
||
|
||
|
||
|
||
---------------------------------------------- | ||
|
||
*Built with [StencilJS](https://stenciljs.com/)* |
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