commandsxml

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package commandsxml reads the commands.xml file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Choice     []*Choice
	Name       string
	CSS        string
	Since      string
	Type       string
	Optional   bool
	AllowXPath bool
	Pro        bool
	// contains filtered or unexported fields
}

Attribute has all information about each attribute

func (a *Attribute) Attlink() string

Attlink returns a string in the form of cmd-commandname-attribute e.g. cmd-setvariable-select

func (*Attribute) DescriptionMarkdown added in v0.0.2

func (a *Attribute) DescriptionMarkdown() string

DescriptionMarkdown returns the description of the attribute as an asciidoctor blob.

func (*Attribute) DescriptionText

func (a *Attribute) DescriptionText() string

DescriptionText returns the description of the attribute without markup.

func (*Attribute) UnmarshalXML

func (a *Attribute) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

UnmarshalXML fills the attribute from the given XML segment

type Childelement

type Childelement struct {
	Text []byte `xml:",innerxml"`
	// contains filtered or unexported fields
}

Childelement has all child elements of a command.

type Choice

type Choice struct {
	Text []byte `xml:",innerxml"`
	Name string `xml:"en,attr"`
	Pro  bool
	// contains filtered or unexported fields
}

Choice represents alternative attribute values

func (*Choice) DescriptionText

func (c *Choice) DescriptionText() string

DescriptionText returns the description of the attribute without markup.

func (*Choice) UnmarshalXML

func (c *Choice) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

UnmarshalXML fills the Choice value

type Command

type Command struct {
	Attr       []*Attribute
	Name       string
	CSS        string
	Since      string
	Pro        bool
	Deprecated bool
	Rules      []SchematronRules `xml:"rules"`
	// contains filtered or unexported fields
}

Command has information about a command

func (*Command) Attributes

func (c *Command) Attributes() []*Attribute

Attributes returns all attributes for the command

func (*Command) Childelements

func (c *Command) Childelements() []*Command

Childelements returns a list of commands that are allowed within this command.

func (c *Command) CmdLink() string

CmdLink returns a text such as cmd-atpageshipout

func (*Command) DescriptionMarkdown added in v0.0.2

func (c *Command) DescriptionMarkdown() string

DescriptionMarkdown returns the description of the command as a asciidoctor blob.

func (*Command) DescriptionText

func (c *Command) DescriptionText(lang string) string

DescriptionText returns the description as text.

func (*Command) ExampleMarkdown added in v0.0.2

func (c *Command) ExampleMarkdown() string

ExampleMarkdown returns the examples section as an markdown blob.

func (c *Command) Htmllink() string

Htmllink returns a text such as "mycmd.html"

func (*Command) InfoMarkdown added in v0.0.2

func (c *Command) InfoMarkdown() string

InfoMarkdown returns the info section as a asciidoctor blob.

func (c *Command) MDlink() string

MDlink returns the command name with ".md"

func (*Command) Parents

func (c *Command) Parents() []*Command

Parents returns all parent commands

func (*Command) RemarkMarkdown added in v0.0.2

func (c *Command) RemarkMarkdown() string

RemarkMarkdown returns the remark section as a formatted asciidoctor blob.

func (*Command) String

func (c *Command) String() string

func (*Command) UnmarshalXML

func (c *Command) UnmarshalXML(dec *xml.Decoder, start xml.StartElement) error

UnmarshalXML fills the command from the XML segment

type Commands

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

Commands is the root structure of all Commands

func LoadCommandsFile

func LoadCommandsFile(basedir string) (*Commands, error)

LoadCommandsFile opens the doc/commands.xml/commands.xml in the given base dir

func ReadCommandsFile

func ReadCommandsFile(r io.Reader) (*Commands, error)

ReadCommandsFile reads from the reader. It must be in the format of a commands file.

func (*Commands) Command

func (c *Commands) Command(commandname string) *Command

Command returns a Command structure for the command named in commandname.

func (*Commands) Commands

func (c *Commands) Commands() []*Command

Commands returns a list of all commands sorted by name.

func (*Commands) GetDefineText

func (c *Commands) GetDefineText(section string) []byte

GetDefineText returns the byte value of a define section in the commands xml

type SchematronRules

type SchematronRules struct {
	Lang  string `xml:"lang,attr"`
	Rules string `xml:",innerxml"`
}

SchematronRules represents schematron rules

Jump to

Keyboard shortcuts

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