-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(tools): Allow to markdown includes for sections #12075
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is exactly what we wanted! The restriction of:
The result is stable as long as the included file will not insert
headings on a lower or equal level compared to the include heading.
Is totally fine way of limiting what this replaces and puts in as well.
Thank you!
I'm ready to merge this, but there are two lint errors we will want to clean up:
The first should be ignored especially if we add future of these types of markdown docs The second you should fix. Will this add an extra new line between sections? |
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
(cherry picked from commit b76b53d)
related to #11691
fixes: #9065
This PR extends the
readme_config_includer
in two ways. First, it allows global includes relative to the Telegraf project root by specifying an absolute path (e.g./docs/bla.md
).Additionally, the tool now also allows to replace sections of the document by providing include(s) at the header level. For example in the following README:
everything after
## My included part <!-- @/docs/include/replacement.md -->
and before## A heading on the same level
is replaced by the content of/docs/include/replacement.md
. The result is stable as long as the included file will not insert headings on a lower or equal level compared to the include heading.