It should be possible to create an HTML-only wiki, with Visual Editor
as the primary editing mechanism and no wikitext parsing for typical
views and edits. Advanced users could install Parsoid to round-trip
from the HTML DOM to wikitext for source editing, translating from
wikitext back to the HTML DOM for database storage and display.
(Eventually we may similarly allow round-trip "source" editing in
other formats, such as Markdown or a new and refreshed "wikitext 2.0"
-- but let's limit discussion to VE/HTML for now.)

So what are the architectural improvements needed?

* ContentHandler[1] laid the groundwork for non-wikitext page content.
Building on it, an HTML-format "Mediawiki DOM" ContentHandler must be
written, using DOM methods to separate sections and extract redirects.
The "Mediawiki DOM" Content implementation must extract secondary data
(links, categories, etc) directly from the DOM. (Alternatively, page
metadata should be stored in a separate JSON "page metadata"
attachment and custom editors provided.)

* An HTML-based DifferenceEngine[2] must be implemented to allow
visualizing changes without resorting to wikitext.

* VisualEditor must be tweaked to fetch Mediawiki DOM directly,
bypassing Parsoid; ditto on save.  (I believe RESTbase is working
toward this already.)

* System messages must be associated with a content model, to allow
HTML-formatted system messages. Localization workflows need to
accommodate non-wikitext messages. Most messages do not need/should
not have formatting and should probably shift to a "plaintext" content
model.

* The Sanitizer[3] will need improvement so that it is appropriate to
run directly on Mediawiki DOM.

* Compatibility thunks are also desirable. These would use Parsoid
(in-process?) to dynamically generate wikitext from the Mediawiki DOM
to allow some legacy extensions and APIs to function.

What other areas would present roadblocks to an HTML-only wiki (or,
more generally, to a non-wikitext mediawiki)? I'm hoping the mediawiki
hackers on this list can educate me on other areas that might be
problematic (or other place where useful groundwork has already been
laid).
  --scott

ps. I submitted a proposal very similar to this to wikimania 2015:
https://wikimania2015.wikimedia.org/wiki/Submissions/Mediawiki_without_wikitext
Help me improve my (proposed future) talk!

[1] https://www.mediawiki.org/wiki/Manual:ContentHandler
[2] 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/master/includes%2Fdiff%2FDifferenceEngine.php
[3] 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/master/includes%2FSanitizer.php

-- 
(http://cscott.net)

_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to