Feature: table formating
Closed this issue ยท 6 comments
I think that being able to format a markdown table would be very nice.
So this:
| Column A | Column B |
| - - | - |
| a | A |
| b | B |
| c | C |
Would become this:
| Column A | Column B |
| -------- | --------- |
| a | A |
| b | B |
| c | C |
This could be interesting. I feel that I have read about LSP formatting, so I wonder if this can be done through the LS protocol.
Otherwise, it could be done in #95 (which I envision will have the goal of turning neovim into a true outliner like Logseq), or I am sure users could use another formatting plugin that we could suggest.
Yeah, I've been using the dprint formater to do this with the following set of setup instructions:
How to install the dprint formatter for markdown
Note: This setup needs my helix dotfiles to configure helix to use the dprint command to format files.
- Install dprint:
curl -fsSL https://dprint.dev/install.sh | sh
- Add an alias for dprint by adding the following line to
~/.config/fish/config.fish
:alias dprint "~/.dprint/bin/dprint --config ~/.dprint/dprint.json"
- Setup dprint config
dprint init -c ~/.dprint/dprint.json
Although the language server protocol defianately also has this feature, and it would noticably simplify my setup to not configure dprint.
Neat, so we could just use dprint, no?
Neat, so we could just use dprint, no?
You could, but I don't know what it would look like to integrate dprint without needing any extra setup for the user of markdown-oxide. Dprint also supports other languages so that might make things more conplex.
I use deno to format markdown which i believe uses dprint under the hood. Might be able to use it as a reference.
I think this might be done better on the client side. Closing for now.