$ cnpm install mwoffliner
MWoffliner is a tool for making a local offline HTML snapshot of any online Mediawiki instance. It goes through all articles (or a selection if specified) and writes the HTML/images to a local directory. It has mainly been tested against Wikimedia projects like Wikipedia, Wiktionary, ... But it should also work for any recent Mediawiki.
It can write the raw HTML/JS/CSS/PNG... files to the filesystem or pack them all in a highly compressed ZIM file.
Read CONTRIBUTING.md to know more about MWoffliner development.
See Environment setup hints to know more about how to install them.
To install MWoffliner globally:
npm i -g mwoffliner
You might need to run this command with the sudo
command, depending
how your npm
is configured.
Then to run it:
mwoffliner --help
MWoffliner provides also an API and therefore can be used as a NodeJS library. Here a stub example:
const mwoffliner = require('mwoffliner');
const parameters = {
mwUrl: "https://es.wikipedia.org",
adminEmail: "foo@bar.net",
verbose: true,
format: "nozim",
articleList: "./articleList"
};
mwoffliner.execute(parameters); // returns a Promise
Complementary information about MWoffliner:
Install NodeJS:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && \
source ~/.bashrc && \
nvm install stable && \
node --version
Install Redis:
brew install redis
Install libzim: Read these instructions
Install NodeJS:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && \
source ~/.bashrc && \
nvm install stable && \
node --version
Install Redis:
sudo apt-get install redis-server
package.json
:package: Release version vX.X.X
git tag vX.X.X
git push origin master --tags
GPLv3 or later, see LICENSE for more details.
Copyright 2014 - 2017 © taobao.org |