Johan Sundström wrote:
> On 12/21/06, David Huynh <[EMAIL PROTECTED]> wrote:
>   
>> Dear Exhibit-ers,
>>
>> I'm experimenting with extending Exhibit's Expression language to make
>> it support more spreadsheet functionality. For example, the Presidents
>> example
>>
>>     http://simile.mit.edu/exhibit/examples/presidents/presidents.html
>>
>> now has a new column called "days in office" that is calculated by
>> summing up the durations of the presidencies of each president, as seen
>> in the specification of the tabular view:
>>
>>     add(foreach(.presidency, date-range(.inDate, .outDate, 'day')))
>>
>> Comments are greatly appreciated. Thanks,
>>     
>
> I'd like string concatenation in there somehow, either (preferred) as
> infix operators:
>
> <a ex:href-content="'/presidents/' + .label + '.html'" 
> ex:content=".label"></a>
>
> or (probably somewhat less intuitive to most) function call style:
>
> <a ex:href-content="concat('/presidents/' , .label, '.html')"
> ex:content=".label"></a>
>   
Dave Morris asked for something like that a little while ago and I 
introduced the ex:*-subcontent syntax (as opposed to ex:*-content) for 
him. The conversation was in the 3rd section of

    http://simile.mit.edu/wiki/Talk:Exhibit/Getting_Started_Tutorial

But the idea is that you can write what you wanted above as follows:

    <a ex:href-subcontent="/presidents/{{.label}}.html" 
ex:content=".label"></a>

And you can have several of those {{ }}.

> Already useful, though. Some basic numeric operations for rounding,
> truncation and similar would also be convenient.
>
>   
Will do! Thanks!

Note that while "add" and "date-range" are functions, "foreach" is a 
control construct. I suppose "if" will be useful, too.

David

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to