codemirror

package
v0.0.0-...-cf82ea8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

CodeMirror wraps a simple text editor based on CodeMirror.

Users of this package must provide a prefix from which all codemirror files will be loaded and a diretory with the conteents that should be used as the editor.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Editor

type Editor struct {

	// prefix to remove from the incoming url and to
	// append for output urls
	Prefix string
	// contains filtered or unexported fields
}

func (*Editor) HandlerFunc

func (e *Editor) HandlerFunc() http.HandlerFunc

HandlerFunc wraps the editor under the http.HandlerFunc interface

func (*Editor) Scripts

func (e *Editor) Scripts() []string

Scripts returns the list of paths that should be include in the script loading section to allow editor parts to be used

func (*Editor) ServeHTTP

func (e *Editor) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP handles serving the text editor contents.

Only static files are served from here

func (*Editor) Styles

func (e *Editor) Styles() []string

Styles returns the list of paths that should be included in the html to allow editor parts to be used.

Directories

Path Synopsis
_demo
martini
Uses the martini framework to render the codemirror editor
Uses the martini framework to render the codemirror editor

Jump to

Keyboard shortcuts

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