Class: SquibView

The main editor class that provides a live-rendering editor for various content types.

Constructor

newSquibView(element, options)

Parameters

ParameterTypeDescription
elementHTMLElement | stringThe DOM element or CSS selector where the editor will be mounted
optionsObjectConfiguration options for the editor (see Options)

Example

// Create editor with default optionsconst editor = newSquibView('#editor');

// Create editor with custom optionsconst editor = newSquibView('#editor', {
  initialContent: '# Hello World',
  inputContentType: 'md',
  initialView: 'split',
  showControls: true,
  showLineNumbers: true
});

Static Properties

SquibView.version

Returns version information for the library.

console.log(SquibView.version);
// { version: '1.0.18', url: 'https://github.com/...' }

SquibView.defaultOptions

Default configuration options for new instances.

{
  initialContent: '',
  inputContentType: 'md',
  showControls: true,
  titleShow: false,
  titleContent: '',
  initialView: 'split',
  baseClass: 'squibview',
  preserveImageTags: true,
  showLineNumbers: false,
  lineNumberStart: 1,
  lineNumberMinDigits: 2,
  autoload_deps: null
}

SquibView.DEFAULT_CDN_URLS

Default CDN URLs for autoloading external dependencies.

Instance Properties

PropertyTypeDescription
containerHTMLElementThe container element
inputHTMLTextAreaElementThe source input textarea
outputHTMLElementThe rendered output element
currentViewstringCurrent view mode (‘src’, ‘html’, ‘split’)
inputContentTypestringCurrent content type (‘md’, ‘html’, ‘reveal’, ‘csv’, ‘tsv’)
revisionManagerRevisionHistoryRevision history manager
eventsTinyEmitterEvent emitter for plugin communication

Core Methods

Content Management

View Control

Content Type

Revision Management

Selection & Copy

Renderer System

Events

Events

See Events Documentation for complete event reference.

Core Events

See Also