From sunaku at gmail.com Wed Sep 9 00:18:56 2009 From: sunaku at gmail.com (Suraj Kurapati) Date: Tue, 8 Sep 2009 21:18:56 -0700 Subject: tables with Unicode box drawing characters? Message-ID: Hello, I read David Wheeler's table proposal[1] for Markdown and very much agree with his conclusion and PostgreSQL-inspired proposed format. I also read the mailing list archives for 2009 but did not find any clear concesus on whether DW's format was officially accepted (I hope it is soon!). However, I want to ask: has anyone considered taking these simple ASCII table drawings to the next level of realism with Unicode box drawing characters[2]? I have long admired the w3m browser[3]'s ability to render HTML tables using Unicode box drawing characters. For example, w3m renders this[4] demo page as follows[5]: A more complex table-within-a table. An inner table showing a variety of headings and data items. ?????????????????????????????????????????????????????????????????? ? Inner Table ? ?????????????????????????????????????????????????????????????????? ? ? Head1 ? ? CORNER ?????????????????????????????????????????????? ? ? ? Head3 ? ????????????????????? Head2 ????????????????? ? Head4 ? Head5 ? ?Head6 ? ? Outer ?????????????????????????????????????????????????????????????????? Table ?A ? ? ? Lists can be table data ? Two Wide ? ? ? ? ? Images can be table data? ? ????????????? ?????????????????????????????????????????????? ? ?Two ?A Form in a table: Your age:? ? ? ? ?Tall ? [ ] ? No ?Multiple? ?HTML ? ? What is your favorite ice ?border?line ? ?Station ? ? cream? ?Little?item ? ? ? ? [Chocolate ] ?Table ? ? ? ? ? [OK] [Cancel] ? ? ? ?????????????????????????????????????????????????????????????????? What if Markdown used Unicode characters to express tables in this manner? All we need are two essential subsets of the Unicode box drawing characters: * thin ones for normal cells: ? ? ? ? ? ? * thick ones for heading cells: ? ? ? ? ? ? Thanks for your consideration. [1]: http://justatheory.com/computers/markup/markdown-table-rfc.html [2]: http://en.wikipedia.org/wiki/Box_drawing_characters [3]: http://w3m.sourceforge.net/ [4]: http://www.december.com/html/demo/table.html [5]: http://snk.tuxfamily.org/tmp/w3m-tables.png From waylan at gmail.com Wed Sep 9 00:54:53 2009 From: waylan at gmail.com (Waylan Limberg) Date: Wed, 9 Sep 2009 00:54:53 -0400 Subject: tables with Unicode box drawing characters? In-Reply-To: References: Message-ID: On Wed, Sep 9, 2009 at 12:18 AM, Suraj Kurapati wrote: > Hello, > > I read David Wheeler's table proposal[1] for Markdown and very much > agree with his conclusion and PostgreSQL-inspired proposed format. ?I > also read the mailing list archives for 2009 but did not find any > clear concesus on whether DW's format was officially accepted (I hope > it is soon!). I didn't go back and check but I think there was in a previous discussion with a similar proposal. In other words, you need to go back further in the archive. Basically, these proposals for more complex tables are outside the scope of Markdown and should be left to raw html. At least I seem to recall actual implementers leaning that direction. Of course, if someone wanted to implement David's proposal (or some variant) and users flocked to it, then the rest of us may follow suite. Until then, I'm sticking to the simple solution we have now. Hint (and shameless plug): Python-Markdown makes adding on something of the sort easy with it's extension API. Check it out here: http://www.freewisdom.org/projects/python-markdown/Writing_Extensions > What if Markdown used Unicode characters to express tables in this manner? > > All we need are two essential subsets of the Unicode box drawing characters: > * thin ones for normal cells: ? ? ? ? ? ? > * thick ones for heading cells: ? ? ? ? ? ? > The last few times someone proposed a syntax that didn't use commonly found keys on the keyboard, the proposal met with a *lot* of resistance. I suspect most users wouldn't even know how to type these characters. Another barrier is that not all implementations support Unicode (I think - at least not fully). Therefore, some implementations may never adopt such a proposal. Third, it seems like it would be an awful lot of work to build such a table. A lot more than some of the existing proposals out there. -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg From sgbotsford at gmail.com Wed Sep 9 09:32:47 2009 From: sgbotsford at gmail.com (Sherwood Botsford) Date: Wed, 9 Sep 2009 07:32:47 -0600 Subject: tables with Unicode box drawing characters? In-Reply-To: References: Message-ID: <534004cc0909090632x36d83ae5t5947165357fa2ec1@mail.gmail.com> Once it gets to table in a table, or table elements that span rows and columns, or tables that need varicoloured text, you end up with a mess that can't be done in the markdown way of "Simple to read, simple to type." The template Toolkit system uses Markedown as a plugin. So you have sections of TT cookie dough, and embedded markdown raisins in it. This made my web creation simple. TT handles the directory structure, the menu system. Markdown handles the actual content. And now that I know that Markdown treats DIV as just a word, and passes it through, I can have markdown content inside my html elements in an easy way. Markdown text is at the core a linear data format. Tables are at the core two dimensional data. Fletch and others have stretched the markdown syntax to encompass simple tables, and have done so in a way that doesn't beat the goals of markdown too much. But full table support shouldn't be in the cards. Indeed I question the use of complex tables. At some point you end up with a data set that people can't grasp. If your table is too complex or even too large to make with the tools you have now, there is merit in going back and seeing if there is a better way to present the data. Perhaps as multiple tables. Perhaps as graphs or networks. This is much on the lines of the programming dictum: If your program indents are deep enough that you are making your window wider, it's time to abstract some subroutines out of your program. One of the big issues with HTML is there is no method of abstraction. On Tue, Sep 8, 2009 at 10:54 PM, Waylan Limberg wrote: > On Wed, Sep 9, 2009 at 12:18 AM, Suraj Kurapati wrote: > > Hello, > > > > I read David Wheeler's table proposal[1] for Markdown and very much > > agree with his conclusion and PostgreSQL-inspired proposed format. I > > also read the mailing list archives for 2009 but did not find any > > clear concesus on whether DW's format was officially accepted (I hope > > it is soon!). > > I didn't go back and check but I think there was in a previous > discussion with a similar proposal. In other words, you need to go > back further in the archive. > > Basically, these proposals for more complex tables are outside the > scope of Markdown and should be left to raw html. At least I seem to > recall actual implementers leaning that direction. Of course, if > someone wanted to implement David's proposal (or some variant) and > users flocked to it, then the rest of us may follow suite. Until then, > I'm sticking to the simple solution we have now. > > Hint (and shameless plug): Python-Markdown makes adding on something > of the sort easy with it's extension API. Check it out here: > http://www.freewisdom.org/projects/python-markdown/Writing_Extensions > > > > What if Markdown used Unicode characters to express tables in this > manner? > > > > All we need are two essential subsets of the Unicode box drawing > characters: > > * thin ones for normal cells: ? ? ? ? ? ? > > * thick ones for heading cells: ? ? ? ? ? ? > > > > The last few times someone proposed a syntax that didn't use commonly > found keys on the keyboard, the proposal met with a *lot* of > resistance. I suspect most users wouldn't even know how to type these > characters. > > Another barrier is that not all implementations support Unicode (I > think - at least not fully). Therefore, some implementations may never > adopt such a proposal. > > Third, it seems like it would be an awful lot of work to build such a > table. A lot more than some of the existing proposals out there. > > -- > ---- > \X/ /-\ `/ |_ /-\ |\| > Waylan Limberg > _______________________________________________ > Markdown-Discuss mailing list > Markdown-Discuss at six.pairlist.net > http://six.pairlist.net/mailman/listinfo/markdown-discuss > -- Respectfully, Sherwood of Sherwood's Forests Sherwood Botsford Sherwood's Forests -- http://Sherwoods-Forests.com 780-848-2548 50042 Range Rd 31 Warburg, Alberta T0C 2T0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From pagaltzis at gmx.de Wed Sep 9 10:04:00 2009 From: pagaltzis at gmx.de (Aristotle Pagaltzis) Date: Wed, 9 Sep 2009 16:04:00 +0200 Subject: tables with Unicode box drawing characters? In-Reply-To: References: Message-ID: <20090909140359.GA6764@klangraum.plasmasturm.org> * Suraj Kurapati [2009-09-09 06:20]: > What if Markdown used Unicode characters to express tables > in this manner? Then I would still write my tables using HTML tags. Regards, -- Aristotle Pagaltzis // From orc at pell.chi.il.us Wed Sep 9 11:39:06 2009 From: orc at pell.chi.il.us (david parsons) Date: 9 Sep 2009 15:39:06 GMT Subject: tables with Unicode box drawing characters? References: Message-ID: In article , Suraj Kurapati wrote: > >However, I want to ask: has anyone considered taking these simple >ASCII table drawings to the next level of realism with Unicode box >drawing characters? I'm sure that somebody has, but where are you going to find a keyboard that has all of those unicode glyphs on it, or would you have to write a markdown preprocessor that takes a table made up of symbols found on a keyboard and convert it into the unicode characters? -david parsons From s at sidneysm.com Thu Sep 10 12:31:59 2009 From: s at sidneysm.com (=?ISO-8859-1?Q?Sidney_San_Mart=EDn?=) Date: Thu, 10 Sep 2009 12:31:59 -0400 Subject: tables with Unicode box drawing characters? In-Reply-To: References: Message-ID: <871221ae0909100931w5b6da2d4neec60c5a2e9d2b4a@mail.gmail.com> I believe that Suraj is proposing that Markdown implement David Wheeler's proposed table formatting and provide the option to process them into tables made up of box characters. I agree, though, that this is best left for HTML ? especially since character-based tables only render correctly with monospaced fonts. On Wed, Sep 9, 2009 at 11:39 AM, david parsons wrote: > ?I'm sure that somebody has, but where are you going to find a keyboard > ?that has all of those unicode glyphs on it From orc at pell.chi.il.us Thu Sep 10 15:47:20 2009 From: orc at pell.chi.il.us (david parsons) Date: 10 Sep 2009 19:47:20 GMT Subject: tables with Unicode box drawing characters? References: <871221ae0909100931w5b6da2d4neec60c5a2e9d2b4a@mail.gmail.com> Message-ID: In article <871221ae0909100931w5b6da2d4neec60c5a2e9d2b4a at mail.gmail.com>, =?ISO-8859-1?Q?Sidney_San_Mart=EDn?= wrote: >I believe that Suraj is proposing that Markdown implement David >Wheeler's proposed table formatting and provide the option to process >them into tables made up of box characters. That seems like it would be an extraordinarily non-markdownish thing to do; redoing markdown into a "convert to html, except for one ascii-style formating wart" doesn't seem to be particularly useful. -david "no, I don't think that's a good plan" parsons From sunaku at gmail.com Thu Sep 10 18:01:59 2009 From: sunaku at gmail.com (Suraj Kurapati) Date: Thu, 10 Sep 2009 15:01:59 -0700 Subject: tables with Unicode box drawing characters? In-Reply-To: References: Message-ID: Thanks for considering my idea and replying accordingly, everyone. I agree that having Markdown users meticulously craft tables with Unicode box drawing characters[2] is impractical. However, I am still very fond of David Wheeler's proposal[1] for Markdown tables. Are there any existing implementations of [1] at present? If not, I will try to implement it as a preprocessor (as Waylan Limberg suggested) so that it can be used with any Markdown implementation: cat document.md | dw_md_tables | markdown > document.html Thanks for your consideration. [1]: http://justatheory.com/computers/markup/markdown-table-rfc.html [2]: http://en.wikipedia.org/wiki/Box_drawing_characters From public at quillio.com Thu Sep 10 19:43:02 2009 From: public at quillio.com (Lou Quillio) Date: Thu, 10 Sep 2009 19:43:02 -0400 Subject: tables with Unicode box drawing characters? In-Reply-To: References: Message-ID: > However, I am still very fond of David Wheeler's proposal[1] for > Markdown tables. ?Are there any existing implementations of [1] at > present? ?If not, I will try to implement it as a preprocessor (as > Waylan Limberg suggested) so that it can be used with any Markdown > implementation: If I understand the need, wouldn't an HTML-tables->box-drawing-characters transformer -- implemented as a post-processor in a Markdown stack -- be more straightforward, remove any Markdown dependency and address more use cases? I can imagine a wrapper element option, etc. (
, for example).

There may be abusable code in projects like ELinks.

http://en.wikipedia.org/wiki/ELinks

LQ

From jgm at berkeley.edu  Fri Sep 11 23:30:44 2009
From: jgm at berkeley.edu (John MacFarlane)
Date: Fri, 11 Sep 2009 20:30:44 -0700
Subject: lunamark - markdown in lua using a PEG grammar
Message-ID: <20090912033043.GA1240@protagoras.phil.berkeley.edu>

Markersdown:

I was fooling around with lua and decided to write a markdown parser
using the terrific lpeg library.  Here's the result:
http://github.com/jgm/lunamark/tree/master

There are already two markdown libraries for lua, one a native lua
implementation based on global substitutions, the other a binding
to discount.  What makes lunamark different is that it is based
on a PEG grammar (adapted from my peg-markdown).  This can be found
in the file lunamark/markdown_parser.lua in the source tree.

Lunamark converts standard markdown to HTML and LaTeX.  Adding
a new output format is easy (the LaTeX writer took about 20 minutes
to add).  It is also possible to add new input formats.

Lunamark passes the Markdown 1.0.3 test suite (except for one edge
case involving loose/tight lists, and here its behavior is consistent
with the markdown syntax description -- see the README for peg-markdown
for discussion).

As for performance, lunamark is about the same speed as PHP Markdown in
my tests.

