Documentation
¶
Overview ¶
Package editor ships a small, dependency-free code editor for glaze WebViews: line numbers, syntax highlighting, autocompletion, error marks and bracket matching, in plain embedded HTML/CSS/JS — no CDN, no framework, nothing fetched at runtime, so a single-binary app stays a single binary.
The page side is one JS class, GlazeEditor (see editor.js for its API), plus pluggable language definitions; Filo and SQL ship in lang/. The Go side only hands the app the assets to serve or inline:
js, _ := editor.JS("filo") // core + the filo definition
css := editor.CSS()
mux.Handle("/editor.js", ...) // or inline in the page
An app then instantiates it from its own page:
<div id="ed" style="height: 20em"></div>
<script>
const ed = new GlazeEditor(document.getElementById("ed"),
{language: "filo", completions: ["self-x", "seek"]});
</script>
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSS ¶
func CSS() []byte
CSS is the editor's stylesheet. Theme it by overriding the CSS variables declared on .ge (see editor.css).
Types ¶
This section is empty.