Parsoid/Setup/pl

Zanim zaczniesz
Jeśli używasz Parsoid w połączeniu z VisualEditor, zauważ, że są one rozwijane równolegle i uaktualnienia do jednego często wymagają odpowiedniego uaktualnienia do drugiego. W razie wątpliwości sprawdź Extension:VisualEditor/pl stronę i postępuj zgodnie z instrukcjami konfiguracyjnymi.

Oczywiście Parsoid może być używany samodzielnie (do przekonwertowania wikitext na HTML DOM i na odwrót) a jeśli nie potrzebujesz programu VisualEditor, możesz zignorować powyższe.

Jeśli jesteś programistą lub nie masz dostępu do sudo apt-get, ponieważ jesteś na współdzielonym hostingu, prawdopodobnie zechcesz śledzić instrukcje Developer Setup. Ta strona dokumentuje konfigurację typowego użytkownika Parsoid przy użyciu rodzimego oprogramowania dla twojego systemu operacyjnego. (Chociaż, jeśli preferowany system operacyjny nie jest tutaj wymieniony, możesz wypróbować instrukcje instalatora &mdash; powodzenia!)

Jeśli udostępniany hosting nie pozwala zainstalować Parsoid, możesz również wypróbować to obejście:Installation on a shared host.

Jeśli napotkasz problemy, skonsultuj się ze stronami troubleshooting. Jeśli chcesz wesprzeć swoje problemy i zaproponować rozwiązania innym, zachęcamy do dodania tych informacji do stron rozwiązywania problemów, aby zachować tę stronę typowych instrukcji instalacyjnych w sposób możliwie jasny i prosty.

Najpierw musisz zainstalować Parsoid. Po wykonaniu tej czynności przejdź do opcji ,sekcji tej strony, aby upewnić się, że Parsoid może komunikować się z instancją mediawiki.

Ubuntu / Debian
These packages work on all architectures and with current distros: Ubuntu 14+ and Debian testing, unstable or wheezy (stable) with backports enabled. See the manual installation on Linux or Mac OS X instructions if your distribution is older & doesn't have nodejs >= v4.x available.

Import the repository gpg key: (key updated on July 27, 2016)

If the last command above isn't working (gpgkeys: key 90E9F83F22250DD7 can't be retrieved), you can try another key server. This one should work :

Add the Wikimedia repository: On ubuntu 16.04 you may need to install "software-properties-common" in order to run "apt-add-repository" apt-get install software-properties-common
 * Ubuntu

Install:
 * Debian

Then, open the config file in  and update it to reflect your API URL. See the section below for details.

