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

Feature request: handle RestructuredText & Markdown according to spec #32

Open
bendavis78 opened this issue May 20, 2014 · 0 comments
Open

Comments

@bendavis78
Copy link

I still find it somewhat difficult to use vim-tabular when creating Markdown tables, and especially with RestructuredText tables. The main problem, I think, is how to handle the "separator rows". Each form has its own quirks. I imagine most of the code for making this work in is there, but I'm not sure.

In RST, you make a table like so:

+------------+----------+----------+ 
| Header 1   | Header 2 | Header 3 | 
+============+==========+==========+ 
| body row 1 | column 2 | column 3 | 
+------------+----------+----------+ 
| body row 2 | column 2 | column 3 | 
+------------+----------+----------+ 

In this case, using :Tabularize /[|+] seems to work ok, but the --- and === rows do not get filled in.

The alter form for RST is like so:

Header 1    Header 2  Header 3  
=========== ========= =========
body row 1  column 2  column 3  
body row 2  column 2  column 3  

The issue here is that columns are determined by the === header row, not the content of the columns themselves. In both cases column width is determined by the header rows.

In markdown tables are done like so:

| Header 1   | Header 2   | Header 3  | 
|============|============|===========|
| body row 1 | column 2   | column 3  | 
| body row 2 | column 2   | column 3  | 

Running `:Tabularize /| works well enough, but again the header separator does not get filled out.

Is there a solution to handle these cases already, or would it be a lot of work to build in add-ons for these special table syntaxes?

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

1 participant