dita

package
v0.0.0-...-48663ca Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conversion

type Conversion struct {
	Group   kb.Slug
	Ditamap string

	Pages map[kb.Slug]*kb.Page
	Raw   map[kb.Slug][]byte
	Slugs []kb.Slug
	Nav   *index.Item

	LoadErrors    []error
	MappingErrors []error
	Errors        []ConversionError
}

func NewConversion

func NewConversion(group kb.Slug, ditamap string) *Conversion

func (*Conversion) Run

func (context *Conversion) Run()

type ConversionError

type ConversionError struct {
	Path   string
	Slug   kb.Slug
	Fatal  error
	Errors []error
}

type Module

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

func New

func New(name, ditamap string, server *kb.Server) *Module

func (*Module) Info

func (mod *Module) Info() kb.Group

func (*Module) Pages

func (mod *Module) Pages() (r []kb.PageEntry)

func (*Module) ServeHTTP

func (mod *Module) ServeHTTP(w http.ResponseWriter, r *http.Request)

type PageConversion

type PageConversion struct {
	*Conversion
	Mapping *TitleMapping
	Slug    kb.Slug
	Index   *ditaconvert.Index
	Topic   *ditaconvert.Topic
	Context *ditaconvert.Context
}

func (*PageConversion) Convert

func (conversion *PageConversion) Convert() (page *kb.Page, errs []error, fatal error)

func (*PageConversion) ConvertImageMap

func (conversion *PageConversion) ConvertImageMap(context *ditaconvert.Context, dec *xml.Decoder, start xml.StartElement) error

func (*PageConversion) ConvertTags

func (conversion *PageConversion) ConvertTags() []string

func (*PageConversion) InlineImage

func (conversion *PageConversion) InlineImage(context *ditaconvert.Context, dec *xml.Decoder, start xml.StartElement) error

func (*PageConversion) LinkAsAnchor

func (conversion *PageConversion) LinkAsAnchor(link *ditaconvert.Link) string

func (*PageConversion) RelatedLinksAsHTML

func (conversion *PageConversion) RelatedLinksAsHTML() (div string)

func (*PageConversion) ResolveLinkInfo

func (conversion *PageConversion) ResolveLinkInfo(url string) (href, title, synopsis string, internal bool)

func (*PageConversion) ToSlug

func (conversion *PageConversion) ToSlug(context *ditaconvert.Context, dec *xml.Decoder, start xml.StartElement) error

type TitleMapping

type TitleMapping struct {
	Topics  map[string]*ditaconvert.Topic
	BySlug  map[kb.Slug]*ditaconvert.Topic
	ByTopic map[*ditaconvert.Topic]kb.Slug
}

func NewTitleMapping

func NewTitleMapping() *TitleMapping

func RemapTitles

func RemapTitles(conversion *Conversion, index *ditaconvert.Index) (*TitleMapping, []error)

func (*TitleMapping) EntryToIndexItem

func (mapping *TitleMapping) EntryToIndexItem(entry *ditaconvert.Entry) *index.Item

func (*TitleMapping) TopicsSorted

func (m *TitleMapping) TopicsSorted() (r []*ditaconvert.Topic)

Jump to

Keyboard shortcuts

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