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.

The main idea is to consider, as the epub file standard does, the book as a some pages around a structured table of contents with some metadata about it (title, author...). The metadata and the table of content are stored in a page of main namespace and parts of the book are subpages of this page.

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 let the wiki store "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.
 * 5) The extension must provide an API to retrieve metadata about the book.

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, Universal Decimal Classification identifier...), an introduction, a conclusion and a structured list of its parts. So, a good way to implement book structure is maybe to provide a standardized way to set up metadata, list of chapters, introduction and conclusion 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 shows inputs for setting metadata, wikitext fields for the introduction and the conclusion of the book and a place to setup easily the table of contents. This table of content is a tree of links with their labels, this links must points to a subpage of the main page and can contain anchor to link to a specific title of the page. The rendering of the page from these data is done by the extension but the html output must be design to be easily styled by wikis that want to keep their own graphic chart.

The others pages are subpages of the main page, and they contain free wikitext as usual (this wikitext may contain, between other thinks found instruction of transclusion from Page namespace of Wikisources). The main page edition mode may provide a wait to edit subpages without leaving the main page. A navigation system is setup automatically by the extension in order to allow an easy navigation inside of the book.

The rendered mainpage may also contain a toolbar in order to export the book in pdf and epub. This export may be done by Collection or by an improved version of Wsexport integrated in the extension.

Technical proposal
TO BE WRITTEN