npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mw-ocg-texter

v0.3.3

Published

Converts mediawiki collection bundles (as generated by mw-ocg-bundler) to plaintext

Downloads

7

Readme

mw-ocg-texter

NPM

Build Status dependency status dev dependency status

Converts mediawiki collection bundles (as generated by mw-ocg-bundler) to stripped plaintext.

This is a proof-of-concept, but it could be used to archive or embed the textual content of wikipedia in a minimal amount of space.

Installation

Node version 0.8 and 0.10 are tested to work.

Install the node package dependencies.

npm install

Install other system dependencies.

apt-get install unzip

Generating bundles

You may wish to install the mw-ocg-bundler npm package to create bundles from wikipedia articles. The below text assumes that you have done so; ignore the mw-ocg-bundler references if you have bundles from some other source.

Running

To generate a plaintext file named out.txt from the en.wikipedia.org article "United States":

$SOMEPATH/bin/mw-ocg-bundler -v -o us.zip -h en.wikipedia.org "United States"
bin/mw-ocg-texter -o out.txt us.zip

In the above command $SOMEPATH is the place you installed mw-ocg-bundler; if you've used the directory structure recommended by mw-ocg-service this will be ../mw-ocg-bundler.

The default format does 80-column word wrap. If you would like to use "semantic" new lines (that is, newlines end paragraphs and there are no newlines within paragraphs) use the --no-wrap option:

bin/mw-ocg-texter --no-wrap -o out.txt us.zip

For other options, see:

bin/mw-ocg-texter --help

Standalone mode

To convert a single article without the bundle creation step, use:

bin/mw-ocg-texter -h en.wikipedia.org -t "United States"

The -h option specifies the hostname of the wiki, and the -t option gives the title to convert. The content will be fetched from the Wikimedia REST API and converted, with output to standard out (unless the -o option is given).

Other ideas

This backend should implement the Unicode Nearly Plain-Text Encoding of Mathematics to render math content.

Related Projects

License

GPLv2

(c) 2013-2014 by C. Scott Ananian