Lurch web app user interface

Module

Shells

In a Lurch document, certain sections will be marked as "shells." These will always be DIVs and will typically contain other document content. While atoms (as defined in the Atoms module) are indivisible sections of special, meaningful document content, shells are also special, meaningful document content, but are not indivisible. They are intended to contain other document content.

  1. The user can edit what sits inside a shell, but the application determines how the shell is drawn as a visual wrapper around that content.
  2. The user can edit the shells's properties by clicking on it (the visual boundary around the content, not the content itself) and interacting with whatever dialog the application pops up in response.
  3. There can be many different types of shells. For example, a theorem statement may be one type, and a proof or subproof may be another.
  4. Like atoms, each shell will typically have some meaning that will be important when the document is processed in a mathematical way.

Shells are implemented as a subclass of Atoms, overriding some functions in the Atom class that must be done in a different way for shells, and adding new functions that apply only to Shells.

This module contains tools for working with shells, including the function we use to install their mouse event handlers and, most importantly, the class we use to create an API for working with individual shells.

Source

Classes

Axiom
Corollary
Definition
Lemma
Premise
Preview
Proof
Recall
Rule
Shell
Subproof
Theorem

Methods

static

install(editor)

This function should be called in the editor's setup routine. It installs several things into the editor:

  • a menu item for inserting "environments" (untyped shells)
  • an event handler for deleting empty environments (which can occur if the user creates an environment, leaves it empty, and then positions their cursor after it and hits backspace---a corner case, but still one we must handle correctly)
  • two menu items for inserting blank paragraphs before and after the current block, so that the user does not get stuck unable to move their cursor after the last shell in the document, or before the first, or between two adjacent ones
  • an autocompleter shortcut that replaces \{ with an "environment" (an untyped shell)

Parameters

  • editor tinymce.Editor

    the editor in which to install the features described above

Source