[prev in list] [next in list] [prev in thread] [next in thread]
List: perl5-porters
Subject: Re: Pre-RFC: tables in Pod
From: Yuki Kimoto <kimoto.yuki () gmail ! com>
Date: 2022-06-29 6:39:12
Message-ID: CAExogxM8sxsR0wRQ0S4SO37Ra3Mv-Lb6H-=EewxvghtxYUTR6w () mail ! gmail ! com
[Download RAW message or body]
2021-11-16 10:42 Tomasz Konojacki <me@xenu.pl> wrote:
> Tables are one of the most frequently requested features for Pod.
>
> There's some prior art in PseudoPod[1] and Pod6[2], but I dislike them
> both. PseudoPod's table syntax is way too verbose, while Pod6 is too
> complicated and whitespace sensitive.
>
> I came up the following syntax:
>
> =begin table
>
> table specification
>
> =end table
>
> The table specification syntax is based on GitHub Markdown with some
> extensions (most notably rowspan and colspan). Please read its
> documentation first:
>
>
> https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables
>
> Using Pod formatting codes (e.g. B<foo>) is allowed inside tables.
>
> Since this is just an elevator pitch, instead of writing a full
> specification, I will just show a few examples:
>
> ------------------------------------------------------------------------
>
> Basic table. Leading and terminating pipes are optional.
>
> Input:
>
> > foo | bar | baz |
> > oof | rab | zab |
>
> Output:
>
> +-----------------+
> > foo | bar | baz |
> +-----------------+
> > oof | rab | zab |
> +------------------
>
> ------------------------------------------------------------------------
>
> Table with headers. The "header2" column is right-aligned. In GitHub
> headers are required, in this specification they will be optional (as
> you've seen in the previous example).
>
> Input:
>
> > header1 | header2 | header3 |
> > --- | ---: | --- |
> > abc | def | ghi |
>
> Output (it's hard to show in plain text, but the first row will be
> rendered as <thead> in HTML):
>
> +-----------------------------+
> > header1 | header2 | header3 |
> +-----------------------------+
> > abc | def | ghi |
> +-----------------------------+
>
> ------------------------------------------------------------------------
>
> "-" merges with the previous cell horizontally (cellspan); "^",
> vertically (rowspan). They can be escaped with E<> or a backslash.
> GitHub Markdown doesn't have this feature.
>
> Input:
>
> > foo | - | baz |
> > ^ | - | zab |
>
> Output:
>
> +-----------------+
> > foo | baz |
> + +-----+
> > > zab |
> +------------------
>
> ------------------------------------------------------------------------
>
> [1] -
> https://metacpan.org/dist/Pod-PseudoPod/view/lib/Pod/PseudoPod/Tutorial.pod#Tables
> [2] - https://docs.raku.org/language/tables
I'm interested in tables in POD because I use tables in POD in SPVM
documentation.
What I only need is the expression of <th> tag in any position.
=begin table
|H<head>|H<head>|
|item|item|
|item|item|
=end table
=begin table
|H<head>|item|
|H<head>|item|
|H<head>|item|
=end table
I also hope the feature of tables in POD is implemented.
[Attachment #3 (text/html)]
<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div \
dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" \
class="gmail_attr">2021-11-16 10:42 Tomasz Konojacki <<a \
href="mailto:me@xenu.pl">me@xenu.pl</a>> wrote:<br></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid \
rgb(204,204,204);padding-left:1ex">Tables are one of the most frequently requested \
features for Pod. <br> <br>
There's some prior art in PseudoPod[1] and Pod6[2], but I dislike them<br>
both. PseudoPod's table syntax is way too verbose, while Pod6 is too<br>
complicated and whitespace sensitive.<br>
<br>
I came up the following syntax:<br>
<br>
=begin table<br>
<br>
table specification<br>
<br>
=end table<br>
<br>
The table specification syntax is based on GitHub Markdown with some<br>
extensions (most notably rowspan and colspan). Please read its<br>
documentation first:<br>
<br>
<a href="https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables" \
rel="noreferrer" target="_blank">https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables</a><br>
<br>
Using Pod formatting codes (e.g. B<foo>) is allowed inside tables.<br>
<br>
Since this is just an elevator pitch, instead of writing a full<br>
specification, I will just show a few examples:<br>
<br>
------------------------------------------------------------------------<br>
<br>
Basic table. Leading and terminating pipes are optional.<br>
<br>
Input:<br>
<br>
> foo | bar | baz |<br>
> oof | rab | zab |<br>
<br>
Output:<br>
<br>
+-----------------+<br>
> foo | bar | baz |<br>
+-----------------+<br>
> oof | rab | zab |<br>
+------------------<br>
<br>
------------------------------------------------------------------------<br>
<br>
Table with headers. The "header2" column is right-aligned. In GitHub<br>
headers are required, in this specification they will be optional (as<br>
you've seen in the previous example).<br>
<br>
Input:<br>
<br>
> header1 | header2 | header3 |<br>
> --- | ---: | --- |<br>
> abc | def | ghi |<br>
<br>
Output (it's hard to show in plain text, but the first row will be<br>
rendered as <thead> in HTML):<br>
<br>
+-----------------------------+<br>
> header1 | header2 | header3 |<br>
+-----------------------------+<br>
> abc | def | ghi |<br>
+-----------------------------+<br>
<br>
------------------------------------------------------------------------<br>
<br>
"-" merges with the previous cell horizontally (cellspan); \
"^",<br> vertically (rowspan). They can be escaped with E<> or a \
backslash.<br> GitHub Markdown doesn't have this feature.<br>
<br>
Input:<br>
<br>
> foo | - | baz |<br>
> ^ | - | zab |<br>
<br>
Output:<br>
<br>
+-----------------+<br>
> foo | baz |<br>
+ +-----+<br>
> > zab |<br>
+------------------<br>
<br>
------------------------------------------------------------------------<br>
<br>
[1] - <a href="https://metacpan.org/dist/Pod-PseudoPod/view/lib/Pod/PseudoPod/Tutorial.pod#Tables" \
rel="noreferrer" target="_blank">https://metacpan.org/dist/Pod-PseudoPod/view/lib/Pod/PseudoPod/Tutorial.pod#Tables</a><br>
[2] - <a href="https://docs.raku.org/language/tables" rel="noreferrer" \
target="_blank">https://docs.raku.org/language/tables</a></blockquote><div><br></div><div>I'm \
interested in tables in POD because I use tables in POD in SPVM \
documentation.</div><div><br></div><div>What I only need is the expression of \
<th> tag in any position.</div><div><br></div><div><div> =begin \
table</div><div><br></div><div> |H<head>|H<head>|</div><div> \
|item|item|</div><div> |item|item|</div><div><br></div><div> =end \
table</div><div><br></div><div> =begin table</div><div><br></div><div> \
|H<head>|item|</div><div> |H<head>|item|</div><div> \
|H<head>|item|</div><div><br></div><div> =end table</div></div><div> \
<br></div><div>I also hope the feature of tables in POD is \
implemented.</div><div><br></div></div></div></div></div></div></div></div></div></div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic