-
Notifications
You must be signed in to change notification settings - Fork 783
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 (
#5648) 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 STENCIL-1185
- Loading branch information
1 parent
84e1a14
commit 6bfba1d
Showing
5 changed files
with
76 additions
and
8 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
22 changes: 22 additions & 0 deletions
22
test/docs-readme/custom-readme-output/components/styleurls-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,22 @@ | ||
# styleurls-component | ||
|
||
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 --> | ||
|
||
|
||
## CSS Custom Properties | ||
|
||
| Name | Description | | ||
| ------- | ------------ | | ||
| `--one` | Property One | | ||
| `--two` | Property Two | | ||
|
||
|
||
---------------------------------------------- | ||
|
||
*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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,9 @@ export const config: Config = { | |
{ | ||
type: 'dist', | ||
}, | ||
{ | ||
type: 'docs-readme', | ||
dir: 'custom-readme-output', | ||
}, | ||
], | ||
}; |