Skip to content

feat(gherkin-to-asciidoc): write report snippets and support custom Mustache templates - #79

Merged
Arc-E-Tect merged 3 commits into
mainfrom
add-support-for-templating
Jul 24, 2026
Merged

feat(gherkin-to-asciidoc): write report snippets and support custom Mustache templates#79
Arc-E-Tect merged 3 commits into
mainfrom
add-support-for-templating

Conversation

@Arc-E-Tect

@Arc-E-Tect Arc-E-Tect commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds snippetDir (default build/generated-docs/features/snippets): whenever trackProgress is on, listed.adoc/defined.adoc/implemented.adoc snippet files are now always written, containing exactly the scenario bullets each status's section would otherwise embed. When groupByFeature is also true, a status with at least one scenario writes one snippet file per feature instead, under <snippetDir>/<camelCaseFeatureTitle>/<status>.adoc. Snippets are written unconditionally, regardless of whether a template is configured.
  • Adds template (optional): a Mustache file used to render the report so it references the snippets via include:: directives instead of embedding their content verbatim. Without one, the report looks exactly as it did before this change.
  • groupByFeature is now genuinely respected in tracking mode instead of being unconditionally forced on internally — it still defaults to true whenever trackProgress is true, but can be explicitly set to false for a flat, non-grouped progress report (needed to produce the flat/non-grouped combination at all).
  • New classes: FeatureNameFormatter (camelCase directory naming), SnippetWriter (+ FeatureSnippet/StatusSnippets), ProgressReportOptions, ReportTemplateRenderer (via com.github.spullara.mustache.java), ReportText, StatusSummary.
  • Two reference templates (templates/grouped.mustache, templates/flat.mustache), documented in full in the plugin README with the Mustache context data model spelled out, are verified by DefaultEquivalentTemplatesTest to reproduce — once their include:: directives are resolved — byte-identical output to the report with no template configured, for both grouped and flat modes.
  • New example project snippet-templates registers all four combinations (grouped/flat × template/no-template) as separate tasks in one build.gradle, so the four reports are easy to compare side by side.

Arc-E-Tect and others added 3 commits July 25, 2026 01:05
…ustache templates

Adds two DSL properties, consulted only when trackProgress is true:

- snippetDir (default: build/generated-docs/features/snippets): every
  run now writes listed.adoc/defined.adoc/implemented.adoc snippet
  files containing exactly the scenario bullets that status's section
  would otherwise embed. When groupByFeature is also true, a status
  with at least one scenario writes one snippet file per feature
  instead, under <snippetDir>/<camelCaseFeatureTitle>/<status>.adoc.
  Snippets are written unconditionally, regardless of whether a
  template is configured.

- template (optional): a Mustache file used to render the report so
  that it references the snippets via include:: directives instead of
  embedding their content verbatim. Without one, the report looks
  exactly as it did before this change.

groupByFeature is now also genuinely respected in tracking mode
instead of being unconditionally forced on internally: it still
defaults to true whenever trackProgress is true (same as before), but
can be explicitly set to false to get a flat, non-grouped progress
report - needed to produce flat snippets/reports at all.

New classes: FeatureNameFormatter (camelCase directory naming),
SnippetWriter (+ FeatureSnippet/StatusSnippets), ProgressReportOptions,
ReportTemplateRenderer (Mustache, via com.github.spullara.mustache.java),
ReportText (explanatory copy shared between the default writer and the
template context), StatusSummary. ProgressReportWriter now orchestrates
classification, snippet writing, and dispatches to either the template
renderer or the existing verbatim writer.

Includes two reference templates (test resources
templates/grouped.mustache and templates/flat.mustache, also
documented in the plugin README) verified by
DefaultEquivalentTemplatesTest to reproduce - once their include::
directives are resolved - byte-identical output to the report with no
template configured, for both grouped and flat modes.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…g all 4 combinations

Adds a new example project that registers four GenerateFeatureDocsTask
instances directly in build.gradle - one per combination of
groupByFeature (grouped/flat) and template (with/without) - all
against the same auth + billing feature/glue content used by the
progress-tracking example, so the four generated reports are easy to
compare side by side. Bypassing the gherkinToAsciidoc { } extension
like this only makes sense for demonstrating multiple configurations
from one project; a real project only needs one.

Includes the two reference templates from the plugin README
(templates/grouped.mustache, templates/flat.mustache) copied verbatim,
and a generateAllReports task that runs all four.

Verified against a local publishToMavenLocal build before pinning the
version catalog to 1.2.0 (the next version given this is an additive,
non-breaking pair of properties on top of the released 1.1.0); won't
build against the Gradle Plugin Portal until 1.2.0 is actually
released - same caveat as previous example additions.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…deprecated buildDir

Explains what sections[].blurb means in the Mustache context table
(previously only listed as a field name) and breaks down every
sections field individually. Adds the "a" (AsciiDoc) column style so
the new bullet list actually renders as a list instead of flat text.

Also replaces the deprecated Groovy buildDir project property in the
DSL default-value docs (outputDir, snippetDir) with
layout.buildDirectory, matching what the plugin's own code and Kotlin
DSL examples already used.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@Arc-E-Tect
Arc-E-Tect merged commit af9218b into main Jul 24, 2026
4 checks passed
@Arc-E-Tect
Arc-E-Tect deleted the add-support-for-templating branch July 24, 2026 21:46
Arc-E-Tect added a commit that referenced this pull request Jul 24, 2026
# [1.2.0](v1.1.0...v1.2.0) (2026-07-24)

### ✨ New and updated features

* **gherkin-to-asciidoc:** write report snippets and support custom Mustache templates ([#79](#79)) ([af9218b](af9218b)), closes [#79](#79)
@Arc-E-Tect

Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 1.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

1 participant