writescript

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2016 License: MIT Imports: 9 Imported by: 0

README

writescript Build Status Coverage Status GoDoc

plugin based generator tool backpacked with data

Installation

go get github.com/writescript/writescript/cmd/writescript

Usage

writescript -p theplugin.js -d mydata.json

Status

The project is in alpha stage. Do not use in production!

License

This code is published under an MIT license. See LICENSE file for more information.

Documentation

Index

Constants

View Source
const (
	PluginTypeUnknown = iota
	PluginTypeFile
	PluginTypeURL
	PluginTypeString
)
View Source
const (
	KEYWORD_IMPORT = "#import "
)
View Source
const Version = "0.3.0"

Version of the script engine.

Variables

This section is empty.

Functions

func CreateVMScript

func CreateVMScript(plugin, dataJSON string) string

CreateVMScript creates the javascript script we run at the otto vm. data must be formatted as json.

func IsValueInList added in v0.2.3

func IsValueInList(value string, list []string) bool

func LoadPlugin added in v0.2.3

func LoadPlugin(src string) ([]byte, error)

LoadPlugin and return the source as a byte array

func PluginIsType added in v0.2.3

func PluginIsType(src string) int

func RequestPlugin added in v0.2.3

func RequestPlugin(url string) ([]byte, error)

Types

type Plugin

type Plugin struct {
	ImportURLs      []string
	ImportCodeStack []string
	Js              []string // here we store the main plugin code
}

func (*Plugin) ParseSource added in v0.2.3

func (p *Plugin) ParseSource(src string) error

type WriteScript

type WriteScript struct {
	Content textbackend.TextContent // create output storage the plugin can write content to
}

WriteScript Core

func (*WriteScript) Process

func (w *WriteScript) Process(plugin, data string, headerOn bool) error

Process the plugin generator.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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