Add table renderer with terraform-docs-style output and marker injection#1
Merged
ewels merged 6 commits intoewels:mainfrom Mar 3, 2026
Merged
Conversation
…ction Add a new 'concise' output format that generates compact Markdown tables inspired by terraform-docs. Includes marker-based injection support so generated docs can be embedded in existing README files between <!-- BEGIN_NF_DOCS --> and <!-- END_NF_DOCS --> markers. Generated by Claude Code
ewels
approved these changes
Feb 23, 2026
| # Inputs | ||
| if proc.meta_inputs or proc.inputs: | ||
| rows: list[str] = [ | ||
| f"### `{proc.name}` Inputs", |
Owner
There was a problem hiding this comment.
Ah, ok - to match outputs below. Fair enough.
Rename ConciseRenderer -> TableRenderer and concise.py -> table.py to better reflect the terraform-docs-inspired table output format. CLI format option is now 'table' instead of 'concise'. Generated by Claude Code
Generated by Claude Code
Users can now place {{ section }} tags between BEGIN_NF_DOCS / END_NF_DOCS
markers to control which sections are rendered (e.g. {{ inputs }}, {{ config }}).
Empty markers render everything (backward compatible). Inspired by terraform-docs.
Generated by Claude Code
Generated by Claude Code
Contributor
Author
|
I've added selective items, so you can do this: <!-- BEGIN_NF_DOCS -->
{{ inputs }}
{{ config }}
<!-- END_NF_DOCS -->And discard everything else. This could be useful for adding high level docs for a README.md |
Generated by Claude Code
Owner
|
I didn't have push permissions to your fork, so I just merged. But see |
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.
Summary
Add a new
tableoutput format that generates compact Markdown tables, inspired by terraform-docs and related to nextflow-io/nf-schema#201.Changes
TableRenderer(src/nf_docs/renderers/table.py) — generates terraform-docs-style dense Markdown tables with sections for Inputs (grouped), Configuration, Workflows (with calls), Processes (with I/O sub-tables), and Functions<!-- BEGIN_NF_DOCS -->/<!-- END_NF_DOCS -->markers for embedding generated docs into an existing README without overwriting surrounding contentnf-docs generate . -f tablewrites aREADME.mdto the output directoryMarker injection
When the output
README.mdalready exists and contains the markers:Running
nf-docs generate . -f table -o .will replace only the content between the markers, preserving everything else. If no markers exist, the file is created with markers wrapping the content.Example output