Extension:Html2Wiki/Reference
Html2WikiEdit
Html2Wiki project page on MediaWiki.org
Development WebsiteEdit
MediaWikiEdit
- MediaWiki Architecture from The Architecture of Open Source Applications., volume II
- Manual:MediaWiki architecture
- mediawiki-core/master - also an example of Doxygen which is used by MediaWiki
- VisualEditor/master/
- http://api.jquery.com/
- php simplexmlelement.getname.php
- API:Main_page - esp. for creating content outside normal edit flow
- API:Calling internally
- Manual:Parameters to index.php
- Manual:Ajax about using the jQuery in MediaWiki
- How to become a MediaWiki hacker / Extension Writing Tutorial
- Manual:Developing extensions
- Manual:Database_layout
- Manual:Coding conventions / PHP
- Manual:How to debug [1]
- Manual:WebRequest.php
- ResourceLoader/Default_modules discusses using jQuery and the other resources
- Manual:$wgResourceModules
- Manual:Special_pages
- Manual:$wgEnableUploads
- Manual:$wgUploadDirectory - use this to change the upload location for ext.
- Manual:$wgHashedUploadDirectory set this false to get an easier 1to1 view I don't think I can use the upload facility at all (unless extending it considerably) because of the assumptions built into the upload facility (it's for assets, and would pollute the 'recent files' gallery etc.)
- Manual:Edit.php
- Manual:Edit token
- For Vagrant, there is a LocalSettings.php in /vagrant which overrides /vagrant/mediawiki/LocalSettings.php (e.g. images is in /srv/images)
- Markup spec tells us what HTML allowed in wiki markup
DOM ParsingEdit
- PHP DOM is based on libxml and native to PHP, so fast, but finicky can do XPath queries
- StackOverflow review
- phpquery is similar to jQuery (but last updated 2009) explained
- querypath does jQuery selectors; is installed with Composer and does HTML5 also
- simplehtmldom is written in PHP and not based on libxml. More generous.
ParsoidEdit
Pre-processing / ValidatorsEdit
- php manual / ref.tidy.php The PHP lib-tidy binding
- Tidy man page (configuration options including "new-blocklevel-tags")
- http://htmlpurifier.org/
- http://htmlpurifier.org/demo.php?post
- https://validator.nu/ is the best choice for API/service/testing https://about.validator.nu/
- W3C's validator, and Step-by-step guide (source available for "Unicorn" - the combined validator)
- http://oli.jp/2009/html5-structure4/ background article explaining HTML4 -> HTML5 which can almost be summarized by "change the doctype".
Existing / Example codeEdit
- Extensions within Category:Bulk upload
- Extension:UploadLocal looks really good for showing how to hook into the upload process, and repeat it, with a display of files to be processed. Drawbacks: it handles ONLY images, and those must already be on the server. May not be current, but looks fairly current.
- Extension:MsUpload looks really good - especially for hooking into the Edit screen and calling the API using HTML5 AJAX for drag and drop ease. It specifically offers a new method of creating document sets: create/edit the category page, and uploads will be tagged with that category. Drawbacks: dependency on Plupload and fallback to Flash and Silverlight which means hacking it might be impractical. In any case, these authors have related extensions that make this extension and those others very likely a part of the solution.
- Extension:UploadWizard is an extension that allows a user to upload multiple files with a step-by-step JavaScript wizard.
- The simple way to HTML5 is to replace the first 4 lines of an HTML4 doc with
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>HTML5 Syntax and Coding Style</title> </head>
- Snippets for AJAX
- The "Working Wiki" extension to MediaWiki is an advanced and interesting project for later follow-up.
in-browser EditingEdit
[1] wfDebug( __METHOD__ . ": unzipping stuff" ); will put something in the log file
MWDebug::log("Setting $attribute to ${$attribute}"); will put something in the console