From: "Mark A. Hershberger"mah@everybody.org To: Wikimedia developerswikitech-l@lists.wikimedia.org Subject: Re: [Wikitech-l] Release Notes and ContentHandler Message-ID:50F16DC2.70007@everybody.org Content-Type: text/plain; charset=ISO-8859-1
On 01/12/2013 08:00 AM, Lee Worden wrote:
Do you know that the WorkingWiki extension pretty much already does this?
I was not aware of this extension.
If I am understanding the example at http://lalashan.mcmaster.ca/theobio/projects/index.php/Greenhouse_paper correctly, it looks like it uses the <source-file> tag to make it so that parts of the page are handled by LaTeXML.
Yes, that's what's happening there. On other pages we store R source code, makefiles, and whatever else people want to store.
Just from looking overhttps://www.mediawiki.org/wiki/ContentHandler there seems to be a lot of cross over between what the WorkingWiki extension does and what ContentHandler enables. Having ContentHandler in core may mean that you can reduce the amount of code in the WorkingWiki extension.
Yes, I think ContentHandler does some of what WW does, and I'll be happy to integrate with it. I don't think we'll want to abandon the source-file tag, though, because on pages like http://lalashan.mcmaster.ca/theobio/math/index.php/Nomogram and http://lalashan.mcmaster.ca/theobio/worden/index.php/Selection_Gradients/Mac..., it's good to be able to intertwine source code with the rest of the page's wikitext.
Also, in a multi-file project, for instance a simple LaTeX project with a .tex file and a .bib file, it's useful to put the files on a single page so you can edit and preview them for a while before saving.
LW
On 13.01.2013 02:02, Lee Worden wrote:
Yes, I think ContentHandler does some of what WW does, and I'll be happy to integrate with it. I don't think we'll want to abandon the source-file tag, though, because on pages like http://lalashan.mcmaster.ca/theobio/math/index.php/Nomogram and http://lalashan.mcmaster.ca/theobio/worden/index.php/Selection_Gradients/Mac..., it's good to be able to intertwine source code with the rest of the page's wikitext.
ContentHandler does not yet have good support for inclusion - currently, there's just Content::getWikitextForInclusion(), which is annoying. It would be much nicer if we had Content::getHTMLForInclusion(). That would allow us to transclude any kind of content anywhere.
That would mean taht instead of <source-file>Foo.tex</source-file>, you could just use {{:Foo.tex}} to transclude Foo.tex's content. Actually, you could implement getWikitextForInclusion() to return <source-file>Foo.tex</source-file>, I guess - but that's cheating ;)
Also, in a multi-file project, for instance a simple LaTeX project with a .tex file and a .bib file, it's useful to put the files on a single page so you can edit and preview them for a while before saving.
That would not change when using the ContentHandler: You would have one page for the .tex file, one for the .bib file, etc. The difference is that MediaWiki will know about the different types of content, so it can provide different rendering methods (syntax highlighted source or html output, as you like), different editing methods (input forms for bibtext entries?).
Basically, you no longer need nasty hacks to work around MediaWiki's assumption that pages contain wikitext, because that assumption was removed in 1.21.
-- daniel
wikitech-l@lists.wikimedia.org