svg

package module
v0.0.0-...-191e258 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2014 License: BSD-2-Clause Imports: 6 Imported by: 0

README

svg

A simple and incomplete svg manipulation package in Go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Svg = AtomChecker("svg")
	G   = AtomChecker("g")
)

Functions

func Children

func Children(n xml.Node) (nodes xml.Nodes)

func ElementNode

func ElementNode(n xml.Node) xml.Node

func GetAttr

func GetAttr(n xml.Node, key string) *string

func SetAttr

func SetAttr(n xml.Node, key, value string)

func SvgToPdf

func SvgToPdf(svg string, pdfFile string) error

Types

type Checker

type Checker func(xml.Node) xml.Node

func And

func And(cs ...Checker) Checker

func AtomChecker

func AtomChecker(a string) Checker

func Find

func Find(cs ...Checker) Checker

Broad first search in all descendants

func Not

func Not(c Checker) Checker

func Or

func Or(cs ...Checker) Checker

func Pipe

func Pipe(cs ...Checker) Checker

type Node

type Node struct {
	xml.Node
}

Node represents a HTML node. Wrap html.Node so that chainable interface is possible Use pointer of it because we want to test with nil.

func NewNode

func NewNode(n xml.Node) *Node

func NewSvg

func NewSvg() *Node

func Parse

func Parse(r io.Reader) (*Node, error)

func (*Node) AddChild

func (n *Node) AddChild(c *Node)

func (*Node) Attr

func (n *Node) Attr(key string) *string

func (*Node) Find

func (n *Node) Find(cs ...Checker) *Node

func (*Node) G

func (n *Node) G(cs ...Checker) *Node

func (*Node) SetAttr

func (n *Node) SetAttr(key, value string)

func (*Node) Svg

func (n *Node) Svg(cs ...Checker) *Node

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

FIFO queue.

func NewQueue

func NewQueue() *Queue

func (*Queue) Len

func (q *Queue) Len() int

func (*Queue) Pop

func (q *Queue) Pop() xml.Node

func (*Queue) Push

func (q *Queue) Push(n xml.Node)

func (*Queue) PushNodes

func (q *Queue) PushNodes(nodes xml.Nodes)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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