John


From qaramazov at gmail.com  Sat Sep 12 03:20:48 2009
From: qaramazov at gmail.com (Yuri Takhteyev)
Date: Sat, 12 Sep 2009 03:20:48 -0400
Subject: lunamark - markdown in lua using a PEG grammar
In-Reply-To: <20090912033043.GA1240@protagoras.phil.berkeley.edu>
References: <20090912033043.GA1240@protagoras.phil.berkeley.edu>
Message-ID: 

> As for performance, lunamark is about the same speed as PHP Markdown in
> my tests.

Is this with or without counting the time necessary to read the input?
On my test, reading a wiki page of 500 words _once_ and then
converting it 1000 times, lunamark is actually about 2.5 times faster
than PHP Markdown.

But perhaps a comparison with the other two Lua options is more
relevant. On the same benchmark, lunamark is 5-6 times faster than
markdown.lua and 12-13 times slower than lua-discount. (Of course,
lua-discount is basically a binding to a C implementation.)

- yuri

From jgm at berkeley.edu  Sat Sep 12 13:25:02 2009
From: jgm at berkeley.edu (John MacFarlane)
Date: Sat, 12 Sep 2009 10:25:02 -0700
Subject: lunamark - markdown in lua using a PEG grammar
In-Reply-To: 
References: <20090912033043.GA1240@protagoras.phil.berkeley.edu>
	
Message-ID: <20090912172502.GC7239@protagoras.phil.berkeley.edu>

+++ Yuri Takhteyev [Sep 12 09 03:20 ]:
> > As for performance, lunamark is about the same speed as PHP Markdown in
> > my tests.
> 
> Is this with or without counting the time necessary to read the input?
> On my test, reading a wiki page of 500 words _once_ and then
> converting it 1000 times, lunamark is actually about 2.5 times faster
> than PHP Markdown.

That's nice to hear. My tests included reading the input, and also
expanding tabs, since PHP markdown does that. (But lunamark can
handle input with unexpanded tabs, so expanding tabs is not really
necessary.)

> But perhaps a comparison with the other two Lua options is more
> relevant. On the same benchmark, lunamark is 5-6 times faster than
> markdown.lua and 12-13 times slower than lua-discount. (Of course,
> lua-discount is basically a binding to a C implementation.)

That's about what I found too.  discount is incredibly fast.
But the lunamark code is about 10x shorter, and should be easier
to extend and revise.  It is also very portable, since both lua
and the lpeg library are written in ANSI C. So it might be useful for
some people.

John

From jerry at ieee.org  Tue Sep 22 12:42:00 2009
From: jerry at ieee.org (Jerry Krinock)
Date: Tue, 22 Sep 2009 09:42:00 -0700
Subject: Scripting: Invoke Markdown *before* SmartyPants
Message-ID: <9B8A258A-6C11-4CD6-833B-5A9BB0BA0779@ieee.org>

I could not find anywhere in John Gruber's documentation the  
recommended order of Markdown vs. SmartyPants in a scripted process.   
I guessed SmartyPants first, and that worked until I tried to encode a  
link with a title like this:

    An [example](http://url.com/ "Title")

SmartyPants encoded the quotes, which created a mess.

So, I changed the order to process text through Markdown first, then  
SmartyPants.  So far, so good.


From public at quillio.com  Tue Sep 22 13:16:57 2009
From: public at quillio.com (Lou Quillio)
Date: Tue, 22 Sep 2009 13:16:57 -0400
Subject: Scripting: Invoke Markdown *before* SmartyPants
In-Reply-To: <9B8A258A-6C11-4CD6-833B-5A9BB0BA0779@ieee.org>
References: <9B8A258A-6C11-4CD6-833B-5A9BB0BA0779@ieee.org>
Message-ID: 

On Tue, Sep 22, 2009 at 12:42 PM, Jerry Krinock  wrote:
> So, I changed the order to process text through Markdown first, then
> SmartyPants. ?So far, so good.

That's what you want. Also, Smartypants won't reach into 
,
,