From t_leitner at gmx.at Thu Jan 14 03:54:28 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Thu, 14 Jan 2010 09:54:28 +0100 Subject: [kramdown-users] Table syntax and implementation Message-ID: <20100114095428.5f748e62@noeato.mat.univie.ac.at> Hi everybody, I have updated the table syntax documentation again, added the quick reference section on tables and implemented the current spec. The latest version of the syntax spec and implementation is available on github for comments et al. The release of kramdown 0.4.0 will happen at the end of next week (~23.01.10). -- Thomas From sunshine at sunshineco.com Thu Jan 14 04:58:30 2010 From: sunshine at sunshineco.com (Eric Sunshine) Date: Thu, 14 Jan 2010 04:58:30 -0500 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100114095428.5f748e62@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> Message-ID: <4B4EEAC6.4080601@sunshineco.com> Hi Thomas, On 1/14/2010 3:54 AM, Thomas Leitner wrote: > I have updated the table syntax documentation again, added the quick > reference section on tables and implemented the current spec. Minor comment regarding syntax.page where it says: "The colons of an alignment definition are used to set the alignment of a column: if there are no colons, the column uses the default alignment [...] If a header separator line does not contain alignment definitions for one or more columns, all unspecified columns will use the default alignment." This bit of redundancy is, um, redundant. In your example table, you show a header separator: "|-------|:-------|:-------:|------:-|" Is this accurate? Should the final colon really be followed by a dash? -- ES From t_leitner at gmx.at Thu Jan 14 06:08:28 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Thu, 14 Jan 2010 12:08:28 +0100 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <4B4EEAC6.4080601@sunshineco.com> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <4B4EEAC6.4080601@sunshineco.com> Message-ID: <20100114120828.2addc87c@noeato.mat.univie.ac.at> > Minor comment regarding syntax.page where it says: > > "The colons of an alignment definition are used to set the alignment > of a column: if there are no colons, the column uses the default > alignment [...] If a header separator line does not contain alignment > definitions for one or more columns, all unspecified columns will use > the default alignment." > > This bit of redundancy is, um, redundant. Thanks ;-) > In your example table, you show a header separator: > > "|-------|:-------|:-------:|------:-|" > > Is this accurate? Should the final colon really be followed by a dash? No, that's an error, there must not be dash after the final colon - will fix this. Best regards, Thomas From svicalifornia at gmail.com Thu Jan 14 06:43:00 2010 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Thu, 14 Jan 2010 18:43:00 +0700 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100114095428.5f748e62@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> Message-ID: <20100114184300800688.e5d5a655@gmail.com> > * kramdown tables do not need to have a table header. Just checking something: If the table has a separator line after any table rows, then that separator is a header separator, correct? And then all rows above it would be header rows, right? | List | ... | of | ... | Things | ... |--- | More | ... | Things | ... | Here | ... The above example will not be a table of two tbody elements, but a table with three header rows (in a thead) and three regular body rows (in a tbody), right? Shawn On Thu, 14 Jan 2010 09:54:28 +0100, Thomas Leitner wrote: > Hi everybody, > > I have updated the table syntax documentation again, added the quick > reference section on tables and implemented the current spec. The > latest version of the syntax spec and implementation is available on > github for comments et al. > > The release of kramdown 0.4.0 will happen at the end of next week > (~23.01.10). > > -- Thomas > _______________________________________________ > kramdown-users mailing list > kramdown-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/kramdown-users From t_leitner at gmx.at Thu Jan 14 08:42:45 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Thu, 14 Jan 2010 14:42:45 +0100 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100114184300800688.e5d5a655@gmail.com> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> Message-ID: <20100114144245.49ba1a70@noeato.mat.univie.ac.at> On Thu, 14 Jan 2010 18:43:00 +0700, Shawn Van Ittersum wrote: > > * kramdown tables do not need to have a table header. > > Just checking something: If the table has a separator line after any > table rows, then that separator is a header separator, correct? And > then all rows above it would be header rows, right? > > | List | ... > | of | ... > | Things | ... > |--- > | More | ... > | Things | ... > | Here | ... > > The above example will not be a table of two tbody elements, but a > table with three header rows (in a thead) and three regular body rows > (in a tbody), right? Yes, that's correct. -- Thomas From t_leitner at gmx.at Fri Jan 15 09:43:18 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 15 Jan 2010 15:43:18 +0100 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100114144245.49ba1a70@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> Message-ID: <20100115154318.34b5ab60@noeato.mat.univie.ac.at> On Thu, 14 Jan 2010 14:42:45 +0100, Thomas Leitner wrote: > On Thu, 14 Jan 2010 18:43:00 +0700, Shawn Van Ittersum wrote: > > > * kramdown tables do not need to have a table header. > > > > Just checking something: If the table has a separator line after > > any table rows, then that separator is a header separator, > > correct? And then all rows above it would be header rows, right? > > > > | List | ... > > | of | ... > > | Things | ... > > |--- > > | More | ... > > | Things | ... > > | Here | ... > > > > The above example will not be a table of two tbody elements, but a > > table with three header rows (in a thead) and three regular body > > rows (in a tbody), right? > > Yes, that's correct. To be more specific: Your example table will have three header and three body rows. However, since separator lines are *not* a subset of header lines and neither the other way round, it is possible to create a table with two table bodies but no table header, for example: | Body 1 | row 1 | | Body 1 | row 2 | |-------|||------| | Body 2 | row 1 | | Body 2 | row 2 | -- Thomas From svicalifornia at gmail.com Fri Jan 15 16:56:35 2010 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Sat, 16 Jan 2010 04:56:35 +0700 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100115154318.34b5ab60@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> Message-ID: <513F46E9-EE9F-4F24-B726-1AEF18C1A3B4@gmail.com> Shawn [sent from mobile phone] On Jan 15, 2010, at 9:43 PM, Thomas Leitner wrote: > On Thu, 14 Jan 2010 14:42:45 +0100, Thomas Leitner wrote: >> On Thu, 14 Jan 2010 18:43:00 +0700, Shawn Van Ittersum wrote: >>>> * kramdown tables do not need to have a table header. >>> >>> Just checking something: If the table has a separator line after >>> any table rows, then that separator is a header separator, >>> correct? And then all rows above it would be header rows, right? >>> >>> | List | ... >>> | of | ... >>> | Things | ... >>> |--- >>> | More | ... >>> | Things | ... >>> | Here | ... >>> >>> The above example will not be a table of two tbody elements, but a >>> table with three header rows (in a thead) and three regular body >>> rows (in a tbody), right? >> >> Yes, that's correct. > > To be more specific: Your example table will have three header and > three body rows. However, since separator lines are *not* a subset of > header lines and neither the other way round, it is possible to > create a > table with two table bodies but no table header, for example: > > | Body 1 | row 1 | > | Body 1 | row 2 | > |-------|||------| > | Body 2 | row 1 | > | Body 2 | row 2 | > > -- Thomas > _______________________________________________ > kramdown-users mailing list > kramdown-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/kramdown-users From svicalifornia at gmail.com Fri Jan 15 16:58:13 2010 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Sat, 16 Jan 2010 04:58:13 +0700 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100115154318.34b5ab60@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> Message-ID: <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> Hi Thomas, I don't understand the differenc between your example and mine. Please explain what makes kramdown interpret the separator as a header separator. Shawn [sent from mobile phone] On Jan 15, 2010, at 9:43 PM, Thomas Leitner wrote: > On Thu, 14 Jan 2010 14:42:45 +0100, Thomas Leitner wrote: >> On Thu, 14 Jan 2010 18:43:00 +0700, Shawn Van Ittersum wrote: >>>> * kramdown tables do not need to have a table header. >>> >>> Just checking something: If the table has a separator line after >>> any table rows, then that separator is a header separator, >>> correct? And then all rows above it would be header rows, right? >>> >>> | List | ... >>> | of | ... >>> | Things | ... >>> |--- >>> | More | ... >>> | Things | ... >>> | Here | ... >>> >>> The above example will not be a table of two tbody elements, but a >>> table with three header rows (in a thead) and three regular body >>> rows (in a tbody), right? >> >> Yes, that's correct. > > To be more specific: Your example table will have three header and > three body rows. However, since separator lines are *not* a subset of > header lines and neither the other way round, it is possible to > create a > table with two table bodies but no table header, for example: > > | Body 1 | row 1 | > | Body 1 | row 2 | > |-------|||------| > | Body 2 | row 1 | > | Body 2 | row 2 | > > -- Thomas > _______________________________________________ > kramdown-users mailing list > kramdown-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/kramdown-users From t_leitner at gmx.at Sat Jan 16 02:12:41 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Sat, 16 Jan 2010 08:12:41 +0100 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> Message-ID: <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> On Sat, 16 Jan 2010 04:58:13 +0700, Shawn Van Ittersum wrote: > Hi Thomas, > > I don't understand the differenc between your example and mine. > Please explain what makes kramdown interpret the separator as a > header separator. The syntax of a header separator line requires that there is at least one dash between two pipes whereas the normal separator line just requires a pipe/plus and a dash at the beginning of the line and then any combination of pipes, dashes and pluses. Therefore header separator lines and normal separator lines share a common subset but none is a real subset of the other. Examples: The following is a header line as well as a separator line: |----|----| Only a header line (because of the colons): |:--:|:---| Only a separator line (because of consecutive pluses/pipes): |----+|+----| -- Thomas From svicalifornia at gmail.com Sat Jan 16 06:57:22 2010 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Sat, 16 Jan 2010 18:57:22 +0700 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> Message-ID: <20100116185722190665.dfe43aea@gmail.com> So: |- separator line |-| header separator line |--|| separator line |-:|-| header separator line Am I the only one that finds this confusing? Can we please just have one kind of separator line? Shawn On Sat, 16 Jan 2010 08:12:41 +0100, Thomas Leitner wrote: > On Sat, 16 Jan 2010 04:58:13 +0700, Shawn Van Ittersum wrote: >> Hi Thomas, >> >> I don't understand the differenc between your example and mine. >> Please explain what makes kramdown interpret the separator as a >> header separator. > > The syntax of a header separator line requires that there is at least > one dash between two pipes whereas the normal separator line just > requires a pipe/plus and a dash at the beginning of the line and then > any combination of pipes, dashes and pluses. Therefore header separator > lines and normal separator lines share a common subset but none is a > real subset of the other. > > Examples: > > The following is a header line as well as a separator line: > > |----|----| > > Only a header line (because of the colons): > > |:--:|:---| > > Only a separator line (because of consecutive pluses/pipes): > > |----+|+----| > > -- Thomas > _______________________________________________ > kramdown-users mailing list > kramdown-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/kramdown-users From t_leitner at gmx.at Sun Jan 17 05:51:45 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 17 Jan 2010 11:51:45 +0100 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100116185722190665.dfe43aea@gmail.com> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> <20100116185722190665.dfe43aea@gmail.com> Message-ID: <20100117115145.3909fc20@noeato.mat.univie.ac.at> On Sat, 16 Jan 2010 18:57:22 +0700, Shawn Van Ittersum wrote: > So: > > |- separator line > |-| header separator line > |--|| separator line > |-:|-| header separator line > > Am I the only one that finds this confusing? > > Can we please just have one kind of separator line? I think it would be sufficient to make header separator lines a subset of separator lines by allowing a separator line to start with a pipe and then any of dash|pipe|plus|space|colon. Additionally, I would define the header separator line as the first encountered separator line (before a footer separator line, naturally) and this first separator line can be specially structured to support aligning columns (i.e. the current syntax for header separator lines is used for determining column alignments). Would this be less confusing? Comments/suggestions? -- Thomas From sunshine at sunshineco.com Sun Jan 17 08:16:37 2010 From: sunshine at sunshineco.com (Eric Sunshine) Date: Sun, 17 Jan 2010 08:16:37 -0500 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100117115145.3909fc20@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> <20100116185722190665.dfe43aea@gmail.com> <20100117115145.3909fc20@noeato.mat.univie.ac.at> Message-ID: <4B530DB5.50406@sunshineco.com> Wouldn't it be simplest just to use the single straight-forward rule that any rows before the first separator are headers? In other words, this table has a header: | header1 | header2 | |- | data1 | data2 | whereas, this one does not: |- | data1 | data2 | (Another way to look at the above table is that it has a null header because no lines are present before the first separator line.) -- ES On 1/17/2010 5:51 AM, Thomas Leitner wrote: > On Sat, 16 Jan 2010 18:57:22 +0700, Shawn Van Ittersum wrote: >> So: >> >> |- separator line >> |-| header separator line >> |--|| separator line >> |-:|-| header separator line >> >> Am I the only one that finds this confusing? >> >> Can we please just have one kind of separator line? > > I think it would be sufficient to make header separator lines a subset > of separator lines by allowing a separator line to start with a pipe > and then any of dash|pipe|plus|space|colon. > > Additionally, I would define the header separator line as the first > encountered separator line (before a footer separator line, naturally) > and this first separator line can be specially structured to support > aligning columns (i.e. the current syntax for header separator lines is > used for determining column alignments). > > Would this be less confusing? Comments/suggestions? > > -- Thomas > _______________________________________________ > kramdown-users mailing list > kramdown-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/kramdown-users > From t_leitner at gmx.at Sun Jan 17 10:02:54 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Sun, 17 Jan 2010 16:02:54 +0100 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <4B530DB5.50406@sunshineco.com> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> <20100116185722190665.dfe43aea@gmail.com> <20100117115145.3909fc20@noeato.mat.univie.ac.at> <4B530DB5.50406@sunshineco.com> Message-ID: <20100117160254.44f8c689@noeato.mat.univie.ac.at> On Sun, 17 Jan 2010 08:16:37 -0500, Eric Sunshine wrote: > Wouldn't it be simplest just to use the single straight-forward rule > that any rows before the first separator are headers? In other words, > this table has a header: > > | header1 | header2 | > |- > | data1 | data2 | > > whereas, this one does not: > > |- > | data1 | data2 | > > (Another way to look at the above table is that it has a null header > because no lines are present before the first separator line.) I don't find this very intuitive, for example, when presented with the following table I would assume that it has one header row and two body rows: |------+-------| | Cell | Two | |------+-------| | Body | Body | | Body | Body | |------+-------| I think it makes more sense that the first separator line that appears *after at least one table row* is interpreted as header separator line. -- Thomas From svicalifornia at gmail.com Sun Jan 17 11:38:09 2010 From: svicalifornia at gmail.com (Shawn Van Ittersum) Date: Sun, 17 Jan 2010 23:38:09 +0700 Subject: [kramdown-users] Table syntax and implementation In-Reply-To: <20100117160254.44f8c689@noeato.mat.univie.ac.at> References: <20100114095428.5f748e62@noeato.mat.univie.ac.at> <20100114184300800688.e5d5a655@gmail.com> <20100114144245.49ba1a70@noeato.mat.univie.ac.at> <20100115154318.34b5ab60@noeato.mat.univie.ac.at> <8B4F6B7F-98AC-4F05-8F18-87D4765968AD@gmail.com> <20100116081241.7d63b8e4@noeato.mat.univie.ac.at> <20100116185722190665.dfe43aea@gmail.com> <20100117115145.3909fc20@noeato.mat.univie.ac.at> <4B530DB5.50406@sunshineco.com> <20100117160254.44f8c689@noeato.mat.univie.ac.at> Message-ID: <20100117233809052115.40129470@gmail.com> Agreed. :) Thanks, Shawn On Sun, 17 Jan 2010 16:02:54 +0100, Thomas Leitner wrote: > On Sun, 17 Jan 2010 08:16:37 -0500, Eric Sunshine wrote: >> Wouldn't it be simplest just to use the single straight-forward rule >> that any rows before the first separator are headers? In other words, >> this table has a header: >> >> | header1 | header2 | >> |- >> | data1 | data2 | >> >> whereas, this one does not: >> >> |- >> | data1 | data2 | >> >> (Another way to look at the above table is that it has a null header >> because no lines are present before the first separator line.) > > I don't find this very intuitive, for example, when presented with the > following table I would assume that it has one header row and two body > rows: > > |------+-------| > | Cell | Two | > |------+-------| > | Body | Body | > | Body | Body | > |------+-------| > > I think it makes more sense that the first separator line that > appears *after at least one table row* is interpreted as header > separator line. > > -- Thomas > _______________________________________________ > kramdown-users mailing list > kramdown-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/kramdown-users From t_leitner at gmx.at Fri Jan 22 11:49:27 2010 From: t_leitner at gmx.at (Thomas Leitner) Date: Fri, 22 Jan 2010 17:49:27 +0100 Subject: [kramdown-users] [ANN] kramdown 0.4.0 released Message-ID: <20100122174927.75d9c9ce@noeato> ## About kramdown kramdown (sic, not Kramdown or KramDown, just kramdown) is a *free* GPL-licensed [Ruby](http://www.ruby-lang.org) library for parsing a superset of Markdown. It is completely written in Ruby, supports standard Markdown (with some minor modifications) and various extensions that have been made popular by the [PHP Markdown Extra] package and [Maruku]. Homepage for installation instructions and documentation: http://kramdown.rubyforge.org ## kramdown 0.4.0 released This release features the addition of a [simple table syntax][1] and [syntax highlighting][2] of code blocks. I think that with these two additions kramdown now supports all the major features regarding parsing and HTML output that Maruku supports. Regarding speed: Simple benchmarks using the Markdown README file (can be found inside [this zip file][3]) show that kramdown is currently faster than, for example, the original Markdown.pl, PHP Markdown, PHP Markdown Extra, Python Markdown and Maruku. ## Changes * Major changes: - Added [syntax][1] for simple tables - Added optional [syntax highlighting][2] of code blocks through the CodeRay library * Minor changes: - Changed CSS class name `kramdown-footnotes` to `footnotes` for better compatibility * Bug fixes: - Regular expression for matching escaped characters now works correctly [1]: http://kramdown.rubyforge.org/syntax.html#tables [2]: http://kramdown.rubyforge.org/syntax.html#syntax-highlighting [3]: http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip