Scope scenarios per category and surface filters in a table#44
Open
methodofaction wants to merge 2 commits intomainfrom
Open
Scope scenarios per category and surface filters in a table#44methodofaction wants to merge 2 commits intomainfrom
methodofaction wants to merge 2 commits intomainfrom
Conversation
The Spain reverse-charge scenario rendered twice in the docs because GOBL defines distinct VAT- and IGIC-scoped scenarios, but the generator's template stripped the Categories filter that distinguished them. Add a new Scenarios overview article and rework the per-regime/addon Scenarios section so each schema lives inside an Accordion and is rendered as a single table whose columns adapt to the filters actually in use. The Output column shows the JSON GOBL emits (note/codes/ext) and custom Filter functions get a deep link to their source on GitHub when the scenario doesn't carry a Desc/Name. The Validation Rules section gains a matching short blurb that links to the existing overview article. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the generated documentation for tax regime/addon scenarios to prevent visually-collapsed rows (e.g., VAT vs IGIC) by surfacing relevant filters as table columns, and adds a dedicated Scenarios overview page.
Changes:
- Reworks Scenarios sections to render per-schema scenario sets as a single table with only populated filter columns (Tags/Type/Categories).
- Renders scenario outputs as indented JSON in a monospace
<code class="code-block">…</code>block and adds CSS to display it cleanly in table cells. - Adds
overview/scenarios.mdxand links regime/addon pages to the overview pages for Scenarios and Validation.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| style.css | Styles table-cell code blocks as block-level for multi-line JSON output. |
| docs.json | Adds overview/scenarios to the documentation navigation. |
| overview/scenarios.mdx | New overview article explaining scenario filters/outputs and matching behavior. |
| cmd/generate/utils.go | Adds scenario table + output rendering helpers and custom-filter GitHub source linking. |
| cmd/generate/regimes.go | Switches scenario rendering to per-schema accordion + computed table; links to scenarios overview. |
| cmd/generate/addons.go | Same scenario rendering changes for addons. |
| cmd/generate/generator.go | Adds shared Validation Rules intro text + link to validation overview. |
| regimes/ae.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/at.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/be.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/br.mdx | Adds Validation Rules intro link. |
| regimes/ch.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/co.mdx | Adds Validation Rules intro link. |
| regimes/de.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/dk.mdx | Adds Validation Rules intro link. |
| regimes/el.mdx | Updates Scenarios section to table format. |
| regimes/es.mdx | Updates Scenarios section to disambiguate by Categories (VAT vs IGIC) in table format; adds Validation Rules intro link. |
| regimes/fr.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/gb.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/ie.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/in.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/it.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/mx.mdx | Adds Validation Rules intro link. |
| regimes/nl.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/pl.mdx | Adds Validation Rules intro link. |
| regimes/pt.mdx | Adds Validation Rules intro link. |
| regimes/se.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| regimes/sg.mdx | Adds Validation Rules intro link. |
| regimes/ar.mdx | Adds Validation Rules intro link. |
| addons/ar-arca-v4.mdx | Adds Validation Rules intro link. |
| addons/br-nfe-v4.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/br-nfse-v1.mdx | Adds Validation Rules intro link. |
| addons/co-dian-v2.mdx | Adds Validation Rules intro link. |
| addons/de-xrechnung-v3.mdx | Adds Validation Rules intro link. |
| addons/es-facturae-v3.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/es-sii-v1.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/es-tbai-v1.mdx | Adds Validation Rules intro link. |
| addons/es-verifactu-v1.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/eu-en16931-v2017.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/fr-choruspro-v1.mdx | Adds Validation Rules intro link. |
| addons/fr-ctc-flow2-v1.mdx | Adds Validation Rules intro link. |
| addons/gr-mydata-v1.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/it-sdi-v1.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/it-ticket-v1.mdx | Adds Validation Rules intro link. |
| addons/mx-cfdi-v4.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/pl-favat-v3.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
| addons/pt-saft-v1.mdx | Updates Scenarios section to table format; adds Validation Rules intro link. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/invopop/gobl.docs/sessions/a9c71b41-3581-41da-9bfc-7a6ebcc69af0 Co-authored-by: methodofaction <51445+methodofaction@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Before:
After:
Summary
regimes/es.mdxrendered the reverse-charge scenario (and several others) twice. Root cause: GOBL declares distinct VAT- and IGIC-scoped scenarios, but the generator template never surfaced theCategoriesfilter that distinguished them, so the two collapsed visually.<Accordion>(mirroring Validation Rules) and is rendered as a single table. Columns are computed per table from the filters that are actually populated — empty filter columns are dropped so each country/standard shows only the dimensions that matter to it.note/codes/ext) using the real wire shape — includingNote.Category,Note.Key, etc. — instead of a flattened summary. Indented JSON is rendered via<code class="code-block">with<br/>+ so it lays out neatly inside table cells. The matching display rule lives instyle.css.Filterfunctions can't be introspected, buttax.Scenarioalready exposesName/Desc(i18n strings) for documentation. The newcustomFilterLabelhelper rendersDescwhen set, thenName, and otherwise emits a bare[custom](URL)link to the function's source on GitHub at the gobl version pinned ingo.mod— usingruntime.FuncForPCto resolve the file:line.overview/scenarios.mdxexplaining how scenarios match documents, what each filter checks, and where outputs land (notes →tax.notes, ext →tax.ext, codes → summary). Both the Scenarios and Validation Rules section headers in regime/addon pages now link to their respective overview articles instead of repeating the explanation inline.Test plan
go build ./cmd/generate && ./generateruns cleanly.mint dev— visitregimes/esand confirm the two reverse-charge rows are now disambiguated by theCategoriescolumn.addons/es-verifactu-v1and confirm theCategoriescolumn is hidden (none of its scenarios use it).addons/pt-saft-v1andaddons/mx-cfdi-v4; the custom-filter rows render as acustomlink to GitHub atv0.401.0(or whatever versiongo.modpins).overview/scenariosfrom the sidebar (Overview group)..code-block { display: block }rule).🤖 Generated with Claude Code