Add option to hide private links when rendering changelogs #2408
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Per tests in https://github.com/elastic/cloud/pull/150210 the
docs-builder changelog rendercommand was including links to private repo pull requests and issues in the output, which I had to remove manually.This PR updates #2341 to include a new command option to comment out those internal links. IMO it's better to comment them out rather than remove them, since I've found it useful to have that info in the past during internal reviews.
Summary
Added a
--hide-private-linksoption to thedocs-builder changelog rendercommand. When enabled, PR and issue links are commented out in the markdown output.Changes made
ChangelogRenderInput.cs: AddedHidePrivateLinksproperty to store the option value.ChangelogCommand.cs: AddedhidePrivateLinksparameter (defaults to false) to the Render command with XML documentation.ChangelogService.cs:RenderChangelogsto passhidePrivateLinksto all rendering methodsRenderIndexMarkdown,RenderBreakingChangesMarkdown,RenderDeprecationsMarkdown, andRenderEntriesByAreato accept and use thehidePrivateLinksparameterFormatPrLinkandFormatIssueLinkto accepthidePrivateLinksand wrap links in comments when enabledUsage
When
--hide-private-linksis enabled, PR and issue links are commented out using%followed by a space, per the Docs-builder comments documentation.This hides the links from the rendered output while preserving them in the source markdown for future use.
Generative AI disclosure
Tool(s) and model(s) used: composer-1 agent