formats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFormat

func GetFormat(name string) generator.Format

GetFormat returns a format by name, or the default if not found

func GetFormatNames

func GetFormatNames() []string

GetFormatNames returns a list of available format names

Types

type MarkdownFormat

type MarkdownFormat struct{}

MarkdownFormat implements the generator.Format interface for Markdown output

func (*MarkdownFormat) Extension

func (f *MarkdownFormat) Extension() string

Extension returns the file extension for Markdown

func (*MarkdownFormat) Name

func (f *MarkdownFormat) Name() string

Name returns the name of the format

func (*MarkdownFormat) Render

func (f *MarkdownFormat) Render(data generator.TemplateData) (string, int, error)

Render converts the template data into Markdown format

type TxtFormat

type TxtFormat struct{}

TxtFormat implements the generator.Format interface for plain text output

func (*TxtFormat) Extension

func (f *TxtFormat) Extension() string

Extension returns the file extension for plain text

func (*TxtFormat) Name

func (f *TxtFormat) Name() string

Name returns the name of the format

func (*TxtFormat) Render

func (f *TxtFormat) Render(data generator.TemplateData) (string, int, error)

Render converts the template data into plain text format

type XMLDirectory

type XMLDirectory struct {
	Name        string         `xml:"name,attr"`
	Directories []XMLDirectory `xml:"directory,omitempty"`
	Files       []XMLFileRef   `xml:"file,omitempty"`
}

XMLDirectory represents a directory in the structure

type XMLFile

type XMLFile struct {
	Path     string `xml:"path,attr"`
	Language string `xml:"language,attr"`
	Content  string `xml:",cdata"`
}

XMLFile represents a file with its content

type XMLFileRef

type XMLFileRef struct {
	Name string `xml:"name,attr"`
}

XMLFileRef represents a file reference in the directory structure

type XMLFilesystem

type XMLFilesystem struct {
	Root XMLDirectory `xml:"directory"`
}

XMLFilesystem represents the directory structure

type XMLFormat

type XMLFormat struct{}

XMLFormat implements the generator.Format interface for XML output

func (*XMLFormat) Extension

func (f *XMLFormat) Extension() string

Extension returns the file extension for XML

func (*XMLFormat) Name

func (f *XMLFormat) Name() string

Name returns the name of the format

func (*XMLFormat) Render

func (f *XMLFormat) Render(data generator.TemplateData) (string, int, error)

Render converts the template data into XML format

type XMLProject

type XMLProject struct {
	XMLName    xml.Name      `xml:"project"`
	Filesystem XMLFilesystem `xml:"filesystem"`
	Files      []XMLFile     `xml:"files>file"`
}

XMLProject represents the root XML element

Jump to

Keyboard shortcuts

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