[pmwiki-users] Simple table grid with single character cells
Pico
pmwiki at ben-amotz.com
Sat Oct 21 22:09:41 CDT 2006
Pico wrote:
> Any interest in writing this, or at least giving me some hints how I
> might approach it?
>
> Disclaimer: I've never coded any php, but I can read enough to hack my
> way out of a small paper bag. Given the modest requirements set forth
> below, the code could be child's play, or fun, or both (or neither).
>
> Questions:
>
> 1. How would I code a markup rule to create a table where each cell is
> only one character (or stated conversely, where each character occupies
> its own cell)?
>
> 2. Can that code be incorporated to work with simple tables?
>
> Markup:
>
> Assume a markup delimiter of three pipes ||| to start (and end) this
> special grid-table rule. (It could be anything else, but a variation on
> existing simple table markup seems reasonably intuitive to use and code).
>
> Examples:
>
> 1. Instead of writing this (using the existing simple table markup)
>
> ||1||2||3||A||B||C||a||b||c||-||+||=||^||_||
>
> I want a new markup markup that would let me achieve the same result as
> above by simply writing the following:
>
> |||123ABCabc-+=^_|||
>
> 2. Incorporated to work with simple tables, I want to generate the same
> results as these:
>
> ||Description||1||2||3||A||B||C||a||b||c||-||+||=||^||_||
> or
> ||1||2||3||A||B||C||a||b||c||-||+||=||^||_||Description||
>
> By simply writing the following:
>
> |||123ABCabc-+=^_|||Description||
> or
> ||Description|||||123ABCabc-+=^_|||
>
Oops, too many pipes in that last one, it should have been
||Description|||123ABCabc-+=^_|||
> What do you say, any takers (or, more precisely, givers)?
>
One more thing, in case it wasn't clear: white spaces *must* count as
discrete characters, so that the table grid that would result from the
following lines of current simple table markup:
||1||+||2||+||3||+||4||+||1||+||2||+||3||+||4||+|| ||
||X|| || ||X|| || || ||X|| || ||X|| ||X|| || || ||Clave ||
|| || ||S||S|| || ||O||O|| || ||S||S|| || ||O||O||Quinto ||
||O|| || ||B||S|| || ||B||S|| || ||B||O|| ||O|| ||Conga ||
||M|| || || ||M|| || || ||M|| || ||O|| || || || ||Bombo ||
Could be generated by the following lines of proposed table grid markup:
|||1+2+3+4+1+2+3+4+||| ||
|||X X X X X |||Clave ||
||| SS OO SS OO|||Quinto ||
|||O BS BS BO O |||Conga ||
|||M M M O |||Bombo ||
(These examples illustrate a simplified hand drum notation. The
particular patterns shown are from Afro Cuban carnival rhythms called
Congas and Comparsas).
Pico
--
__ /
/ /
/___/ _/ ___/ __ /
/ / / / /
_/ _/ ____/ ____/
>>>===pmwiki at ben-amotz.com===>
More information about the pmwiki-users
mailing list