Notes: Caveats about the deb: Error loading data from server: internal_api_error_Exception: [0db2f13b5ceecfae5a4c1a98] Exception caught: PHP cURL extension missing. Check https://www.mediawiki.org/wiki/Manual:CURL. Would you like to retry? solved with apt install php-curl systemctl reload apache2 PS: after posting this noticed https://www.mediawiki.org/wiki/Extension:VisualEditor#Troubleshooting  mentions similar.
 * Modifications brought to the configuration file will only become active after restarting the service by.
 * The repository will contain the latest available version of Parsoid. Older versions can be installed manually.
 * The default port used is 8142 (not 8000 so you'll need to, for example, change  in LocalSettings.php).
 * The log file is, and is automatically rotated.
 * If you are on an older distribution and nodejs >= v4 is not available, see the Nodejs installation instructions. You might be able to get a recent packaged version of nodejs.  If you have to install node.js from source (we recommend nave), you'll need to use the Parsoid/Developer Setup instructions.
 * Some folks report that you should also ensure that curl is installed as well: .  Please add some more details here if you find this to be true on your setup.
 * 2018-09-20 during our upgrade from mw v29 to 31, We already had curl installed. when i tested ve got this:

Arch
Parsoid is available in AUR under aur/parsoid (release version) or aur/parsoid-git (development version). Install however you would usually install AUR packages. Enable and start the parsoid service and configure per below. Remember to restart the service for changes to take effect.

This installs to  by default.

RedHat/CentOS
Parsoid is available from the Git repository.

Try creating an empty directory and checking out a copy of Parsoid:

This should dump everything you need into the current directory. Copy the default configuration (which configures the Parsoid server to listen at http://localhost:8000 ):

Edit this file per (below), then start the server with:

At this point, opening a browser to localhost:8000 should display a page with links to the Parsoid documentation on www.mediawiki.org

As one final step, change your startup files (init.d) to add a task to relaunch  on server startup.

Vagrant
If you are using the MediaWiki-Vagrant virtual machine, the  role sets up a working Parsoid. If you use the  role, it will enable parsoid as well.

Windows
Requirements: With nodejs you have to install the build tools (as administrator) npm install --global --production windows-build-tools
 * Install Nodejs x86
 * Install Git x86

You may need to update your npm version to avoid errors

npm -g install npm@latest

npm@next is broken. See https://github.com/npm/npm/issues/16037

If your current directory is in C:\windows\system32, Perform the following command

cd %USERPROFILE%

Install parsoid npm install parsoid Note: if you get errors 'no such file or directory on 'c:\user\{username}\package.json' run the following:

npm init Copy the default config and configure parsoid for Windows Vista/7

copy %USERPROFILE%\node_modules\parsoid\localsettings.example.js %USERPROFILE%\node_modules\parsoid\localsettings.js

or for Windows 8+

copy %APPDATA%\npm\node_modules\parsoid\localsettings.example.js %APPDATA%\npm\node_modules\parsoid\localsettings.js

Run parsoid or on Windows 10+

cd %APPDATA%\npm\node_modules\parsoid node bin/server.js You should open your php.ini file and uncomment the next php modules: otherwise you will get troubles with Parsoid
 * extension=php_curl.dll
 * extension=php_openssl.dll

Docker
This is a version of Parsoid created by community. The original repository can be found at TheNets's GitHub.

Two versions are available: 0.8.1 and 0.9.0.

The images was created over Alpine image.

Requirements

 * Docker installed

How to run
To start Parsoid run the command below. Just pay attention to the MediaWiki version and choose a compatible Parsoid version.

Examples
How to add more than one domain: How to expose on a specific port: (You can use arbitrary port numbers which are not already in use) For more information about Docker setup, check the GitHub page.

Konfiguracja
Począwszy od Parsoid 0.6.0, plik konfiguracyjny znajduje się tutaj:

Jeżeli plik  Twojej wiki nie jest domyślny, tj. edytuj plik  i zmodyfikuj parametr   wskazujący poprawną lokalizację:

Właściwość  podaje ścieżkę API do lokalnej wiki. Właściwość  jest opcjonalna; domyślnie jest to nazwa hosta używana we właściwości , jeśli nie jest jawnie ustawiona, ale może to być dowolny ciąg znaków (nie musi on być rozpoznawany w DNS).

If your wiki is inside a reverse proxy configuration or similar, you can set the hostname in  to an internal hostname or IP that actually points to your wiki internal IP address, to avoid requests going to the public IP address and then routed back again to the internal server. However, be sure that your web server actually routes requests with that hostname to the wiki (if the server is configured to serve different things for multiple sites or subdomains).

For example: you have a wiki at  with a public IP behind a proxy, and the actual application server is on a second internal server which only serves requests to the wiki when accessed from the   hostname but not with other hostnames (because it serves various different websites). You may need to set an  alias of   and set up your web server to have   as an alias to. Then you can use that hostname in the uri property.

By default, Parsoid opens a UDP socket and send each minute some metrics about the Parsoid heap to a statsD server. If you want to send instead these metrics to the logging backend (with the "trace" log level), add in :

localsettings.js (or settings.js) as configuration file
If you prefer to use  as your configuration file, in the   file uncomment the   path like this: and comment,   and   parameters like this:

In this approach the configuration file lives in one of the following locations:
 * (if you have installed from our Linux packages)
 * (if you have followed the developer setup instructions)

Most configuration options are described in the file itself. The only required edit is to update it to reflect your API URL, something like:

The  is an arbitrarily-selected short string identifying your local wiki, used in log messages. The  is also optional, an arbitrary unique string will be generated if it is omitted. Make sure that the VisualEditor configuration uses the same "domain" and/or "prefix" values as Parsoid. (See the VisualEditor configuration instructions.)

Multiple wikis sharing the same parsoid service
If you have multiple wikis, make sure the  string (and/or   if you are using   as config file) is unique for each. Multiple wikis sharing a single host might need to explicitly set the  property to an arbitrary unique string for each wiki.

Example of configuration in  for multiple wikis:

Example of configuration in  for multiple wikis:

See ../Troubleshooting for additional troubleshooting help.

See Parsoid/Setup/RESTBase for information on how to configure a local RESTBase instance between your local VisualEditor and local Parsoid.

The Parsoid/Setup/RESTBase/Arbitrary domains page describes advanced RESTBase setup, but it may offer additional insight about the purpose of the  and   properties.