Documentation ¶
Overview ¶
Pangaea is a pre-processor for any text file. Statements and instructions are written in JavaScript. Script blocks are contained within <pangaea type="text/javascript">...</pangaea> tags and the <%= code %> inline script will cause the output to be written in place.
Example
<pangaea type="text/javascript"> function name() { return "Pangaea"; } </pangaea> Hello from <%= name() %>.
Produces:
Hello from Pangaea.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type LineReader ¶
type LineReader struct {
// contains filtered or unexported fields
}
LineReader reads from an io.Reader one line at a time.
func NewLineReader ¶
func NewLineReader(source io.Reader) *LineReader
NewLineReader creates a new LineReader capable of reading lines from the specified source io.Reader.
func (*LineReader) ReadLine ¶
func (r *LineReader) ReadLine() ([]byte, error)
ReadLine reads the next line from the io.Reader that was specified in NewLineReader.
type Method ¶ added in v0.2.1
type Method struct { // Name is the name of the method. Name string // Func is the MethodFunc that will be executed if this method // is called in the script. Func MethodFunc }
Method represents a Pangaea method that is available to pangaea scripts.
type MethodFunc ¶ added in v0.2.1
type MethodFunc func(call otto.FunctionCall) otto.Value
MethodFunc represents the Go func that does the work for a Method.
type Methods ¶ added in v0.2.1
type Methods []*Method
Methods represents a slice of *Method objects.
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
func (*Parser) SetParamsFromURLStr ¶ added in v0.2.0
SetParamsFromURLStr sets the parameter string containing the parameters to make avilable to the scripts.