-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: custom docs-readme directory #5400
Comments
Thanks @oliveirarafa! This does appear to be a bug in Stencil - when we look for a user's autogenerated content, we don't take the |
On the `docs-readme` output target it's possible to set a custom output lcoation 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 a the basis for the new text that we're going ot write to disk. This has the effect of preserving the custom text that a user might have input. fixes #5400
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
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
Hey @oliveirarafa, just had a chance to look into this and put together a change that I think should fix the issue. If you want to give it a try I just published a dev build that you can install and try out: npm install @stencil/core@4.15.0-dev.1712776573.8fd4e3 |
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
Thanks @alicewriteswrongs. I'll try it and let you know. |
@oliveirarafa the actual dev release version is npm install @stencil/core@4.15.0-dev.1712776573.8fd4e34 |
oops I left off a |
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
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
#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
@alicewriteswrongs @christian-bromann sorry for the delay, I couldn't test it earlier. I saw that the issue is closed but I tested it anyways and it worked. I was able to change the docs folder and the text before the comment is kept on further builds. Thank you! |
Awesome, glad to hear it's working for you! The fix will be in the next release of Stencil :) |
Prerequisites
Stencil Version
4.12.3
Current Behavior
When using docs-readme with the
dir
property in stencil.config.js, all my component readme.md files keep getting overwritten, including the text above the<!-- Auto Generated Below -->
comment. According to this documentation https://stenciljs.com/docs/docs-readme#custom-markdown-content, I understand that text placed above the comment should be preserved.I just noticed this as I'm creating this issue: If I have a
readme.md
with the<!-- Auto Generated Below -->
comment and some text above it in the default output folder, this content above it is preserved.Is this the intended feature? If so, I think it might just need a little tweak in the documentation.
Expected Behavior
Even when using the
dir
property to customize the output directory the content above<!-- Auto Generated Below -->
should be preserved when generating anotherreadme.md
on build time.System Info
Steps to Reproduce
I created a repo to reproduce it. Just install the dependencies and run build.
https://github.com/oliveirarafa/stenciljs-custom-dir
Without 'dir' (default output directory)
Regenerating the readme.md keeps all the changes before the comment.
With 'dir' (custom output directory)
All the content before or after the comment is cleared.
Note: just noticed that placing a readme.md in the default folder with the comment and a text before it makes this text persistent. In my opinion it makes more a little mor difficult to maintain because ir splits my docs in 2 but it works.
Code Reproduction URL
https://github.com/oliveirarafa/stenciljs-custom-dir
Additional Information
No response
The text was updated successfully, but these errors were encountered: