1. new table helper

    This is the new feature that produced all the troubles in the previous post.

    old solution

    Inserting a table using textile is really hard. For example, to build this table:

    problem solution cost
    I lost my keys Build a new key for each lost key, change the locks if you are paranoid a lot of money and time
    I am tired Go to bed some time

    You have to write this:

    |_. problem |_. solution |_. cost |
    | I lost my keys | Build a new key for each lost key, change the locks if you are paranoid | a lot |
    | I am tired | Go to bed | time |

    This isn’t very natural, is it ?

    new solution

    You just write

    |table_name|

    And you get a nice little table like this:

    title other title
    new value
    • a super
    • list
    • like
    • this

    Which you can edit on the page itself. To add/remove rows/columns, there are buttons on the top which appear when you hover them:

    table buttons

    To edit text, you just click on the grid:

    cell edit

    And if you want a multi-line input field, you shift-click:

    multi-line cell edit

    And you get a nice list like this when you press “ok” :

    list in cell

    align

    Did I mention that you can left-align the table using ”<.” (center wiht ”=.”, right-align with ”>.”) ?

    project start year
    zena 2005
    rubyk 2007
    |<.table_name|

    internals

    The text for the table is stored as json inside a dynamic attribute named after the table (“table_name” => “d_table_name”).

    You can display the table from another node by using:

    |345.table_name|

    PS

    For this table magic to work, make sure you load the “tablekit” and “prototype” javascript librairies:

    <r:javascripts/>

    Gaspard Bucher

    comments

    1. leave a comment