Show HN: Excel-like table editing for Markdown
blog.documentnode.io
blog.documentnode.io
I don't know if this is sacrilege or not here but I really like reStructuredText's list-table directive [1] for this kind of thing. It provides a text-friendly editable representation that renders to a nice table. There's a CSV-based table directive also (scroll up one in the link).
.. list-table:: Frozen Delights!
:widths: 15 10 30
:header-rows: 1
* - Treat
- Quantity
- Description
* - Albatross
- 2.99
- On a stick!
* - Crunchy Frog
- 1.49
- If we took the bones out, it wouldn't be
crunchy, now would it?
* - Gannet Ripple
- 1.99
- On a stick!
I like Markdown a lot for simple things like notes and readmes. When I write technical documentation and when I wrote my e-book, RST had the extended feature set I needed.[1] https://docutils.sourceforge.io/docs/ref/rst/directives.html...
| Treat | Quantity | Description |
| :------------ | :-------- | :-------------------------------------------------------------- |
| Albatross | 2.99 | On a stick! |
| Crunchy Frog | 1.49 | If we took the bones out, it wouldn't be crunchy, now would it? |
| Gannet Ripple | 1.99 | On a stick! |
[Frozen Delights!]
...despite the comparative hassle in editing them. It's just so much more readable at a glance later.AsciiDoc got it right: https://asciidoctor.org/docs/asciidoc-syntax-quick-reference... You can even have formatted source code in AsciiDoc table cells. Try this with Markdown ...
can you elaborate?
Markdown tables are overly simplistic.
The real problem with markdown is that now it has now reached the kind of critical mass where people start using it everywhere and reaching for it even when it doesn't make sense simply because it's the first thing that pops into peoples head.
So, in my personal opinion, if you start needing the kind of design sugar as formatted cells then you really should be using any one of the plethora of other document formats out there because you're requirement no longer fits around the core principle of markdown. A great many of which can still be composed in a text editor and some of which are still relatively easy for a human to parse.
[edit]
Getting downvoted on this so I'll provide some citations:
> "[Markdown's] key design goal is readability – that the language be readable as-is, without looking like it has been marked up with tags or formatting instructions"
Source: https://en.wikipedia.org/wiki/Markdown#History (Wikipedia, Markdown history)
> "A Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters — including Setext, atx, Textile, reStructuredText, Grutatext, and EtText — the single biggest source of inspiration for Markdown’s syntax is the format of plain text email."
Source: https://daringfireball.net/projects/markdown/syntax (John Gruber, one of the co-creators of markdown)
> Markup offers an alternative means to encode this signaling information by overloading certain graphic characters (see, e.g., [ISO646]) with additional meanings. Therefore, markup languages allow for annotating a document in a syntactically distinguishable way from the text, while keeping the annotations printable.
Source: https://tools.ietf.org/html/rfc7763 (original RFC)
From that point of view, tables should have never been part of Markdown.
It seems like the OP would be better served by CommonMark or any of the alternate implementations which are designed to be more feature complete to solve these kinds of formatting problems.
Regardless, if you want to go down the rat hole of exactly what is Markdown, the only "correct" answer is 'whatever Gruber's 'markdown.pl' does, warts and all'.
That's what usually happens here on HN when you say "this is wrong" to the crowd doing that wrong thing.
Markdown has clearly been extended beyond its original intention, so the criticism on its inadequacy for tables is justified in that it is the de facto standard across platforms and folks are struggling with it.
Whatever its original design goal was is sort of besides the point now. People dislike having to type complex tables manually and not using Markdown isn't a choice in a variety of situations. That frustration is justified.
h|row 1 |foo .2+|bar |baz 5+|newline +
inside cell |last cell
h|another row |bar .2+||||
...
I actually prefer reStructuredText’s approach[0], which while being a hassle to edit, at least ensures table markup visually resembles the result.Overall I feel like having to manually edit a complex table is often a sign of a flawed process somewhere, and should ideally be eliminated—author data in a structured way, and render it as a table automatically. (In the end it depends, of course.)
[0] https://docutils.sourceforge.io/docs/user/rst/quickref.html#...
https://github.com/dhruvasagar/vim-table-mode/blob/master/RE...
Personally I prefer to keep my markdowns simple, as it was explicitly designed to be a simple markup readable in raw form. Often the constraints of simplicity force me to think deeper about what I'm trying to explain so as to fit the format; limitations can be a strength.
Curious what HN thinks of it: https://github.com/IFTTT/tablerize
org-mode already does tables with formulas and all[1], if you’re interested in text-based spreadsheets
M-x org-md-export-to-markdown is my friend!
It was honestly a huge pain. I could have written the formulas for this in under 15 min on a regular spreadsheet software. With org-mode I spent hours trying to figure it out. In the end I had a hacky solution that I don't want to use again.
I admire your optimism.
On the Mac I also use TableFlip [1], which provides an Excel-like interface for tables and works with any Markdown editor that automatically reloads a file on changes. It's a one-time purchase, no subscriptions.
For me org-mode became interface to glue other tools and languages, plus I get documenting facility for free. Just like bash/shell for unix tools.
[1] https://orgmode.org/worg/org-contrib/babel/
[2] https://orgmode.org/worg/org-contrib/babel/intro.html#spread...
If you want an actual reason, the two are not even close. Jupyter is a multi-langauge kernel _server_. Also most of its users are data scientists and the things they care about are pandasDfs, charts, tables which makes html rendering much more capable. You might say there are plugins and ways to do all the things I mentioned org mode/babel, but that misses the point. They're very different products.
Example - with VSCode you have Markdown all in one [1]
Just do "Format Current Table" and thats it, see a picture [2]. Along with column editing and other advanced editor features there is simply no need for anything else, such as excel like GUI.
When I see "pricing" on markdown editor, I really get nausea
[1] https://marketplace.visualstudio.com/items?itemName=yzhang.m...
[2] https://github.com/yzhang-gh/vscode-markdown/raw/master/imag...
The lack of this feature makes Markdown in VSCode a no-go for me.
All in one markdown has PDF export. I use it all the time.
It does one thing and it does it well.
It will seem daunting at first. Especially if you have to learn Emacs as you go.
https://orgmode.org/worg/org-tutorials/org4beginners.html
That tutorial seems pretty good, it starts from the absolute beginning.
Sadly, I can't find the markdown file that actually uses it and I also can't remember how it worked.
But the point is: you can do it (badly, but working) in ~100 of Python code as a plugin for Pandoc.
Fortunately, the file was in a git repo, so I was able to revert and no harm done, but that does not exactly inspire confidence...
It's UTF-8 with unix line endings.
It makes entering tables much easier and the tables more readable.
I'm not a huge fan of tables in markdown but if they're necessary then it should at least be readable in clear text and without padding it's not.
eg with padding:
| which | column | is | the | value | foo | in | ? |
|-------|--------|-----|-----|-------|-----|----|---|
| | | foo | | | | | |
vs without padding | which | column | is | the | value | foo | in | ? |
|-------|--------|-----|-----|-------|-----|----|---|
| | | foo | | | | | |Document Node is not just a pure Markdown editor, it has a beautiful HTML5 preview area, where you can see your tables in a perfect format. You can define your own styles using CSS, although we have 11 preview styles built-in.
Having said that, I think it's a good idea to give the users the option to enable padding. I will add that option in a later version.
There never be a final product for us and stop there, we will keep improving it and roll new versions frequently.
I do understand your point but you could also argue that's when you need padding the most because it becomes infinitely harder to visually parse the raw text.
I like your idea for giving people the option though.
> Document Node is not just a pure Markdown editor, it has a beautiful HTML5 preview area, where you can see your tables in a perfect format.
Document Node is a nicely polished product but it's worth remembering that the point of markdown is that it's still readable without needing a viewer that supports rich formatting. For example it should be just as readable in the terminal as it is in a HTML5 container (this is one of the reasons I don't really like tables in markdown but that ship has already sailed). Unfortunately not everyone will be using Document Node to view their markdown.
Sometimes, it is the art of balance. As a product, the goal is to save users time as much as possible. Eventually, the users have to decide whether it's appropriate to put a super complex table in Markdown, although it will be fine for tables with short rows.
While I'm writing this reply, I thought of how to improve this in Document Node. It can automatically check and add padding depending on whether any Markdown rows exceed 80 characters (or similar). One less thing to worry about.
However, many users are using Document Node for notes taking, as it provides the most flexible way to arrange your content simply in folders.
The GUI library is QT. But not ordinary Qt, we did lots of customization. A large amount of time invested in polishing it.
I always pay attention to GUI/render related projects.