Publication extension has mainly been developped by Oncle Tom, alias, Thomas Parisot, and it is currently maintained by MrFlos. It corresponds to the need, often described by YesWiki'users, to easily generate publication, from the content of their wiki :
- books / booklets
- fanzines
- newsletters
Publication gives the possibility to manage 4 steps to make easier the tasks:
- Select elements of a publication.
- Organise elements into a publication.
- Generate and save the publication.
- Create the PDF
!> For the forth step, chromium software shoud be installed on the server. No fear, if it is not the case, alternative solutions exist.
To work, the extension needs :
- to have installed
chromiumsoftware on the server - or to use another YesWiki which already disposes of
chromium
Prerequisite:
- dispos of a
sshaccess to the server- dispose of administrative command line access to the server
- dispose of a server with PHP extension
ext-socketsactivated
If the server uses an operating system of type Ubuntu/Debian , it is possible to use the command line :
sudo apt install -y --no-install-recommends chromiumOnce the installation is finished, it is possible to check the installation path with this command line :
which chromiumIt should be /usr/bin/chromium. If not, keep the given path to configure the extension.
Adjustements of chromium can be done.
- it the software path is not
/usr/bin/chromium, the rigth one should be copied into page GererConfig in partpublication, parameterhtmltopdf_path - other parameters can be updated using a
ftpsoftware to acces to the server to modify the content ofwakka.config.phpfile or into page GererConfig in partpublication(but only few parameters are avaialable). Parameterhtmltopdf_optionsgives the possibility to adjust that. Some examples:
htmltopdf_options['windowSize']:[1440, 780], for the size of the wndow used by the browser on the serverhtmltopdf_options['userAgent']:YesWiki/4.0htmltopdf_options['startupTimeout']:30, (in seconds) for the waited time to start the browser (usually some milli-seconds)htmltopdf_options['sendSyncDefaultTimeout']:10000, (in milli-seconds) for the waited time for the page rendering (usually some seconds)
- if using
chromiumbehind reverse proxy (that it could be the case is using a Docker container), it could be needed to configure the optionhtmltopdf_base_urlvia ftp to indicate the local address of the website for the reverse proxy. - example, if website's address in local network for HTTPD server (Nginx/Apache) in Docker container ishttp://localhost:8080/?, then this address should be used forhtmltopdf_base_urlparameter while keeping'base_url' => 'https://example.com/?', website's address on the internet
?> For developers, the full liste of available parameters is defined in the tools/publication/vendor/chrome-php/chrome/src/Browser/BrowserProcess.php file, in methods start() and getArgsFromOptions().
?> When it is not possible to use chromium on the wiki (no administrator access rights, no php extension ext-sockets, etc), it is possible to use publication extension of another yeswiki.
For this:
- define into page GererConfig in part
publication, parameterhtmltopdf_service_url, the address of a YesWiki with extension publication (ex. : https://yeswiki.net/?AccueiL/pdf). The important is to furnish the path to the handler/pdf - contact administrator of the concerned website to ask to add the current ueswiki's domain to the list of authorized domains.
- the concerned adminsitrator will have to modify the parameter
htmltopdf_service_authorized_domainsinto page GererConfig, partpublication(examples of possibles values :['example.com']or['example.com','wiki.example.com','example.net'])
- the concerned adminsitrator will have to modify the parameter
If print page does not display in iframe, it is possible that server constraints of security prevent its display.
To authorize it, go as admin in page page GererConfig in part Main parameters and add 'pdf','pdfiframe' to possible values in parameter allowed_methods_in_iframe.
See french help at this address