Difference between revisions of "Build your ZIM file"

From openZIM
Jump to: navigation, search
Line 24: Line 24:
 
# Checkout the dumping tools : svn co http://kiwix.svn.sourceforge.net/viewvc/kiwix/dumping_tools/
 
# Checkout the dumping tools : svn co http://kiwix.svn.sourceforge.net/viewvc/kiwix/dumping_tools/
 
# Install all necessary Perl modules
 
# Install all necessary Perl modules
# run the script like following: ./buildZimFileFromDirectory.pl --htmlPath=./html [--indexerPath=./zimindexer] [--zimFilePath=articles.zim]
+
# run the script like following (arguments in [] are optionals):
 
+
<pre>
 +
buildZimFileFromDirectory.pl --htmlPath=./html --welcomePage=index.html --favicon=images/favicon.png --language=fra --title=foobar<br/> --creator=foobar --publisher=wmf --description=mydescription [--dbUser=foobar] [--dbPassword=testpass] [--writerPath=./zimWriter]<br/>  [--zimFilePath=articles.zim] [--dbName=kiwix_db] [--dbPort=5432] [--dbHost=localhost] [--rewriteCDATA] [--mediawikiOptim] [--shortenUrls]<br/>  [--removeUnusedRedirects] [--strict] [--avoidForceHtmlCharsetToUtf8] [--compressAll] [--doNotDeleteDbAtTheEnd] [--doNotIgnoreFiles]
 +
</pre>
 
=== Wiki2html ===
 
=== Wiki2html ===
 
[[Wiki2html]] can be used to prepare static HTML files from a running Mediawiki instance.
 
[[Wiki2html]] can be used to prepare static HTML files from a running Mediawiki instance.

Revision as of 15:05, 24 January 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:

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<br/> --creator=foobar --publisher=wmf --description=mydescription [--dbUser=foobar] [--dbPassword=testpass] [--writerPath=./zimWriter]<br/>  [--zimFilePath=articles.zim] [--dbName=kiwix_db] [--dbPort=5432] [--dbHost=localhost] [--rewriteCDATA] [--mediawikiOptim] [--shortenUrls]<br/>  [--removeUnusedRedirects] [--strict] [--avoidForceHtmlCharsetToUtf8] [--compressAll] [--doNotDeleteDbAtTheEnd] [--doNotIgnoreFiles]

Wiki2html

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

See also