Feature: reformat Markdown tables

Bug #1086388 reported by joede
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
UberWriter (moved to github!)
In Progress
Wishlist
Unassigned

Bug Description

The markdown syntax for tables is really simply. Drawing this tables with a normal editor like Uberwriter is painful. So it would be very helpfull to have command to reformat an new/changed table.

For *grid tables*, the reformatting could look like this.

Before:

+--+--+--+
|head left | head centered | head right|
+==+==+==+
|lolng entry | line 1 | line 1|
+--+--+--+
|line 2 | line 2 | line 2 |
+--+--+--+

After reformatting:

+---------------+-----------------+-------------+
|head left | head centered | Kopf rechts|
+===============+=================+=============+
|longer entry | line 1 | line 1|
+---------------+-----------------+-------------+
|line 2 | line 2 | line 2|
+---------------+-----------------+-------------+

As you can see, the alignment is defined by the header. Each column is aligned as expected. The width of the columns is detemined automatically.

Other feature could be the creation of a new table based on the current line (or selection). If the current line is the header of an table, the *create* functions expand this into an full mardown table.

|head left | head centered | head right|

will be expanded to

+----------+-----------------+-----------+
|head left | head centered | head right|
+----------+-----------------+-----------+
| | | |
+==========+=================+===========+

In my personal opinion, the *simple table* syntax is much more handy but harder to parse. IMO reformatting is possible with both of these table declarations. ;-)

Tags: wish
Revision history for this message
Wolf Vollprecht (w-vollprecht) wrote :

Hi Joede,

in the development version of uberwriter is already such a feature.

However, in the RST-markup you're using, there is no possibility of having a right or center aligned cell... It's a limitation by pandoc as far as I know.

The last bug in the dev version is that it can't handle multiline cells and a lot of other things, eg cells that span multiple rows or columns.

As you can guess, there is quite a number of "cases" to handle :(

Changed in uberwriter:
importance: Undecided → Wishlist
status: New → In Progress
Revision history for this message
joede (joerg-desch) wrote :

I've checked this and simple tables are working with alignment while grid tables will not. Dan't ask me why. I've not recognized this because I prefer the *simple table* style. ;-)

Never the less even simple tables are easy to parse since they are delimited by blank lines. So while to cursor must be inside a table, Uberwriter must search for blank lines above and below the current line. To be recognized as a simple table, the second line of the found block must consist of dashes and blanks. The colums are separated by two or more blanks.

The only thing I currently don't know is, how to display a (aligned) table with an proportional font. Since the header is responsable for the alignment, the body of the table may could be realised with tabs?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.