editor

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package editor ships the in-place editing script injected into pages viewed by logged-in editors, plus a vendored copy of TinyMCE 6.8.6 (the final MIT-licensed release; see tinymce/license.txt) that provides the WYSIWYG behavior for rich HTML regions. TinyMCE runs in inline mode, so content is edited directly in the page using the page's own styles, and everything is self-hosted from the module — no CDN, and no build step for consumers.

editor.js is generated: the source lives in src/ as ES modules and is bundled by the build tool in build/ (a nested Go module wrapping esbuild, so it never enters consumers' dependency graphs). After editing anything under src/, regenerate the committed artifact with `go generate ./editor` — or `go run -C editor/build . -watch` for a rebuild-on-save loop while developing.

The glue script's own chrome (toolbar, media picker) lives in Shadow DOM, isolated from host-page CSS. TinyMCE's floating UI uses tox- prefixed classes in the light DOM. TinyMCE loads lazily, only when an editor actually presses "Edit page".

Index

Constants

View Source
const PathPrefix = "/cms/editor/"

PathPrefix is the public route the editor assets are served under.

Variables

This section is empty.

Functions

func Handler

func Handler() http.Handler

Handler serves the editor script and the vendored TinyMCE files. Mount it at PathPrefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL