User:Tpt/Book

Abstract
Wikibook and Wikisource are two wikis that don't provide content based on the "article" entity but on a book entity that regroup more than one page. But MediaWiki software is done to provide a powerful system for a article-based contents. So Wikibook and Wikisource need a way to say to the software "this group of page is a book", but It's not possible currently. The goal of this proposal is to implement a MediaWiki extension that add to MediaWiki the support for the book entity and that will be usable by both Wikibook and Wikisource projects.

Requirements

 * 1) This extension must be adapted to both books written by contributors (Wikibook) and books written by some people and only reproduce in the wiki (Wikisource). So we need to say to the extension "this book is written by XXX" or "This book is written by the contributors of its parts". This can be done by providing metadata in the main page.
 * 2) This extension must be adapted to Wikisource workflow ie the proofreading system managed by the ProofreadPage extension. The ProofreadPage transclusion system must be compatible with this new extension.
 * 3) The extension must allow a petty easy migration from the current system and keep history of content.
 * 4) The extension must provide an easy way to export content offline using standards like epub.

Main idea
A book is, I think, mainly the regrouping of some parts contains in pages around a main page that contain metadata about the book (title, subtitle...) and the list of its parts. So, a good way to implement book structure is maybe to provide a standardized way to set up metadata and list of chapters in a Mediawiki page and put the parts of the books in sub-pages of this page.

The main page is not a standard main page with only a field of free text but structured page. The edition system will show inputs for setting metadata, text fields for the introduction and the conclusion of the book and a place to setup easily the table of contents. This main page edition mode may also allow to edit parts of the book easily.

The others pages are subpages of the main page, and they contain free text or instruction of transclusion from Page namespace of Wikisources.

Technical proposal
The main page is manage by a new Content type using the new ContentHandler feature. Data are stored as a json array link: