If you install:
http://www.mediawiki.org/wiki/Extension:VariablesExtension#Installation
Then edit the main page to contain the following (between the '---'): --- {{#vardefine:pi|3.14159265418}}
{{#expr:{{#var:pi}}+1}} ---
The main page should, when rendered, now, show the number 4.14159265418
What I would like is something very similar called "CellsExtension" which provides only the keyword "#cell" as in: --- {{#expr:{{#cell:pi}}+1}} ---
However, it gets the value of "pi" from: http://somedomain.org/mediawiki/index.php?title=Pi
Ideally, whenever a mediawiki rendered page is cached, dependency pointers are created from all pages from which cells fetched values during rendering of the page (implying the evaluation of #expr's. That way, when the mediawiki source for one of the cached pages is edited, not only is its cached rendering deleted, but so are all cached renderings that depend on it directly or indirectly. This is so that the next time those pages are accessed, they are rendered -- and cached -- again, freshly evaluating the formulas in the #expr's (which, of course, will contain #cell references such as {{#cell:pi}}).
2010/7/13 James Bowery jabowery@gmail.com:
What I would like is something very similar called "CellsExtension" which provides only the keyword "#cell" as in:
{{#expr:{{#cell:pi}}+1}}
However, it gets the value of "pi" from: http://somedomain.org/mediawiki/index.php?title=Pi
Just putting 3.141592653589 (as opposed to 3.14159265418, whose last three digits differ from their counterparts in pi) in [[Template:Pi]] and using {{#expr:{{pi}}+1}} should have the same effect AFAIK. If you want [[Template:Pi]] to look more interesting than just the number, you could use <noinclude> and <includeonly> .
Ideally, whenever a mediawiki rendered page is cached, dependency pointers are created from all pages from which cells fetched values during rendering of the page (implying the evaluation of #expr's. That way, when the mediawiki source for one of the cached pages is edited, not only is its cached rendering deleted, but so are all cached renderings that depend on it directly or indirectly. This is so that the next time those pages are accessed, they are rendered -- and cached -- again, freshly evaluating the formulas in the #expr's (which, of course, will contain #cell references such as {{#cell:pi}}).
With the template transclusion method I described above, all of this is already handled by MediaWiki.
Roan Kattouw (Catrope)
Having ported an entire spreadsheet's cells into mediawiki templates, I can report a basic problem:
A substantial percentage of the templates required the addition of 'subst:' to the template references in order to get the references to work. This, of course, trashes the original {{#expr:...}}, which is highly undesirable.
On Tue, Jul 13, 2010 at 10:25 AM, Roan Kattouw roan.kattouw@gmail.comwrote:
2010/7/13 James Bowery jabowery@gmail.com:
What I would like is something very similar called "CellsExtension" which provides only the keyword "#cell" as in:
{{#expr:{{#cell:pi}}+1}}
However, it gets the value of "pi" from: http://somedomain.org/mediawiki/index.php?title=Pi
Just putting 3.141592653589 (as opposed to 3.14159265418, whose last three digits differ from their counterparts in pi) in [[Template:Pi]] and using {{#expr:{{pi}}+1}} should have the same effect AFAIK. If you want [[Template:Pi]] to look more interesting than just the number, you could use <noinclude> and <includeonly> .
Ideally, whenever a mediawiki rendered page is cached, dependency pointers are created from all pages from which cells fetched values during rendering of the page (implying the evaluation of #expr's. That way, when the mediawiki source for one of the cached pages is edited, not only is its cached rendering deleted, but so are all cached renderings that depend on it directly or indirectly. This is so that the next time those pages are accessed, they are rendered -- and cached -- again, freshly evaluating the formulas in the #expr's (which, of course, will contain #cell references such as {{#cell:pi}}).
With the template transclusion method I described above, all of this is already handled by MediaWiki.
Roan Kattouw (Catrope)
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org