Skip to content

Editing Pages

A BookStack page is written in one of two editors, chosen per page, and the honest summary is: most people should use the visual one, and people who already think in Markdown should use the other. Both were exercised in this guide's lab; the pumpkins page was written in the visual editor and the composting page in Markdown, and both live side by side in the same chapter.

Drafts first, publishing second

A new page begins life as a draft. Drafts autosave as you type and are visible to you (and to admins watching the book), not to ordinary readers. Publishing is a deliberate act — the editor's save button — and the moment you press it the page takes its place in the book.

This split is the feature to teach every new contributor: you cannot break the published library by starting a page. The lab proved the boundary from the outside in chapter 8: a reader with no create permission who asked for the new-page address was turned away and no draft appeared.

The visual editor

The default editor behaves like a simple word processor: a toolbar for headings, bold, lists, tables, links and images, applied to text you can see formatted as you write. Three habits make pages age well in it:

  • Use real headings, in order, instead of big bold text. Headings become the page's outline and its anchors.
  • Link to sibling pages rather than repeating their content. One fact, one home.
  • Keep paragraphs short. A wiki page is read on a screen, usually by someone standing in a shed.

The Markdown editor

Switch a page's editor and the same content is edited as Markdown text, with a live preview beside it. Writers who live in Markdown get the plain-text source they can copy, diff and keep elsewhere. The lab's composting page was written this way; BookStack stores the Markdown source (it is recorded on the page, editor and all) and renders it to HTML for readers.

Switching editors on an existing page is allowed and converts the content; do it deliberately, not experimentally, on a page you care about — conversions of fancy visual-editor content into Markdown can be lossy.

Images

Images go into a page through the editor's image button, which opens the gallery: upload the file, and BookStack stores it under public/uploads/images, generates thumbnail sizes, and inserts it where your cursor was. The lab's specimen — a small diagram of a pumpkin, drawn on the build machine — uploaded cleanly, gained its thumbnails, and answered at its own image address like any web file.

Two plain warnings. First, uploaded images are files, not database rows: they belong to the files half of the backup in chapter 10. Second, the optional Exif PHP extension exists so uploaded photos are rotated the way the camera intended; if your group's photos arrive sideways, that extension is the first place to look.

When a page goes wrong: revisions

Every published save creates a revision. Open a page's revisions and you can view an older version and restore it. This is the undo that makes a shared wiki safe to let people loose in: nothing published is ever truly lost by an edit, only by a deletion — and deletions go to a recycle bin an admin can empty or restore from.

Attachments

A page can also carry file attachments — the form the minutes were signed on, the spreadsheet behind the table. Attachments live in storage/uploads. Use them for files that belong to that page's story; for a general pile of files, use a file store (chapter 1 said it, and it bears repeating at the point of temptation).