feat: support custom table styles from style layout#472
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Extract table cell styles (background, text style) from a 2x2 table in the "style" layout and apply them when creating new tables.
This comment has been minimized.
This comment has been minimized.
Extract border styles from 2x2 table in the "style" layout and apply them to markdown tables. The 2x2 table cells map to different table regions: - [0,0] Top/Left → outer borders (top/bottom/left/right) - [0,0] Right/Bottom → header row, 1st column inner borders - [0,1] Right/Bottom → header row, 2nd+ columns inner borders - [1,0] Right/Bottom → data rows, 1st column inner borders - [1,1] Right/Bottom → data rows, 2nd+ columns inner borders Also supports transparent borders (Alpha=0) by using ForceSendFields.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
Code Metrics Report
Details | | main (abcfb83) | #472 (871242c) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 32.3% | 33.2% | +0.9% |
| Files | 30 | 31 | +1 |
| Lines | 3190 | 3382 | +192 |
+ | Covered | 1031 | 1126 | +95 |
+ | Code to Test Ratio | 1:0.8 | 1:0.9 | +0.0 |
| Code | 6550 | 6985 | +435 |
+ | Test | 5796 | 6453 | +657 |
| Test Execution Time | 10s | 10s | 0s |Code coverage of files in pull request scope (7.4% → 20.1%)
Reported by octocov |
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 support for custom table styles from the
stylelayout. Users can now customize table appearance by placing a 2x2 table in thestylelayout.Features
Cell Styles
Each cell in the 2x2 table defines styles for different regions of Markdown tables:
[0,0][0,1][1,0][1,1]Extracted properties:
Border Styles
Border styles are mapped as follows:
[0,0]Top/Left[0,0]Right/Bottom[0,1]Right/Bottom[1,0]Right/Bottom[1,1]Right/BottomTransparent borders (
Alpha=0) are also supported.Changes
table_style.go: AddedTableBorderStylestruct,extractBorderStyle(), and alignment extractiontable.go: AddedapplyTableBorderStyles(),prepareBorderProperties(), and alignment applicationREADME.md: Added documentation for table style customization