Difference between revisions of "Build your ZIM file"

From openZIM
Jump to navigation Jump to search
(→‎Developers: + zimwriterfs)
Line 14: Line 14:
* [http://www.mediawiki.org/wiki/Extension:Collection Get the extension]
* [http://www.mediawiki.org/wiki/Extension:Collection Get the extension]
* [http://www.mediawiki.org/wiki/Extension:Collection/openZIM Details on Collection and openZIM]
* [http://www.mediawiki.org/wiki/Extension:Collection/openZIM Details on Collection and openZIM]
=== zimwriterfs ===
zimwriterfs is a console tool to create ZIM files from a localy stored directory containing a "self-sufficient" HTML content (with pictures, javascript, stylesheets). The result will contain all the files of the local directory compressed and merged in the ZIM file. Nothing more, nothing less. zimwriterfs works, for now only, on POSIX compatible systems. You simply need to compile it and run it. The software does not need a lot of resources, but if you create a pretty big ZIM files, then it could take a wile to complete. [https://sourceforge.net/p/kiwix/other/ci/master/tree/zimwriterfs/ Go to zimwriterfs source code repository].


=== zimwriterdb ===
=== zimwriterdb ===

Revision as of 10:28, 20 November 2013

The Wikipedia Book Creator is the easiest way to create custom ZIM files from Wikipedia

A few tools allow people to create ZIM files.

Users

You can create on Wikipedia and all other Wikimedia projects, ZIM files of article selections. For example on http://en,wikipedia.org. This is based on the MediaWiki Collection Extension (see below).

Developers

An example approach to create a ZIM file

MediaWiki Collection Extension

The Collection extension for MediaWiki provides the ability to select articles and export them in different formats, such as PDF, ODF and ZIM. The main purpose of Collection extension is to create printed books - instead of export you can also choose to have the selected articles printed on demand as a real book.

The Collection extension can be easily added to any MediaWiki installation:

zimwriterfs

zimwriterfs is a console tool to create ZIM files from a localy stored directory containing a "self-sufficient" HTML content (with pictures, javascript, stylesheets). The result will contain all the files of the local directory compressed and merged in the ZIM file. Nothing more, nothing less. zimwriterfs works, for now only, on POSIX compatible systems. You simply need to compile it and run it. The software does not need a lot of resources, but if you create a pretty big ZIM files, then it could take a wile to complete. Go to zimwriterfs source code repository.

zimwriterdb

zimwriterdb is part of the openZIM project. This binary uses a pre-filled Postgres Database and create the corresponding ZIM file. Only buildZimFileFromDirectory.pl (see below) is for now able to fill the database.

buildZimFileFromDirectory.pl

This script is part of the Kiwix tools and allows to build a ZIM file from a HTML directory containing all necessary ressources.

You need:

  1. Checkout the dumping tools : svn co http://kiwix.svn.sourceforge.net/viewvc/kiwix/dumping_tools/
  2. Install all necessary Perl modules
  3. run the script like following (arguments in [] are optionals): buildZimFileFromDirectory.pl --htmlPath=./html --welcomePage=index.html --favicon=images/favicon.png --language=fra --title=foobar --creator=foobar --publisher=wmf --description=mydescription [--dbUser=foobar] [--dbPassword=testpass] [--writerPath=./zimWriter] [--zimFilePath=articles.zim] [--dbName=kiwix_db] [--dbPort=5432] [--dbHost=localhost] [--rewriteCDATA] [--mediawikiOptim] [--shortenUrls] [--removeUnusedRedirects] [--strict] [--avoidForceHtmlCharsetToUtf8] [--compressAll] [--doNotDeleteDbAtTheEnd] [--doNotIgnoreFiles]

Wiki2html

Wiki2html can be used to prepare static HTML files from a running Mediawiki instance.

See also