Oh, it's still a proposal merely, but its something that I plan to build at some point in the future (it's needed for some of my other extensions and uses), but I do have plans to make a TransWiki extension. http://wiki-tools.com/wiki/TransWiki
There are only two tricky points. I've already theorized on how to get stuff, how to ensure efficiency, and what not. The first issue is syntax. I've had a few thoughts, note that the first goal is to make this work with a tag, the second goal is making this work with a commons type setup.
My first thought on the syntax was something like <transwiki name=anime page=Template:Stub /> with an optional namespace=# in case the other wiki and the module currently used for connecting to another wiki did not give out information on another wiki's custom namespaces. Though do note that in this syntax, XML like syntax is used to avoid conflicting with syntax other things use (and do remember that at a core the point here is NOT to look like template transclusion, it is to transclude WikiText from another wiki into a Template where you then include that template into a page), however because things are transcluded at the extreme beginning, it doesn't actually use MediaWiki's xml tag stuff, this is all just regex replaced before anything happens to it (Yes, that does mean that <transwiki /> is immune to <nowiki/> and will transclude even if wrapped in it... Of course, that could also be regarded as a feature ;) if you were to want to transclude something and then go and highlight what code was used; But all in all, a syntax that WON'T be used in any other case is extremely necessary for this because of that core reason that the tag will not be affected by <nowiki/>)
As for the commons like setup, by default I don't want to transclude /everything/. I will consider a config option for that purpose. However, the plan is first to use something like a __SHARED__ tag on a commons wiki, then pages tagged with that will be transcluded to all the inheriting wiki if the page there does not exist. (This also means that you could put __SHARED__ on your userpage and have it transcluded from commons even though it's not in the Template: namespace)
The second issue is the parser. I've talked to Tim many a time before, but there are two bits in the parser (for two different extensions) which do NOT, exist in the parser right now, and I'm having a hard time finding a place to introduce a hook for that purpose. /(Feel free to ignore this first speal, it's not as relevant)/ The first one is to do with the preprocessor and WikiCode; I need to allow a #parserfunction to access the frame of the parent template (It's supposed to extract a list of template variables used inside of the template call it is inside of -- This could probably also be used for a #macrovar: type parserfunction where you grab the value of a variable not in the current scope, but in the scope of the template outside of the current template ;) as confusing as that is, it does have a useful purpose... Think, proxying a template with a shortened name, but only setting what you need to set, allowing a #macrovar: inside of that template to grab the variable from current scope and use it instead of directly passing the variable to the template [this allows for things to be expanded without breaking things and needing to edit every single proxy template which uses a simpler config]. But moreover, it could be used for something as simple as say {{empty|foo|default}} which works similarly to {{{foo|}}} except it works as if you inserted {{#if:{{{foo|}}}|{{{foo}}}|default}} into the page itself.) The second one, and more important in this case is to do with ParserBeforeStrip, and transclusions. Basically, because we are transcluding early (before anything is parsed at all) we need a hook or two which will allow us to insert WikiText at this point in loading. ParserBeforeStrip works nice for that purpose in the current page, it however does not work for transclusions which is the purpose of the TransWiki idea. I need to find a location in the parser where I can insert a hook to modify the text of a template being transluded (it also needs to give the Title::... instance for that template being transcluded, otherwise we won't be able to do this in a commons like way and will be limited only to tags). I however have had issues finding a place to put this kind of hook inside of the parser.
~Daniel Friesen(Dantman) of: -The Nadir-Point Group (http://nadir-point.com) --It's Wiki-Tools subgroup (http://wiki-tools.com) --Games-G.P.S. (http://ggps.org) -And Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
Angela wrote:
On Thu, Jul 3, 2008 at 10:38 PM, Siebrand Mazeland s.mazeland@xs4all.nl wrote:
As far as I know there is something called "Scary transclusion"[1],[2]. "Enable scary transclusion (transcluding from another wiki)." It has to be enabled on a per wiki basis. I have no clue what it's current status is, and if there is any experience with it in larger MediaWiki environments.
It's used on Wikia. http://scratchpad.wikia.com/wiki/Scratchpad:Template_demo shows some of the uses and bugs. The caching problem that Chad mentioned is the main reason we don't make more use of it. Also, parameters aren't passed to the wiki using the template which limits its usefulness.
Angela
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l