Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grammar scope: Table syntax #5

Closed
wion opened this issue Feb 9, 2021 · 2 comments
Closed

grammar scope: Table syntax #5

wion opened this issue Feb 9, 2021 · 2 comments

Comments

@wion
Copy link
Owner

wion commented Feb 9, 2021

A scope is needed for greying out all table syntax, leaving only the cell headers and data foreground color.

Note this is different from how iA Writer treats tables; it leaves the syntax as foreground color. Thus, this enhancement would be an improvement over the iA Writer aesthetic.

Requires a concentrated look at regular expressions for this.

@wion wion added the to do On the to do list label Feb 9, 2021
@wion wion added the IN FOCUS Currently being worked on. label Feb 17, 2021
@wion
Copy link
Owner Author

wion commented Feb 28, 2021

After much trial and error, the grammar for tables mostly works. This was my test markup, which is not representative of every possible Textile table syntax, but most of it:

table(class#id).
|=. Table 1. Table caption here.
|:. |\2. 26|\3. 16|
|^(thead#id).
|_\2. Header1 Cell Spans Two Columns[^*^] |_. Header3[^†^] |_. Header4 |_. Header5 |
|~(tfoot#id).
|\5. Footer row, cell one, spans all five columns.[^‡^] |
|-(tbody#id).
| data[^§^] | data |/2. @/2@ cell spans two rows | data | data |
(class). | data | data[^¶^] | data | data |
| data | data | data[^‖^] | data | data |
| data[^**^] | data | data[^††^] | data | data |

I did my testing at Regexr.

And here's the current effect...

tWriter tables

Note the one dot after the row selector at start of third-to-last row is not greyed out. I could not figure out how to get that one dot without screwing up much more of the other bits, so that one foreground dot is okay with me. I never use a row selector like that anyway.

@wion wion removed IN FOCUS Currently being worked on. to do On the to do list labels Feb 28, 2021
@wion wion closed this as completed Feb 28, 2021
@wion
Copy link
Owner Author

wion commented Mar 2, 2021

Note the one dot after the row selector at start of third-to-last row is not greyed out.

Fixed with c97a592

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant