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

Convert simple tables to Markdown tables #75

Open
evbacher opened this issue Jul 29, 2020 · 10 comments
Open

Convert simple tables to Markdown tables #75

evbacher opened this issue Jul 29, 2020 · 10 comments

Comments

@evbacher
Copy link
Owner

Currently, Docs to Markdown converts all tables to HTML tables, which is also valid in Markdown files. But some simple tables could be converted to Markdown tables, and they would be more readable in source form.

We could probably start converting all tables to both Markdown and HTML, and if we run into something that is too complex (almost anything is too complex for Markdown tables), then we render the HTML table (and stop constructing the Markdown table).

This is complicated though -- will require some thought about what will trigger the change to HTML-only. If anyone wants to explore this, let me know.

@rgschmitz1
Copy link

I just started using your add-on, works great for the most part! I actually just wrote a small bash script for generating the TOC before spotting this issue. I'll take a look at your code and contribute if I can wrap my head around it.

@evbacher
Copy link
Owner Author

evbacher commented Aug 15, 2021

@rgschmitz1: Are you generating a Markdown TOC from the headings? That's a different issue from the Markdown tables, but also an interesting one. I have not thought about the Markdown/HTML table issue for a while, but it's certainly an interesting problem. (Though I have not pursued it much because the HTML tables can handle any kind of formatting, while Markdown tables are rather limited.)

Also, if you find the code bewildering, give me a holler, and I can try and remember what my logic (or lack thereof) was :)

@rgschmitz1
Copy link

Oops, I misunderstood this issue. Markdown tables do seem pretty limited in GitHub at least.

I am generating the TOC from headers, thankfully your tool left a clear marker ([TOC]). There's a bunch of scripts for this but I was hoping to make something a little less complicated for personal use.

@evbacher
Copy link
Owner Author

evbacher commented Aug 15, 2021

Yeah, when I originally wrote this add-on, we were generating a TOC server-side (via some JavaScript), triggered by the [TOC] directive. I don't have access to that server or code anymore, but I suppose it would be possible to do something in the add-on itself based on the headings. Maybe I'll create a separate issue for that one.

@TheOtherBrian1
Copy link

It's been quite a while, is this issue still open?

@evbacher
Copy link
Owner Author

Sure -- I have not spent much thought on this recently, but if you have some ideas, this bug is still open. Check out https://github.com/evbacher/gd2md-html/blob/master/dev.md -- specifically on the testing and verification. It's best if changes and enhancements do not break any existing functionality or create any obvious new bugs.

One other issue is if attempting to create Markdown tables significantly increases the computation time, that's not a good thing either, though it would probably only affect docs that are table-heavy. Worth testing though.

@ciriousjoker
Copy link

I'd also like to have this feature. When creating a very simple table, I'd like to convert it to the "|" table markdown syntax so ChatGPT understands it (supposedly!) better.

@haiyulin
Copy link

haiyulin commented Feb 27, 2024

There are no complicated tables in my document, just tables for taking notes. I really need this feature. Thank you.
Suggestion: Or you can set a switch to allow users to choose to convert tables into MD format or HTML format.

@birdie60
Copy link

birdie60 commented Nov 14, 2024

+1 for Markdown table support

I am using Redmine, which has some Markdown support, but doesn't support HTML tags in Markdown-enabled fields. :-(

@evbacher
Copy link
Owner Author

While Markdown tables seem simple, converting them from a Google Doc is not simple, so this is not an easy enhancement. We are working on some enhancements, and this is on the list, but I cannot promise that it will be a quick fix.

Thanks for your patience! (And remember that HTML is valid Markdown.)

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

No branches or pull requests

6 participants