Extension:Collection

The Collection extension allows a user to organize personal selections of pages in a collection. Collections can be:


 * edited and structured using chapters
 * persisted, loaded and shared
 * ordered as a printed book at https://pediapress.com/

At one time they could also be:


 * rendered as PDF (see )
 * exported as ODF Text Document (see )
 * exported as DocBook XML (see )
 * exported as [https://openzim.org/ ZIM file] (see )
 * exported as ePub file (ebook)

See the press release 1>wmf:Special:MyLanguage/Wikis Go Printable|Wikis Go Printable for more information on the original project.

Documentation & Support
The Collection extension used to use the 1>Special:MyLanguage/OCG|Offline Content Generator service to do most of its heavy lifting, but the OCG has been withdrawn.

You can use the [<tvar|url>https://lists.wikimedia.org/mailman/listinfo/services</> services] mailing list to get in touch with OCG developers. They can also be found on IRC:


 * Server: irc.freenode.net
 * Channel: <tvar|1> </> or <tvar|2> </>

Use the <tvar|1> </>, <tvar|2> </>, or <tvar|3> </> projects in <tvar|4></> in order to report bugs.

A detailed guide on how to prepare your wiki (templates, help pages, categories) if you setup the extension is available at <tvar|1>meta.wikimedia.org</>.

mwlib
Older versions of the Collection extension used the <tvar|1> </> library. Documentation for <tvar|1> </> can be found at <tvar|2>http://mwlib.readthedocs.org/</>, and there is a [<tvar|url>http://groups.google.com/group/mwlib</> Google group] for support and discussion of <tvar|1> </> and <tvar|3> </>. <tvar|1> </> developers have also been spotted on the pediapress IRC channel:


 * Server: irc.freenode.net
 * Channel: #pediapress

Screencast
There is a screencast demoing the basic functionality available at [<tvar|url>https://www.youtube.com/watch?v=BCdYUxKsU64</> YouTube] (in German) (2:45 minutes).

Creating cross-wiki article collections
The OCG service supported this, but the Collection extension does not (yet — patches welcome!). You can use the low-level <tvar|1> </> and <tvar|2> </> tools to create cross-wiki collections, or use <tvar|3>https://pediapress.com/collection/</> for this purpose, see [<tvar|url>https://web.archive.org/web/20110722071259/http://code.pediapress.com/wiki/ticket/408</> ticket 408].

Installation
Please also read the included <tvar|1></> for detailed configuration instructions of the extension.

Configuration
''' The documentation below is out of date.   <tvar|1>Installing a development instance</> contains the most up-to-date documentation. '''

For the older mwlib-based service, see <tvar|1>Installation and Configuration of the Collection Extension</> and <tvar|2>Customization via System Messages</>.

Generating PDFs, OpenDocument- & DocBook-Exports
It's easy to enable PDF (ODF, DocBook) support with this extension. It is configured by default to use the server <tvar|1>https://tools.pediapress.com/</>. Therefore (low traffic) sites that are accessible from the internet don't need to install their own 1>Special:MyLanguage/Extension:PDF Writer</>|PDF server. Steps:


 * Simply install and configure the Collection extension using the default value <tvar|1> </> for <tvar|2> </> (see for instructions) and make sure the 4>Special:MyLanguage/API:Main page</>|MediaWiki API (<tvar|5> </>) is enabled on your MediaWiki installation.
 * Some users report that installing PDFtk is necessary.

No installation of Python, ReportLab, mwlib etc. required! Note however, that in order to use this service, your wiki must be accessible from the internet and must be either accessible for non-logged-in users or login credentials must be configured (see <tvar|1></> for instructions).

Have a look at the 1>Media:Solar system final.pdf</>|Solar system, example article from the English language Wikipedia, rendered as PDF using this technology.

Set up your own render server
If you either have a wiki which is not accessible from the outside or your site has high traffic, you need to install your own render server. The server is included with <tvar|1>mwlib</> and can be used as a stand-alone HTTP server (which is the default protocol) or as FastCGI or SCGI server or as a CGI script.

Requirements and steps
Installing mwlib has a [<tvar|url>https://mwlib.readthedocs.org/en/latest/installation.html#installation-instructions-for-ubuntu-10-04-lts</> number of additional prerequisites]. Please refer to the [<tvar|url>https://mwlib.readthedocs.org/en/latest/installation.html#installation-of-mwlib</> official installation documentation]. Guides for your specific environment may also be useful, see below.

Other guides

 * For documentation on how to do this on Ubuntu 14.04 look on 1>Special:MyLanguage/Setup a render server on Ubuntu 14.04 LTS</>|Setup a render server on Ubuntu 14.04 LTS.
 * For documentation on how to do this on OSX Mavericks look on Setup a render server on OSX. There are useful tips for localhost installations for other systems too.
 * [<tvar|url>https://edutechwiki.unige.ch/en/Mediawiki_collection_extension_installation</> A comprehensive guide about Extension:Collection installation and configuration] with instructions for installing on local machines - by edutechwiki (TECFA, University of Geneva).

Advanced and optional configuration
Most wikis will never need to know about what follows. Check the to see all the global variables you can configure and their meaning. Some of them are useful to tweak the export in many cases.

Print on demand
Since version 1.6 (<tvar|1>r113740</>) the extension offers the variable <tvar|2> </> that is used to define available providers of the print-on-demand service.

By default it uses PediaPress service: It is an array of elements, every of them will be listed as a possible print-on-demand provider. The parameters are:


 * name
 * short name of the provider


 * url
 * URL to point for more information if there is no information page


 * posturl
 * URL of the actual printing web service


 * infopagetitle
 * 1>Special:MyLanguage/Help:System message</>|MediaWiki system message name (as visible in the MediaWiki: namespace) that contains page title of the page that will be used to shortly describe the provider. The default (for PediaPress) is <tvar|1>MediaWiki:Coll-order info article</>, which defaults to PediaPress order information.  If this page exists, it is used to display information about PediaPress book printing service.

It is also possible to disable print on demand altogether by setting:

Please see <tvar|1></> and 2>Special:Code/MediaWiki/113740</>|commit entry for more information about this feature.

You can also configure which file formats are available:

See <tvar|1></> for more configuration options.

User rights for saving books
To allow users to save books in both their user space and the community space, add the following lines to your <tvar|1> </>:

Add the links at another place
If you want to add the links at another place, e.g. in the menu "Personal Tools", you can do that by adding them into the according portlet. For example, in the Vector skin you can do that by adding to the file <tvar|1> </> so that it looks like this:

You can still modify the order of the links in the portlet by modifying <tvar|1>$personalTools</> directly before the <tvar|2>foreach</> loop is executed.

The above implementation has the drawback, that the two newly inserted links do not show their tooltip. A solution for that is still outstanding and would be greatly appreciated.

Setting book prefix
To change the default prefix for book name edit the message <tvar|1>MediaWiki:Coll-community book prefix</>.

Cache
Recent versions store rendered "books" in a cache. Collections which have been previously exported by users should be available for download almost immediately, rather than after several minutes of rendering; the cached version can be updated by following a link offered in the download page.

Help improving the extension
If you want to help to make the extension better, you can:


 * open a task for a bug or feature request,
 * please also test <tvar|1>BugTriage-Collection</> and <tvar|2>BugTriage-mwlib</>;
 * fix and add translations using <tvar|1>translatewiki.net</>.

Printed Books with PediaPress
<tvar|1>PediaPress</> is a service that offers printed books based from wiki content. This service is seamlessly integrated in this extension (can be disabled).