Re: [Wikitech-l] Release Notes and ContentHandler
On 01/13/2013 07:00 PM, wikitech-l-requ...@lists.wikimedia.org wrote: From: Daniel Kinzlerdan...@brightbyte.de To: Wikimedia developerswikitech-l@lists.wikimedia.org Subject: Re: [Wikitech-l] Release Notes and ContentHandler Message-ID:50f2abf9.4020...@brightbyte.de Content-Type: text/plain; charset=ISO-8859-1 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/MacLev, 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-fileFoo.tex/source-file, you could just use {{:Foo.tex}} to transclude Foo.tex's content. Actually, you could implement getWikitextForInclusion() to return source-fileFoo.tex/source-file, I guess - but that's cheating ;) It's not source-fileFoo.tex/source-file - that would be ridiculous. If nothing else, I'd use source-file filename=Foo.tex/. :) [In fact, I do support that form, but it's hardly ever used.] No, it's source-file filename=Foo.tex\documentclass{article} [...] \end{document}/source-file. It stores the actual source code. The file is not transcluded. This may seem ridiculous at first blush, and you might never want to do that with long .tex files or Python modules, but think instead of explaining a concept by using a series of little 4-line programs, to illustrate each step. You can think of source-file as syntaxhighlight with semantics behind it. It displays a code listing, with highlighting, but it also lets you run the code, in context, and display the output. There are plenty of use cases where you don't want to do that, you just want to put each source file on its own page, and I support that now, and I'll definitely support the use of ContentHandler when it's time, as I've been planning to all along. But the ability to edit, run, test, and refine the code by pressing the Preview button, without saving your changes to the wiki until you're satisfied, even if the code is in multiple source files, is a valuable affordance, and we may not want to give it up. 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. Bundling several source files onto a single page, with wikitext interspersed, is a form of literate programming. It's part of the same tradition as knitr, R markdown, sage notebooks, etc. There are valuable uses for embedding code in free-form markup, and I think it's useful to be able to do it in MediaWiki. LW -- daniel ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
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/MacLev, 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-fileFoo.tex/source-file, you could just use {{:Foo.tex}} to transclude Foo.tex's content. Actually, you could implement getWikitextForInclusion() to return source-fileFoo.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 mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
Hi Mark, Do you know that the WorkingWiki extension pretty much already does this? http://lalashan.mcmaster.ca/theobio/projects/index.php/WorkingWiki I haven't looked into the ContentHandler features in any detail, but I don't imagine it'll be hard to handle source files stored on pages with special content types along with the other ways of storing source files that we already support. And yes, I'm sure I'll do it at some point. Lee Worden Date: Fri, 11 Jan 2013 20:19:57 -0500 From: Mark A. Hershbergerm...@everybody.org To: Wikimedia developerswikitech-l@lists.wikimedia.org Subject: [Wikitech-l] Release Notes and ContentHandler Message-ID:50f0ba3d.6060...@everybody.org Content-Type: text/plain; charset=ISO-8859-1 As you may have guessed, I've been working on the release notes for 1.21. Please look over them and improve them if you can. In the process, I came across the ContentHandler blurb. I don't recall this being discussed on-list, but, from looking at the documentation for it, it looks pretty awesome. I've used some of my editorial powers to say, in the release notes: Extension developers are expected to create additional types in the future. These might support LaTeX or other forms of markup. Is this correct? It sounds like a really big thing, if it is. -- http://hexmode.com/ Language will always shift from day to day. It is the wind blowing through our mouths. -- http://hexm.de/np ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
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. Just from looking over https://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. -- http://hexmode.com/ Language will always shift from day to day. It is the wind blowing through our mouths. -- http://hexm.de/np ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
Check out https://www.mediawiki.org/wiki/MediaWiki_1.21/wmf2#The_biggest_changes for a description of how ContentHandler might affect other MediaWiki installations. -- Sumana Harihareswara Engineering Community Manager Wikimedia Foundation ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
On 01/12/2013 09:09 AM, Sumana Harihareswara wrote: Check out https://www.mediawiki.org/wiki/MediaWiki_1.21/wmf2#The_biggest_changes for a description of how ContentHandler might affect other MediaWiki installations. Thanks! I've used that as a start for what can go into the release notes. -- http://hexmode.com/ Language will always shift from day to day. It is the wind blowing through our mouths. -- http://hexm.de/np ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
On 12.01.2013 02:19, Mark A. Hershberger wrote: As you may have guessed, I've been working on the release notes for 1.21. Please look over them and improve them if you can. In the process, I came across the ContentHandler blurb. I don't recall this being discussed on-list, but, from looking at the documentation for it, it looks pretty awesome. Thanks! The discussion on-list was a while back - there was not much discussion, though. See: http://www.gossamer-threads.com/lists/wiki/wikitech/279327 http://www.gossamer-threads.com/lists/wiki/wikitech/293708 http://www.gossamer-threads.com/lists/wiki/wikitech/303161 http://www.gossamer-threads.com/lists/wiki/wikitech/300173 etc I've used some of my editorial powers to say, in the release notes: Extension developers are expected to create additional types in the future. These might support LaTeX or other forms of markup. Is this correct? It sounds like a really big thing, if it is. It's correct, misses the point: Not only can we support other markup languages, we can support completely non-textual content. SVG, KML, CSV, JSON, RDF can all easily be used as page content, using the default or custom methods for editing, diffing, merging, etc. Look at some page on wikidata.org to see what I mean - try to look at the page source. There isn't any wikitext to see. If you really want, you can get to the raw JSON via Special:Export though. Try a diff on wikidata.org too :) -- daniel ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
From: Mark A. Hershbergerm...@everybody.org To: Wikimedia developerswikitech-l@lists.wikimedia.org Subject: Re: [Wikitech-l] Release Notes and ContentHandler Message-ID:50f16dc2.70...@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/MacLev, 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 ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Release Notes and ContentHandler
Hey, This system is useful for many extensions. A few things from existing extension that could make use of it from the top of my head: * Education Program courses * UploadWizard campaigns * Semantic Forms form definitions * Surveys And of course it facilitates creation of new extensions that want to define instances of such structured types. Cheers -- Jeroen De Dauw http://www.bn2vs.com Don't panic. Don't be evil. -- ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l