-
Notifications
You must be signed in to change notification settings - Fork 34
Add asciidoc output option to docs-builder changelog render command #2452
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
base: changelog-manifest
Are you sure you want to change the base?
Conversation
…og-manifest-asciidoc # Conflicts: # docs/cli/release/changelog-render.md # docs/contribute/changelog.md # src/services/Elastic.Documentation.Services/ChangelogService.cs # src/tooling/docs-builder/Commands/ChangelogCommand.cs
|
I've solved conflicts with the base branch. Prior to merging this one, can we add some tests? |
Thanks!
I made these updates in b9ff19b : SummaryAdded two tests for the
Both tests:
The tests verify that the asciidoc render command creates a single, valid asciidoc file as expected. |
Summary
--file-typeoption tochangelog rendercommandOverview
Added support for rendering changelogs to asciidoc format in addition to markdown.
The
docs-builder changelog rendercommand now accepts a--file-typeoption that can output either markdown (default) or asciidoc files.This functionality is based on the "--file_type" option in https://github.com/elastic/elastic-agent-changelog-tool and the
gradlew generateReleaseNotescommand in the 8.19 branch of the elasticsearch repo.Examples
4. Refresh the binaries, per https://github.com/elastic/docs-builder/blob/main/README.md. For example:
./build.sh clean ./build.sh publishbinaries cd .artifacts/publish/docs-builder/release/changelog addcommand:```sh
./docs-builder changelog add --prs ~/path/to/8.19.10.txt --repo elasticsearch --owner elastic --products "elasticsearch 8.19.10" --config ~/path/to/changelog.yml --output ~/path/to/elasticsearch/docs/changelog/new/
The resulting file in this case is as follows:
When it is substituted for the existing file, it renders successfully. For example:
Code changes
1. Command Interface (
src/tooling/docs-builder/Commands/ChangelogCommand.cs)--file-typeparameter to theRendercommandfile-typeis either"markdown"or"asciidoc"2. Input Model (
src/services/Elastic.Documentation.Services/Changelog/ChangelogRenderInput.cs)FileTypeproperty (defaults to"markdown")3. Service Implementation (
src/services/Elastic.Documentation.Services/ChangelogService.cs)New Methods:
RenderAsciidoc()- Main method that generates a single asciidoc file with all sectionsRenderEntriesByAreaAsciidoc()- Renders entries grouped by component/area in asciidoc formatRenderBreakingChangesAsciidoc()- Renders breaking changes in asciidoc formatRenderDeprecationsAsciidoc()- Renders deprecations in asciidoc formatRenderKnownIssuesAsciidoc()- Renders known issues in asciidoc formatFormatPrLinkAsciidoc()- Formats PR links as asciidoc attribute referencesFormatIssueLinkAsciidoc()- Formats issue links as asciidoc attribute referencesConvertRepoToAttributeName()- Converts repository names to asciidoc attribute formatModified methods
RenderChangelogs()- Updated to route to appropriate renderer based onfile-type:asciidoc: callsRenderAsciidoc()to generate a single.asciidocfilemarkdown(default): calls existing markdown renderers to generate multiple.mdfiles4. Asciidoc format details
The asciidoc output follows patterns from Elasticsearch release notes:
[float]attributes for subsections::(e.g.,Data streams::){repo-pull}NUMBER[#NUMBER]and{repo-issue}NUMBER[#NUMBER]Documentation updates
1.
docs/cli/release/changelog-render.md--file-typeoption documentationindex.md,breaking-changes.md,deprecations.md,known-issues.md).asciidocfile with all sections2.
docs/contribute/changelog.md--file-typeoption--file-type asciidocusageTesting
For new tests added, go to #2452 (comment)
Usage Examples
Markdown (default):
docs-builder changelog render \ --input "./changelog-bundle.yaml,./changelogs,elasticsearch" \ --title 9.2.2 \ --output ./release-notesAsciidoc:
docs-builder changelog render \ --input "./changelog-bundle.yaml,./changelogs,elasticsearch" \ --title 9.2.2 \ --output ./release-notes \ --file-type asciidocBackward Compatibility
--file-typedefaults to"markdown"if not specifiedGenerative AI disclosure
Tool(s) and model(s) used: composer-1 agent