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
chromium
software on the server - or to use another YesWiki which already disposes of
chromium
Prerequisite:
- dispos of a
ssh
access to the server- dispose of administrative command line access to the server
- dispose of a server with PHP extension
ext-sockets
activated
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 chromium
Once the installation is finished, it is possible to check the installation path with this command line :
which chromium
It 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
ftp
software to acces to the server to modify the content ofwakka.config.php
file or into page GererConfig in partpublication
(but only few parameters are avaialable). Parameterhtmltopdf_options
gives 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.0
htmltopdf_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
chromium
behind reverse proxy (that it could be the case is using a Docker container), it could be needed to configure the optionhtmltopdf_base_url
via 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_url
parameter 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_domains
into 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