commandsxml

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2023 License: AGPL-3.0 Imports: 12 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
	// 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) DescriptionAdoc

func (a *Attribute) DescriptionAdoc(lang string) string

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

func (*Attribute) DescriptionHTML

func (a *Attribute) DescriptionHTML(lang string) template.HTML

DescriptionHTML returns the the attribute description as an HTML blob.

func (*Attribute) DescriptionText

func (a *Attribute) DescriptionText(lang string) 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"`
	// contains filtered or unexported fields
}

Choice represents alternative attribute values

func (*Choice) DescriptionText

func (c *Choice) DescriptionText(lang string) 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
	Deprecated bool
	Rules      []SchematronRules `xml:"rules"`
	// contains filtered or unexported fields
}

Command has information about a command

func (c *Command) Adoclink() string

Adoclink retuns the command name with ".adoc"

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 retuns a text such as cmd-atpageshipout

func (*Command) DescriptionAdoc

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

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

func (*Command) DescriptionHTML

func (c *Command) DescriptionHTML(lang string) template.HTML

DescriptionHTML returns the description as a HTML blob

func (*Command) DescriptionText

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

DescriptionText returns the description as text.

func (*Command) ExampleAdoc

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

ExampleAdoc returns the examples section as an asciidoctor blob.

func (*Command) ExampleHTML

func (c *Command) ExampleHTML(lang string) template.HTML

ExampleHTML returns the examples section as a HTML blob

func (c *Command) Htmllink() string

Htmllink retuns a text such as "mycmd.html"

func (*Command) InfoAdoc

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

InfoAdoc returns the info section as a asciidoctor blob.

func (*Command) InfoHTML

func (c *Command) InfoHTML(lang string) template.HTML

InfoHTML returns the info section as a HTML blob

func (*Command) Parents

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

Parents retuns all parent commands

func (*Command) RemarkAdoc

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

RemarkAdoc retuns the remark section as a formatted asciidoctor blob.

func (*Command) RemarkHTML

func (c *Command) RemarkHTML(lang string) template.HTML

RemarkHTML returns the remark section as a formatted HTML blob.

func (*Command) SeealsoAdoc

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

SeealsoAdoc returns the see also section as an asciidoctor blob

func (*Command) SeealsoHTML

func (c *Command) SeealsoHTML(lang string) template.HTML

SeealsoHTML retuns the see also section as a HTML 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 retuns 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