feat: add configurable table styles (markdown, boxDrawing, doublePipe)#8
Open
bquenin wants to merge 1 commit intofranlol:mainfrom
Open
feat: add configurable table styles (markdown, boxDrawing, doublePipe)#8bquenin wants to merge 1 commit intofranlol:mainfrom
bquenin wants to merge 1 commit intofranlol:mainfrom
Conversation
bquenin
added a commit
to bquenin/opencode-md-table-formatter
that referenced
this pull request
Feb 8, 2026
Remove accidentally committed package-lock.json (Bun project), add it to .gitignore, and bump version to 0.1.0 for breaking change.
Owner
|
Love the idea, this makes the tables look much nicer! I agree that we shouldn’t force a single style by default, instead, a configuration option would be so good. But the implementation should be scalable, so adding more styles later (like a "doublePipe" option using double‑line box characters) is straightforward: Can you adjust the PR to add this as a style option , with the default one set to the standard markdown, and with a structure that makes extending it easy? That’ll give us flexibility without locking in one aesthetic. Thanks! |
Refactor table rendering to use a strategy pattern with pluggable styles. Default to standard markdown tables; box-drawing and double-pipe styles are available via the OPENCODE_TABLE_STYLE environment variable. - Extract shared parseTable() for style-independent parsing - Add createBorderedStyle() factory for bordered variants - Restore markdown style with formatSeparatorCell from main - Add TABLE_STYLES registry for easy extensibility - Document configuration in README
07155ee to
814306a
Compare
Author
|
Hey @franlol — I've reworked this based on your feedback. Here's what changed:
Let me know what you think! |
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
Adds configurable table styles, addressing review feedback to not make box-drawing the only option.
renderTable()function, cleanly separating parsing from renderingcreateBorderedStyle(chars)factory: All bordered variants (boxDrawing, doublePipe) are generated from a character map — adding a new bordered style is a single function callOPENCODE_TABLE_STYLEenv var: Set tomarkdown(default),boxDrawing, ordoublePipeparseTable(): Style-independent parsing extracted into its own functionformatSeparatorCellrestored: Markdown style uses the original separator logic frommainAvailable styles
markdown(default):boxDrawing:doublePipe:Extensibility
Adding a new bordered style is a one-liner:
Closes #7