-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add a way to find and filter tabular data #141
Comments
Two questions for you:
One thing that just occurred to me is that since bash strings are easy to make multiline, I could potentially have the table selector syntax be multiline somehow. Maybe something like:
for example, if I had this table:
then this:
would result in:
In this proposed syntax, mdq '|-|
| /o/ |
| * | One additional wrinkle is that right now, I intentionally have the syntax such that every character is unambiguous as you read it -- the only real exception being escapes within quotes. This would break that, since mdq '{|-|}' # just select tables
mdq '{|-|
| /o/ |
| * |
}' How does that strike you? |
Oh, I could do | Name | Value |
|:----:|:-----:| <-- this bit
| Foo | 123 | The colons on both sides mean "column is centered", so it's a bit of a misnomer to use them for "tables" in general -- but that's probably okay. Since I always have two matchers, maybe I can do away with all the other table markdown.
Hm, maybe I should repeat that between the row and column matchers?
I think that may be the winner so far. |
The only thing the interface actually needs is `fn try_select`. The `fn matches` is just a convenient way of implementing `try_select`. This commit formalizes that by making Selector only decaore `fn try_select`, and without a default impl. This is in preparation for #141. That implementation will let us create "table slices", which aren't just a pointer to an existing table, but actually creates a new table which is a subset of the original. That won't fit into the `fn matches` pattern, so this PR breaks that pattern up.
Find: there's no titles for tables so maybe the selector could be by column titles, or by some selector on the data.
Select: It would be really cool if you could select particular rows, columns and cells of tables.
The text was updated successfully, but these errors were encountered: