Talk:Parsoid/PHP

About this board

What is Extension:Parsoid?

5
Summary by Cscott

Updated a bunch of docs to try to clarify the relationship between the Parsoid extension and the parsoid library.

Ciencia Al Poder (talkcontribs)

I'm extremely confused by this. I've deleted a reference to Extension:Parsoid which is old, outdated and archived, but the configuration of this page is using:

wfLoadExtension( 'Parsoid', "$PARSOID_INSTALL_DIR/extension.json" );

This page was created on 2019. The Parsoid extension was deprecated long ago. How could it be possible? Either this configuration is utterly outdated (it was already outdated on creation!) or there's some other hidden Parsoid extension that I'm not aware of.

@Cscott, please explain

Skizzerz (talkcontribs)

That line is stating to use the extension.json of the downloaded Parsoid/PHP, presumably because it has been implemented as an extension. See also the note below that: "Note that the business with $PARSOID_INSTALL_DIR and AutoLoader::$psr4Namespaces is only necessary for developers, who want to ensure they are running from the latest git version of Parsoid, not the version included in mediawiki-core as a library."

So, that wfLoadExtension is only necessary for developers who want to use a version of Parsoid other than the one shipped with mediawiki

Ciencia Al Poder (talkcontribs)

If there's an extension.json, it should appear in Special:Version, but it does not: Special:Version

AFAIK, WMF is using RESTBase, but they're not using this extension, and their rest.php api doesn't support the /v3/ URL paths that this "extension" is implementing. However, I'm unable to use VE because I have RESTBase installed for mathoid, and it keeps trying to contact parsoid at /v3/ URLs, which is task T263928

Jdforrester (WMF) (talkcontribs)

Everything about the Parsoid integration into MediaWiki is a hack right now. We're going to normalise it in the next year or so, but yes, there's a fake extension inside Parsoid (in vendor/) which adds the REST routes, for now, because no-one could agree on putting them in core and so encouraging others to use the deprecated system we'd need to use until the new one is built.

Cscott (talkcontribs)

What @Jdforrester (WMF) said. The Parsoid service is loaded as an extension currently to register some routes and remove some circular dependencies between the Parsoid library and core. This is distinct from the old Extension:Parsoid and thanks for removing that erroneous reference.

Incidentally, the configuration information for Parsoid was moved to the main Parsoid page with the release of MW 1.35; I hadn't noticed that there was an old out-of-date copy here as well. I've ported some useful changes made here back to the main configuration description on Parsoid and removed the duplicate here.

Summary by Cscott

Thanks to the Parsoid team!

Ranjithsiji (talkcontribs)

Visual Editor and Parsoid/PHP are working fine with a mediawiki 1.35.0 installation in my system and my wiki server. A Huge thanks to the team behind the Parsoid project and also their Colossal efforts to port it to PHP. Thank you team, now we can use it without running another server and it is a beautiful feature. I got some small errors for setup but those are rectifiable with the documentation. We are in fantastic track. Congrats all.

Cscott (talkcontribs)

Thanks!

Alternative (simpler) install directions for ordinary users?

3
Summary last edited by Cscott 17:40, 5 October 2020 3 years ago

The following is documented on Extension:VisualEditor as a simpler configuration if you are using the released version of VisualEditor in MediaWiki 1.35.

wfLoadExtension( 'VisualEditor' );
// $wgParsoidSettings = [
// 	'linting' => true,
// 	'_merge_strategy' => 'array_plus',
// ];
// wfLoadExtension( 'Linter' );
// wfLoadExtension( 'Flow' );
Lens0021 (talkcontribs)

I am looking for an instruction for production.

I tried below: (Full LocalSettings.php)

<?php
// Parsoid Setting
$wgParsoidSettings = [
	'linting' => true,
	'_merge_strategy' => 'array_plus',
];
wfLoadExtension( 'Parsoid', "$IP/vendor/wikimedia/parsoid/extension.json" );
wfLoadExtension( 'VisualEditor' );
wfLoadExtension( 'Linter' );

Is it simplest?

Best regards.

Lens0021 (talkcontribs)

Thus, I want Extension:StructuredDiscussions too. But flow-parsoid-utils API says "Conversion from 'html' to 'wikitext' was requested, but core's Parser only supports 'wikitext' to 'html' conversion".

Adding more config described below is not helping, just make the message to changed to ""[382f4466b477f8d36a66ac38] Exception caught: Request to parsoid for \"html\" to \"wikitext\" conversion of content connected to title \"Talk:Main\" failed: (curl error: 7) Couldn't connect to server":

<?php
$wgVirtualRestConfig['modules']['parsoid'] = [
	'url' => 'http://localhost/rest.php',
	'domain' => 'localhost'
];

In the both cases, VisualEditor works well.

Lens0021 (talkcontribs)
There are no older topics