Open cskeeters opened 1 month ago
I wasn't able to reproduce your issue. Instead I got the following date-mkd.mkd
on running e! mkd
:
| Date | Now | Value |
|----------------|------------|------------|
| ************** | Jul-2024 | Jun-2024 |
Is there anything else I should do to reproduce your result?
I'm running on MacOS Sonoma 14.3.1 (23D60). I installed sc-im with:
brew install --head sc-im
After some further testing, if I make the A column wider (30fl
) within sc-im, and re-export the markdown, I get the label centered and the formatted date on the right. It just dawned on me that there might be a correlation between the width of the columns in the sheet and the exported table. That's something worth noting. I had previously guessed it would calculate the widest exported text for that column and make it that width.
Within sc-im, the cell only displays the formatted date on the right. I think that's what I would prefer to see in the mkd output.
| Date | Now | Value |
|----------------------------------------|------------|------------|
| 3/5/2024 Mar-2024 | Jul-2024 | Jun-2024 |
I can't reproduce that either! I just see the formatted date in A1.
Btw, I'm not a maintainer or anything. I was just troubleshooting a possibly related bug of my own.
To be clear, I see only the formatted date in A1 from within sc-im. In the mkd file that results from e! mkd
, I see a centered text with the date label and the formatted date on the right of the cell that would correspond to A1. You don't see that?
Ah, I misunderstood. Yes, I do see that. In that case, it might be related to my bug. I can fix it with the following patch:
diff --git a/src/file.c b/src/file.c
index 40c0cfd..fafa2d3 100644
--- a/src/file.c
+++ b/src/file.c
@@ -1541,7 +1541,7 @@ void export_markdown(char * fname, int r0, int c0, int rn, int cn) {
}
// If a string exists
- if ((*pp)->label) {
+ if ((*pp)->v == '\0' && (*pp)->label) {
strcpy(text, (*pp)->label);
align = 1; // right alignment
if ((*pp)->flags & is_label) { // center alignment
which is the same as what I did for #879. FYI @andmarti1424
I think the not-enough-room formatting is also a bug. The fact there was enough room for the date when viewing in sc-im directly suggests there should be enough room to show it in the markdown version.
If a cell has a number representing a date and a label (for future
E
<c-d>
), the cell of the markdown exported table outputs the label instead of the formatted date and appears to have two years in it. I'd prefer the formatted date as show to the user in sc-im.In the example:
\3/5/2024
, Enter,<c-d>
=@now
=@now
, Enter,:valueize
The same date format was applied to all three dates. (
:format \"d%b-%Y\"
)date-mkd.sc
date-mkd.mkd