feat: add data-table shortcode for JSON/CSV/YAML-backed tables#465
Open
danielledeleo wants to merge 4 commits intomainfrom
Open
feat: add data-table shortcode for JSON/CSV/YAML-backed tables#465danielledeleo wants to merge 4 commits intomainfrom
danielledeleo wants to merge 4 commits intomainfrom
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
✅ Deploy Preview will be available once build job completes!
|
Render JSON, CSV, or YAML data files as static HTML tables at build time with optional client-side column sorting via progressive enhancement. Support column selection, header label overrides, and wide/narrow layout variants. Interactive mode adds vanilla JS sorting with Lucide sort icons. No-JS fallback is a full static table.
bfc2117 to
77b2fb7
Compare
e1a3e50 to
ab128dc
Compare
Support bordered and borderless table styles via a new theme parameter, matching the existing table shortcode. Default remains bordered. Document the parameter, add borderless examples, and note the plain-text cell value limitation.
Add humanize parameter to disable auto-formatting of JSON/YAML keys. Add markdownify parameter to opt in to markdown processing in cells. Support \, and \: escape sequences in columns, hide, labels, and sort parameters. Fix labels parser to preserve colons in label values. Rewrite documentation for clarity: reorder examples from basic to advanced, document alphabetical column ordering, add static sort example, rename edge cases to special characters, strengthen markdownify security warning, and add edge-case test data.
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
data-tableshortcode that renders JSON, CSV, or YAML data files as static HTML tables at build timeinteractive="true"(vanilla JS, ~130 lines, conditionally loaded)Features
pathassets/interactive"false"sort"col"or"col:desc"columnshidelabels"col:Label,col2:Label"variant"wide""wide"or"narrow"Design decisions
<table>always in HTML; JS only enhances with sort. No-JS fallback is free.humanize | title.Page.Storepattern as mermaid; only loaded on pages that use the shortcode.Files changed
layouts/shortcodes/data-table.html-- the shortcodeassets/js/data-table.js-- sort logic (~130 lines)assets/css/v2/style.css-- data table styles (+80 lines)layouts/partials/scripts.html-- conditional script loadingexampleSite/-- example data files + demo pageScreenshot