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

Add more control over the title of columns in dynamic blocks #10

Open
Delapouite opened this issue Mar 21, 2024 · 1 comment
Open

Add more control over the title of columns in dynamic blocks #10

Delapouite opened this issue Mar 21, 2024 · 1 comment

Comments

@Delapouite
Copy link

Delapouite commented Mar 21, 2024

Hello

Currently, while using dynamic blocks, the titles of columns of the resulting org-table are generated like this:

              (insert "|"
                      (if no-link "" "|")
                      (string-join (--map (pcase it
                                            ((pred symbolp) (capitalize (symbol-name it)))
                                            (`(,_ ,name) name))
                                          columns)
                                   " | ")
                      "|\n|-\n")

In some situations these titles of columns can be quite long, but the content of each cells in the columns very short (like boolean value true, false), so it fees like a the horizontal space could be reduced by renaming columns.

Example where Year-of-birth is a bit too long and could be renamed to simply Year in this context:

| Name | Year-of-birth |
|------+---------------|
| John |          1985 |
| Mary |          1974 |


| Name | Year |
|------+------|
| John | 1985 |
| Mary | 1974 |

What about some kind of optional plist mapping initial column names to desired column names given as parameter to the dblock? Or maybe a transformer function?

Thanks

@ahmed-shariff
Copy link
Owner

Thank you for the suggestion. I like this idea. I think such a function can also be extended to all values in the column.

However, it might take me some time for me to get around to this. If you have any suggestions or would like to submit a PR, I am open to it.

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

2 participants