Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assets ¶
Assets returns the embedded filesystem containing CSS, JS, and templates. Use this with http.FileServer or to read individual files.
func CSS ¶
CSS returns the combined CSS for the editor (for consumers who want to serve it separately rather than inline).
func RenderEditor ¶
func RenderEditor(cfg EditorConfig) (template.HTML, error)
RenderEditor returns the complete editor HTML fragment — toolbar, textarea, fullscreen overlay, config script, CSS, and JS — ready to drop into a page.
Types ¶
type EditorConfig ¶
type EditorConfig struct {
PreviewEndpoint string // required: URL for live preview POST (e.g. "/wiki/preview")
UploadEndpoint string // optional: if empty, upload buttons are hidden
EnableFullscreen bool // default: true
EnableImageUpload bool // default: false
DarkMode bool // default: true (consumer controls via CSS class on <body>)
TextareaName string // form field name, default: "content"
InitialContent string // pre-filled content for the textarea
ExtraCSS string // additional CSS to inject
ExtraJS string // additional JS to inject
}
EditorConfig controls what the rendered editor includes.
func DefaultEditorConfig ¶
func DefaultEditorConfig(previewEndpoint string) EditorConfig
DefaultEditorConfig returns a config with sensible defaults.
Click to show internal directories.
Click to hide internal directories.