Open main menu

Changes

447 bytes removed ,  23:35, 19 April 2023
Updated for 2023
[https://www.youtube.com/watch?v{{Feature|image=M_Ioi1aLAL8 VIDEO] Visual Editor (47 minlinking).) with James Forrester - Product Manager and Roan Kattouw png|imgdesc=Direct editing|title=}}{{#set:feature description = A reliable rich- Srtext editor for MediaWiki. Software Engineer presenting Jan 13 Allows you to just "edit the page you see" while being aware of all the syntactically rich features of templates, 2014 at Linuxextensions etc.conf}}{{#set:feature notes = The Visual Editor is available Here and on Wikipedia.au on }}{{#set:feature tests = [[Special:UserLogin|Login]] to the contentEditable aspects of the systemwiki, and make an edit in your [[Special:MyPage/Sandbox|personal sandbox]]. }}{{#set:feature examples = }}
The [http://www.mediawiki.org/wiki/VisualEditor Visual Editor] for MediaWiki relies on the '''[[mw:Extension:Parsoid|Parsoid]]''' extension <ref>[https://git.wikimedia.org/tree/mediawiki%2Fextensions%2FParsoid Parsoid extension]</ref> AND the Parsoid service. The Parsoid service is a node.js server that interacts with the mediawiki API.
<blockquote>"Parsoid implements a bidirectional wikitext parser and interpreter[[File:VisualEditor-logo. It converts and interprets wikitext into an annotated HTML DOM, which can then be edited with HTML editor tools such as the svg|alt=Visual Editor|frameless|641x641px|Visual Editor logo]]== Links ==* [https://www.mediawiki.org/wiki/Help:VisualEditor/User_guide User Guide]* [https://www.mediawiki. It also provides the conversion of a org/wiki/Project:Sandbox Demo] (possibly modifiedno account needed) HTML DOM back to wikitext* [https://www.mediawiki."<org/blockquote>wiki/VisualEditor/Portal/Help Portal to Help Content about VE]
[== Back story ==Wiki markup is a sort of shorthand for more complicated HTML markup designed to create nicely formatted web documents. Although in the beginning wiki markup simplified the process of creating nicely formatted content, that shorthand can get increasingly complex in order to produce complicated layout and content. The extension of the markup system over time to include a template subsystem and macros inevitably leads to a tension between ease of use, and power. This tension was one of the primary factors that the Wikimedia Foundation cited as an impediment to new content collaborators for the Wikipedia. <ref>https://strategy.wikimedia.org/wiki/March_2011_Update</ref><ref>http://xmlstrategy.coverpageswikimedia.org/ Robin Cover] would be proudwiki/Editor_Trends_Study</ref> <ref>See this October 2013 article in the MIT Technology Review http://www.technologyreview.com/featuredstory/520446/the-decline-of-wikipedia</ref>. It round-trips wiki to HTML + RDFa and backA visual editor was deemed nearly impossible after many early attempts failed, but with the advent of Node.js technology, it became an idea that was plausible again.
== Installation ==YouFast-forward to 2016 when VisualEditor was fully working as a Visual WYSIWYG interface for editing MediaWiki content, using a Node.js backend called 'Parsoid'll need at least [http://www.mediawiki.org/which is a bidirectional runtime wiki/Release_notes/1.23 MediaWiki v1parser.23]. I personally run the same [httpThis caused a big software architectural problem://www.mediawiki.org/wiki/Specialthere were two parsers to maintain:Version version that theythe 'normal' (now 'legacy're running on mediawiki) core parser in PHP, and the Visual Editor parser (Parsoid) in JavaScript.org] (So, by the end of 2019, Parsoid was ported to PHP, and distributed with MediaWiki 1.24wmf3 [35 as part of the [Usermw:FreephileParsoid/Parser_Unification|greg.rundlettParser Unification initiative]] ([[User talk:Freephile|talk]]) 19:39, 9 May 2014 (UTC))=== WebFaction ===.
To install the Visual Editor extension in a Webfaction account, you need to first have node installed and working. You can do this by using the == Intro ==* [httphttps://docscommons.webfactionwikimedia.comorg/softwarew/customindex.html installer in your webfaction panel] and associating a path with the app for a domain. I chose to install 'node' (which is now it's own onephp?title=File%3AWikimania_2013_-_VisualEditor_-click install)_The_present_and_future_of_editing_our_wikis. Once you do that you can webm VIDEO] Wikimania 2013* [https://freephilewww.youtube.orgcom/node visit the pathwatch?v=M_Ioi1aLAL8 VIDEO] you configured for node and you should see the "hello world" app that the installer puts in place(47 min. You'll need to stop that app, plus remove the cron job that respawns it. Then, in order to reserve ) with James Forrester - Product Manager and associate a port for the service, you install another 'app'Roan Kattouw - Sr. You do not need to open this port in the firewall unless you plan to share it with other instancesSoftware Engineer presenting Jan 13, since HTTP talks to the node server on the backend2014 at Linux. (I had to export the PORT, but this is no longer necessary if you configure it in localsettings.js.) Depending on the resource constraints of your hosting package, you may need to limit the number of workers spawned by the Parsoid serviceconf. It calculates a number based au on the number contentEditable aspects of processors. For a shared hosting account, this is guaranteed to exceed your RAM or CPU limits, so specify the <code>--num-workers</code> option unless you're running on a dedicated host or VMsystem.
Follow the installation instructions, and remember to edit both LocalSettings.php and localsettings.js When you setup the "interwiki" link to point to your API endpoint, you can choose pretty much whatever name you want to give itThe [http://www. The example is 'localhost'mediawiki.org/wiki/VisualEditor Visual Editor] for MediaWiki relies on [[mw:Parsoid|Parsoid]]
<blockquote>"Parsoid implements a bidirectional wikitext parser and interpreter. It converts and interprets wikitext into an annotated HTML DOM, which can then be edited with HTML editor tools such as the Visual Editor. It also provides the conversion of a (possibly modified) HTML DOM back to wikitext."</blockquote>
You'll want to set/update your $NODE_PATH and $PATH environment variables to locate the installed node modules, and to find the node and npm binaries<source lang="bash">export NODE_PATH="$HOME/webapps/node/lib/node_modules[http:$NODE_PATH"echo 'export NODE_PATH="$HOME/webapps/node/lib/node_modules:$NODE_PATH"' >> $HOMExml.coverpages.org/Robin Cover] would be proud.bashrcwhich npmexport PATH="$HOME/webapps/node/bin:$PATH"echo 'export PATH="/$HOME/webapps/node/bin:$PATH"' >> $HOME/ It round-trips wiki to HTML + RDFa and back.bashrc</source>
Once node (and npm) == Installation ==VisualEditor is available, you of course need to get the parsoid and visual_editor extensionsincluded with MediaWiki. A quick <code>npm install<See https:/code> in the parsoid directory sets up all the node machinery/www.mediawiki.org/wiki/Extension:VisualEditor
To have it run continuously, you might want to use the 'forever' module:
<source lang="bash">
npm install -g forever
</source>
But that is just a node way of monitoring processes. You might want to simply use tools built for the purpose like [[tmux]] or [[screen]] plus [[monit]]. If using <code>forever</code>, then you just prefix your call to node with 'forever'
At this point you're ready to run the node server. Note== Extensions ==# [[mw:Extension: while installing this, I found a bug which prevented the server from listening on the configured port. It was awesomely cool that I mentioned the bug in IRC VisualEditor]]#mediawiki-parsoid and it was fixed before I was done testing my installation!![[mw:Extension:Parsoid]]
<source lang="bash">== Extensions that hook into VE ===cd ~* https:/webapps/wikicodesearch-beta.wmcloud.org/extensionsthings/Parsoid?q=ve.ui.commandRegistry.register&files=&excludeFiles=&repos=* https:/node api/servercodesearch-beta.js --num-workerswmcloud.org/extensions/?q=VisualEditorPluginModules&i=nope&files=2 &</source>repos=
The console Extension authors should print out a list of worker pids, and the port number that the server is listening onregister <code>VisualEditorPluginModules</code># https://www. In your web browser, if you visit that path and port mediawiki.org/wiki/Extension:Proofread_Page# https://www.mediawiki.org/wiki/Extension:CodeMirror (setup in your WebFaction node mappingsyntax highlighting), you should see the Parsoid web service API message# https://www.mediawiki.org/wiki/Extension:Disambiguator# https://www.mediawiki.org/wiki/Extension:Graph# https://www.mediawiki.org/wiki/Extension:Kartographer (Open Street Maps)# https://www.mediawiki.org/wiki/Extension:LanguageTool# https://www.mediawiki.org/wiki/Extension:Math# https://www.mediawiki.org/wiki/Extension:Score (LillyPond)# https://www.mediawiki.org/wiki/Extension:SyntaxHighlight # https://www.mediawiki.org/wiki/Extension:TemplateData# https://www.mediawiki.org/wiki/Extension:WikiHiero
There is no stop script for a shared host, but you should be able to do something like
<source lang="bash">
for pid in $(/sbin/pidof `which node`); do kill -9 $pid; done
</source>
That's because node is installed under your user account== Customizing Visual Editor with custom menus, and the $PATH is set as above to find that instance of node. To be sure that you're not going to kill everyone's node instancestools, you could look at all the nodes with ps -ef==== Info ==commands ==* https://docswww.mediawiki.org/wiki/VisualEditor/Gadgets* https://www.webfactionmediawiki.comorg/wiki/VisualEditor/Gadgets/Creating_a_custom_command* https:/software/nodejswww.htmlmediawiki.org/wiki/VisualEditor/Gadgets/Add_a_tool
== Extensions ==
# [[mw:Extension:VisualEditor]]
# [[mw:Extension:Parsoid]]
== API / Developer Docs / DevOps ==
* https://doc.wikimedia.org/VisualEditor/master/ powered by JSDuck
* http://blog.gmane.org/gmane.science.linguistics.wikipedia.wikitext wikitext-l
 
I [https://gerrit.wikimedia.org/r/#/c/132479/1/api/ParsoidService.js noticed a bug] and it was fixed about 5 minutes after I mentioned it! (Thanks C. Scott Ananian)
{{References}}