![]() I also needed to change Parsoid’s default configuration for the path to MediaWiki’s api.php, and also to request the wiki’s actual name instead of localhost, so that nginx resolves the name correctly. This solution seemed simpler and less sketchy to me than the first documented solution: forwarding the user’s cookies to Parsoid. Fortunately, using Parsoid on private wikis is documented, and I was able to allow Parsoid’s access by whitelisting a specific user’s access if the request comes from localhost, using the NetworkAuth extension. First, our wiki is private, so Parsoid needed to be authenticated somehow, for read access to the pages. Through my test curl requests, I was able to debug about three hurdles I encountered. I wouldn’t have been able to get things working without Parsoid’s Troubleshooting page. I was hesitant to even set it up, because that’s a pretty big change in how edits happen in the wiki. From my understanding, it uses MediaWiki’s API to fetch pages and give them to the VisualEditor in the client’s browser via XHR. I don’t really know the specifics of Parsoid, but you can read about its design here. I haven’t dug deeper, though, and it’s possible that wikitext is just too complicated, or the scope of the problem is bigger than what I’m seeing. We are able to leverage that in the PMT, and I imagine that if MediaWiki took some cues here, they might be able to simplify the VisualEditor process by removing the dependency on their node.js service (called Parsoid), that translates HTML into wiki markup. The MediaWiki developers didn’t have the luxury of a well-defined markup language like CommonMark. And as the 2010s arrived, it became obvious that there were improvements that could be made. But, this did discourage people who didn’t want to learn this from writing longer articles from scratch. It’s similar to Markdown, and not that bad for making small edits. ![]() Until a few years ago, anyone editing Wikipedia was expected just to deal with the wikitext syntax. Its underlying software, which turned into a project called MediaWiki, handles the wikitext-to-HTML transformation with a script known as the PHP parser. Wikipedia started in 2001, and its content survives today in its original form of custom “wiki” markup, complete with a stable transformation to HTML. They aren’t targeting a human-readable HTML document as an output format. Word processors don’t have this problem because they control the entire rendering process and don’t have to deal with web standards. There are too many undefined cases in the interactions between all the different plugins and layout options for the developers to be able to handle it all, and put it in a DOM structure that makes sense. The automated way that these editors use can make a mess. And that’s where the more pedantic web developers bring up the fact that, in order to make a DOM structure that’s understandable to other developers, you really need more manual control of the HTML and CSS to lay things out. These editors often have a “View Source” button that allows you to edit the HTML that’s being generated by the editor’s JavaScript code. If something is missing, you can just make a new plugin and attach it to the toolbar. ![]() markdown-toolbar adheres to the CommonMark spec, allowing for the HTML transformation to happen either server-side or client-side, yielding identical results in both cases.Īt the next level, libraries like CKEditor and TinyMCE, originally developed in the 2000s and inspired by word processors like MS Word, allow for an unending amount of layout features. User-facing WYSIWYG editors like medium-editor and markdown-toolbar give users a small toolbar with a few formatting options. Libraries like MathJax allow for LaTeX-style math syntax to be meticulously, accurately rendered with SVG. First I’ll outline some of the background of interactive text formatting on the web from my perspective, and then go into some configuration details of MediaWiki’s Visual Editor that I found interesting. The web allows for different ways to turn text into HTML markup. ![]() Editing and formatting text on the web comprises of an interesting sub-field of web development. ![]()
0 Comments
Leave a Reply. |