Extension:EPubExport

The ePubExport extension is based on Pdf Export extension. ePubExport adds a new link to the left nav menu named "export ePub". Clicking this link generates an epub file to read offline in electronic book or tablet. In addition, a new special page is added, "ePub Export". This special page enable to create an epub file from group of Wikimedia pages.

The extension uses the epub PHP library. epub library uses the Zip PHP library both libraries are by by Asbjorn Grandt. Both are included in the ePubExport download.

Download
Download of the preferred archive file can be done from here. Currently there are tar.gz, bz2, rar and zip archives.

SVN is also available. Trunk is in https://svn.code.sf.net/p/epubexport/code/trunk/ePubExport/

Installation
To install this extension, extract the file in the extensions folder, then add the following to LocalSettings.php:

Directory tree should be as follow: extensions |      +->ePubExport |                 +-->epub |    |                  |     +-> EPub.php |    +-> EPubChapterSplitter.php |    +-> Zip.php |                 +-->fonts |    |                  |     +-> LICENSE |    +-> DejaVuSans.ttf |    +-> DejaVuSans-Bold.ttf |    +-> DejaVuSans-BoldOblique.ttf |    +-> DejaVuSans-Oblique.ttf |                 +-> ePubExport.i18n.alias.php +-> ePubExport.i18n.php +-> ePubExport.php +-> ePubExport_body.php

User-defined CSS file
Site administrator may change the default epub CSS to another file. In LocalSettings.php, just bellow the "require_once("$IP/extensions/ePubExport/ePubExport.php");" line, add.

For example:

Embedding Fonts
For non-english wiki sites, as there is no way to know what will be the reading device, and if it has the font for the specific language or not, it is always a good idea to embed the fonts in the epub file. It does increase the size of the file, but it is readable.

ePubExport come with DejaVuSans fonts that support many languages. In order to embed these fonts in the epub file, the following configuration is required, because the font will not be embedded by default.

In LocalSettings.php, just below the " " line, add

Fonts Supported Languages
The DejaVuSans fonts cover the following languages: Afar, Abkhazia, Afrikaans, Akan, Aragonese, Arabic, Asturian/Bable/Leonese/Asturleonese, Avaric, Aymara, Azerbaijani in Azerbaijan, Azerbaijani in Iran, Bashkir, Byelorussian, Berber in Algeria, Berber in Morocco, Bulgarian, Bislama, Edo or Bini, Bambara, Breton, Bosnian, Buriat (Buryat), Catalan, Chechen, Chamorro, Mari (Lower Cheremis / Upper Cheremis), Corsican, Crimean Tatar/Crimean Turkish, Czech, Kashubian, Old Church Slavonic, Chuvash, Welsh, Danish, German, Ewe, Greek, English, Esperanto, Spanish, Estonian, Basque, Persian, Fanti, Fulah (Fula), Finnish, Filipino, Fijian, Faroese, French, Friulian, Frisian, Irish, Scots Gaelic, Galician, Guarani, Manx Gaelic, Hausa, Hawaiian, Hebrew, Hiri Motu, Croatian, Upper Sorbian, Haitian/Haitian Creole, Hungarian, Armenian, Herero, Interlingua, Indonesian, Interlingue, Igbo, Inupiaq (Inupiak, Eskimo), Ido, Icelandic, Italian, Inuktitut, Javanese, Georgian, Kara-Kalpak (Karakalpak), Kabyle, Kikuyu, Kuanyama/Kwanyama, Kazakh, Greenlandic, Kanuri, Kurdish in Armenia, Kurdish in Iraq, Kurdish in Iran, Kurdish in Turkey, Kumyk, Komi (Komi-Permyak/Komi-Siryan), Cornish, Kwambi, Kirgiz, Latin, Luxembourgish (Letzeburgesch), Lezghian (Lezgian), Ganda, Limburgan/Limburger/Limburgish, Lingala, Lao, Lithuanian, Latvian, Malagasy, Marshallese, Maori, Macedonian, Mongolian in Mongolia, Moldavian, Malay, Maltese, Nauru, Norwegian Bokmal, Low Saxon, Ndonga, Dutch, Norwegian Nynorsk, Norwegian (Bokmal), Ndebele, South, Northern Sotho, Navajo/Navaho, Chichewa, Occitan, Oromo or Galla, Ossetic, Papiamento in Netherlands Antilles, Papiamento in Aruba, Polish, Portuguese, Quechua, Rhaeto-Romance (Romansch), Rundi, Romanian, Russian, Kinyarwanda, Yakut, Sardinian, Scots, North Sami, Selkup (Ostyak-Samoyed), Sango, Serbo-Croatian, Secwepemctsin, Slovak, Slovenian, Samoan, South Sami, Lule Sami, Inari Sami, Skolt Sami, Shona, Somali, Albanian, Serbian, Swati, Sotho, Southern, Sundanese, Swedish, Swahili, Tajik, Turkmen, Tagalog, Tswana, Tonga, Turkish, Tsonga, Tatar, Twi, Tahitian, Tuvinian, Uighur, Ukrainian, Uzbek, Venda, Vietnamese, Volapuk, Votic, Walloon, Sorbian languages (lower and upper), Wolof, Xhosa, Yapese, Yiddish, Yoruba, Zhuang/Chuang and Zulu

User-defined fonts
If the default fonts ars not fit or not support the wiki language, it is possible to embed another fonts. To do so, the  property must be set to.

Then, specify the fonts source as follows:

Font license is embedded as follows:

For example:

NOTE: ''Using user-defined font require user-defined CSS. ePubExport does not enforce that, but it won't work without CSS that defines and use the user-defined fonts''.

Full Support
These languages are used both in the Mediawiki text and menus as well as in the epub file itself.
 * English
 * Hebrew
 * Russian
 * Dutch
 * French
 * German
 * Italian
 * Portuguese

Partial Support
These languages are used both in the Mediawiki text and menus as well as in the epub file itself. However, there are still several texts here and there that are not yet updated.
 * Polish

Will Maybe Work
All the languages listed in the Fonts Supported Languages section have no support in Mediawiki text and menus, but the epub file will probably created successfully.

MediaWiki 1.39.x LTS Test Plan
The items listed here are general issues related to MediaWiki 1.39.x LTS. They are not addressing any issues that are specific to this extension.


 * Extension considered active for MediaWiki 1.39.x LTS