Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Mar 14, 2025

This allows us to have different implementations of how a DocumentationFile gets exported to the output folder.

Right now we have two implementations:

  • Default
  • Noop

The noop exporter can be used by passing --metadata-only to docs-builder.

This will only emit our metadata files to the output folder.

This is primarely build for https://github.com/elastic/asciidocalypse/pull/140 to ensure it can build and publish links but we no longer care about the html output.

This allows us to have different implementations of how a `DocumentationFile` gets exported to the output folder.

Right now we have two implementations:

- Default
- Noop

The noop exporter can be used by passing `--metadata-only` to `docs-builder`.

This will only emit our metadata files to the output folder
@Copilot Copilot AI review requested due to automatic review settings March 14, 2025 10:25
@Mpdreamz Mpdreamz requested a review from a team as a code owner March 14, 2025 10:25
@Mpdreamz Mpdreamz self-assigned this Mar 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces the concept of documentation file exporters to allow different implementations for exporting documentation files. It provides a default exporter and a no-op exporter (triggered via the metadataOnly flag), updates the state tracking to record the exporter in use, and adjusts the CLI commands and documentation generation code accordingly.

  • Introduces the DocumentationFileExporter interface and its default implementation.
  • Implements a NoopDocumentationFileExporter for metadata-only builds.
  • Updates GenerationState, CLI commands, and DocumentationGenerator to utilize the exporter.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Elastic.Markdown/Exporters/DocumentationFileExporter.cs Adds the exporter interface and base implementation for processing and copying documentation files.
src/Elastic.Markdown/Exporters/NoopDocumentationFileExporter.cs Implements a no-op exporter for metadata-only exports.
src/Elastic.Markdown/IO/State/GenerationState.cs Records the exporter name in the generation state.
src/docs-builder/Cli/Commands.cs Adds a new CLI parameter 'metadataOnly' to enable the noop exporter.
src/Elastic.Markdown/DocumentationGenerator.cs Refactors file and resource processing to use the exporter abstraction.
Comments suppressed due to low confidence (1)

src/Elastic.Markdown/Exporters/DocumentationFileExporter.cs:16

  • [nitpick] Consider renaming the parameter 'token' to 'cancellationToken' for clarity and consistency with .NET conventions.
Task ProcessFile(DocumentationFile file, IFileInfo outputFile, Cancel token);

@Mpdreamz Mpdreamz merged commit 04d9373 into main Mar 14, 2025
8 checks passed
@Mpdreamz Mpdreamz deleted the feature/documentation-file-exporter branch March 14, 2025 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants