GitHub mirror of MediaWiki extension Collection/OfflineContentGenerator/bundler - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
lib
samples
test
.gitignore
.gitreview
.jscsrc
.jshintignore
.jshintrc
.travis.yml
AUTHORS.md
CHANGELOG.md
CODE_OF_CONDUCT.md
README.md
package.json

README.md

mw-ocg-bundler

NPM

Build Status dependency status dev dependency status

A mediawiki article spider tool.

This tool grabs all the dependencies for a given set of articles and creates a directory or zip file. The format is documented at https://www.mediawiki.org/wiki/PDF_rendering/Bundle_format

Installation

Node version 0.8 and 0.10 are tested to work.

Install the node package depdendencies with:

npm install

Install other system dependencies.

apt-get install zip

Running

To generate a bundle for the en.wikipedia.org article United States:

bin/mw-ocg-bundler -v -o bundle.zip -h en.wikipedia.org "United States"

To generate a bundle for a collection of articles about the inner planets:

bin/mw-ocg-bundler -v -o bundle.zip -h en.wikipedia.org --title Planets Mercury Venus Earth Mars

If you have a book specification (in the form of metabook.json and nfo.json files), use:

bin/mw-ocg-bundler -v -o bundle.zip -m metabook.json -n nfo.json

For non-interactive use feel free to remove the -v flag.

If you are running a local mediawiki instance, use appropriate -h, --parsoid-api, and --php-api options to point at your local wiki and local Parsoid installation:

bin/mw-ocg-bundler -v -o bundle.zip -h localhost --parsoid-api http://localhost:8142 --php-api http://localhost/api.php "Main Page"

Note that the argument to -h must match the "domain" you've configured in Parsoid's localsettings.js and MediaWiki's $wgVirtualRestConfig; it doesn't necessarily need to be a valid DNS domain. See Visual Editor's configuration guide for more details.

For other options, see:

bin/mw-ocg-bundler --help

There are several rendering backends which take bundles in this format as inputs. See mw-ocg-latexer, for instance, which generates PDFs of mediawiki articles via XeLaTeX, and mw-ocg-texter which generates plaintext versions of mediawiki articles.

License

Copyright (c) 2013-2014 C. Scott Ananian

Licensed under GPLv2.