From: smcv Date: Wed, 23 Jul 2014 19:40:08 +0000 (-0400) Subject: syntax seems weird, thoughts on an alternative X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/commitdiff_plain/534797d71997be4f37bf4946e7e8c351ea0d9706?hp=93ecef216707bbcc23bbbbfc57a25052139d850c syntax seems weird, thoughts on an alternative --- diff --git a/doc/todo/support_multi-row_table_headers.mdwn b/doc/todo/support_multi-row_table_headers.mdwn index 3543eef7d..2b22d5d3e 100644 --- a/doc/todo/support_multi-row_table_headers.mdwn +++ b/doc/todo/support_multi-row_table_headers.mdwn @@ -11,3 +11,48 @@ It would be great if it were possible to support multi-row table headers in the -- [[Jon]] [[!tag wishlist patch]] + +> This seems like weird overloading of the header parameter - it's +> table data, except when it isn't. Perhaps +> something like this would be easier to use in practice? +> (and also more featureful :-) ) +> +> \[[!table header="2 rows 1 column" data=""" +> Name | Platform || +> | Windows | Mac | Linux +> ikiwiki | no | yes | yes +> Starcraft | yes | yes | via Wine +> """]] +> +> intended to be rendered like +> +> +> +> +> +> +>
NamePlatform
WindowsMacLinux
ikiwikinoyesyes
Starcraftyesyesvia Wine
+> +> (Deliberately switching to plain-text to make it more obvious +> what's a `` and what's ``.) +> +> Vague pseudocode for parsing `headers` +> (possibly even valid Perl, I'm not sure): +> +> my ($header_rows, $header_cols); +> while ($header =~ s/(\d*)\W*(\w+)//) { +> my $n = ($1 or 0); +> my $what = $2; +> if ($what =~ m/rows?/) { +> $header_rows = $n; +> } +> elif ($what =~ m/col(?:umn)?s?/) { +> $header_cols = $n; +> } +> } +> +> and it would even be fairly easy to extend to support +> `(first|last|)\W*(\d*)\W*(\w+)` later, e.g. +> `header="1 row, first 2 cols, last column"`. +> +> --[[smcv]]