Requests for comment/Book management

See also a draft RfC for a combined plan for the three Wikisource-related GSoC projects

Create an extension to help wikis (WMF-hosted and otherwise) that host book content, such as Wikisource or Wikibooks. There is currently no extension of the sort implemented on these projects, although Extension:BookManager was initially created for this same purpose. This is a part of a Google Summer of Code project. More detailed information on the project can be found at Book management 2013.

Current system
This is somewhat different between Wikisource and Wikibooks because of the nature of their content, but I'll follow a typical Wikisource progression:
 * 1) Upload scans to Commons
 * 2) Create the "source" or "index" page for the work: a page that contains various metadata, as well as structures some of the page. (example, source) Although this does allow for a table of contents and sectionized page lists, like in the example, these must be formatted by hand.
 * 3) Create subpages for each section or chapter
 * 4) Include each page of the scan in the appropriate chapter using   tags (example, source)
 * 5) Add a header template (the green box) to each page, manually filling out the previous, next, and other parameters. Wikisource has several of these templates; Wikibooks has even more.

On Wikibooks, content is added directly to the subpages, without uploading scans or including them in the subpages using the pages index tags. Effectively, steps 1, 2, and 4 are skipped.

Bugs
The lack of support for book structures is relatively well-documented in Bugzilla.
 * – Wikibooks/Wikisource needs means to associate separate pages with books
 * – Separate reference page for glossaries, bibliographies, etc
 * – Option to protect all subpages and talk pages when protecting the page
 * – Protect, watchlist or delete a whole book at once
 * – Create a set of special pages for handling meta-organization of books
 * – List, count and search all books
 * – Per book, category and/or template CSS and JavaScript
 * – Make Collection extension to automatically create collections for existing books on Wikibooks/Wikisourcesa
 * – Wikisource related bugs and enhancements (tracking)
 * – Provide "Random page of this book" feature for use on Wikibooks projects

Proposed system

 * 1) Upload scans to Commons
 * 2) Fill out a form (see mockup) on the main book page containing metadata fields. Create sections using the buttons at the bottom; drag and rename as necessary. The sections can also be indented to create subsections. (Very basic demo just to show simple dragging)
 * 3) Enter page range into a field for each section, or choose to enter it manually (using the same   tags)
 * 4) Select an option to automatically generate header templates and include them on each page. (Header/navigation bar mockup)

On Wikibooks, steps 1 and 3 are skipped.

Design

 * Form demo
 * Navigation bar demo

Technical details
This will be implemented by storing the structure and metadata information in a JSON block on the main book page (see the proposed JSON schema). This block will contain the information necessary to create the header templates. The block will not be edited by users, but rather accessed through the form. The draggable sections in the organizational form will make use of jQuery UI's "sortable" interaction, and are thus dependent on JavaScript. The header templates also depend on JavaScript for the drop-down metadata and chapter listings.

Metadata
The following metadata will be included:
 * Author
 * Translator
 * Editor
 * Illustrator
 * Title
 * Alternate titles
 * Subtitle
 * Series title
 * Volume
 * Edition
 * Publisher
 * Printer
 * Publication date
 * Publication city
 * Language
 * Description
 * Source
 * Permission
 * Other versions
 * ISBN
 * LCCN
 * OCLC

Further improvements
I have a number of "if I have time" improvements planned after the main work of creating the extension is complete. These include:
 * Optionally auto-generate a table of contents
 * Allow an entire book to be exported/printed at once
 * One-click actions on the entire book
 * Watchlisting
 * Deleting
 * Moving
 * Protecting
 * View recent changes
 * Edit or view an entire book at once (on one page)