Documentation
¶
Index ¶
- func AsString(input Any) string
- func Contains(slice List, value string) bool
- func FromStdin() []byte
- func Load(bytes []byte) (List, string, Node)
- func Save(AST Any) []byte
- func Stringify(x Any) string
- func ToJSONFilter(action Action)
- func ToJSONFilters(actions []Action)
- func ToStdout(input []byte)
- type Action
- type Any
- type EltFunc
- type List
- type Node
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Stringify ¶
Walks the tree x and returns concatenated string content, leaving out all formatting.
func ToJSONFilter ¶
func ToJSONFilter(action Action)
func ToJSONFilters ¶
func ToJSONFilters(actions []Action)
Converts a list of actions <Action> into a filter that reads a JSON-formatted pandoc document from stdin, transforms it by walking the tree with the actions, and returns a new JSON-formatted pandoc document to stdout.
The argument is a list of functions of type <Action>, If the function returns None, the object to which it applies will remain unchanged. If it returns an object, the object will be replaced. If it returns a list, the list will be spliced in to the list to which the target object belongs. (So, returning an empty list deletes the object.)
Types ¶
type Action ¶
IS KEY ALWAYS A STRING Action function type used as Filter
Key is the type of the pandoc object as string(e.g. 'Str', 'Para'), Value is the contents of the object as <Any>(e.g. a string for 'Str', a list of inline elements for 'Para', typed as <Any>), Format is the target output format as string (which will be taken for the first command line argument if present), and Meta is the document's metadata as <Node>.
type Any ¶
type Any interface{}
type EltFunc ¶
var ( Plain EltFunc Para EltFunc CodeBlock EltFunc RawBlock EltFunc BlockQuote EltFunc OrderedList EltFunc BulletList EltFunc DefinitionList EltFunc Header EltFunc HorizontalRule EltFunc Table EltFunc Div EltFunc Null EltFunc Str EltFunc Emph EltFunc Strong EltFunc Strikeout EltFunc Superscript EltFunc Subscript EltFunc SmallCaps EltFunc Quoted EltFunc Cite EltFunc Code EltFunc Space EltFunc LineBreak EltFunc Math EltFunc RawInline EltFunc Link EltFunc Image EltFunc Note EltFunc SoftBreak EltFunc Span EltFunc )
type List ¶
type List []Any
func AttributeList ¶
Returns an attribute list, constructed from the dictionary attrs.