On Feb 18, 2008 12:35 PM, Apple Grew applegrew@gmail.com wrote:
So, my question is. Can anyone please guide me to the php files of MediaWiki that I can use with little modification. I intend to provide it all the necessary details like list of Templates and their codes to substitute, the categories and the arbits of codeticle markup as input to the php file,etc. I expect to get the html code that can be sent to the user's browser.
Basically, right now it's all integrated, no serious attempt has been made to separate it all out. A lot of the major parts are in includes/Parser.php, which calls many other files, such as Linker.php, ParserOptions.php, Title.php, User.php, and so on. The main entry point is Parser::parse(). I've never tried to sort it out myself, but apparently if you really know what you're doing it's not too hard to get it to work as desired without a web request.
All this may look very pointless, but after battering my brains over this thing and repeatedly getting disappointing results, my brain has gone fuzzy and desperate.
If it's pointless, a lot of people have spent a lot of time doing something pointless. :) We should really decouple the parser somewhat more from the rest of the code and have it accessible standalone, to the extent possible. This seems to be a *very* common need, that wouldn't be too hard to address. Maybe someone could write up a maintenance script that will just accept wikitext on stdin and output HTML to stdout, with anything else necessary (e.g., title) passed as a command-line option. Ideally this wouldn't need a database, either, although in practice you'd need some amount of configuration (where should URLs point, what namespaces exist, . . .), which could hopefully be averted with sensible defaults.
I'm not volunteering to write it, though.