docset

package module
v0.0.0-...-4594727 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: MIT Imports: 16 Imported by: 0

README

Docset Building Tools for Go

Expectation Management

This is a grab-bag of utility code for hacking on docsets that I add to in a very ad-hoc fashion. No API stability guarantees are made and the code is not guaranteed to work. Pull requests and issues will be ignored.

This is liberally licensed, so please feel free to take what you need, but ensure you preserve the copyright attribution if you do.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTOCNode

func AddTOCNode(into *html.Node, kind EntryKind, name string) *html.Node

func HeadingOutlineTOC

func HeadingOutlineTOC(into *html.Node) *html.Node

func TOCNode

func TOCNode(kind EntryKind, name string) *html.Node

Types

type Docset

type Docset struct {
	Ident        string
	Name         string
	Path         string
	DocPath      string
	DbFile       string
	ContentsPath string
	IndexFile    string
	PlistFile    string
	AllowJs      bool
	AllowOnline  bool

	LinkRewriter func(link string) (string, error)

	// The keyword Dash uses for Google/Stack Overflow searches for the docset.
	WebSearchKeyword string

	// The default user-set keyword for docsets is the DocSetPlatformFamily. Defaults to
	// ident.
	PlatformFamily string

	Db *sqlite.Conn
	// contains filtered or unexported fields
}

func New

func New(base, ident, name string) (*Docset, error)

func (*Docset) AddHTML

func (d *Docset) AddHTML(source string, node *html.Node, indexes ...IndexEntry) (Document, error)

func (*Docset) AddRaw

func (d *Docset) AddRaw(source string, data []byte, indexes ...IndexEntry) (Document, error)

func (*Docset) Close

func (d *Docset) Close() (rerr error)

func (*Docset) DeferClose

func (d *Docset) DeferClose() func(rerr *error)

type Document

type Document interface {
	AddIndexes(...IndexEntry) error
}

type EntryKind

type EntryKind string
const (
	Annotation  EntryKind = "Annotation"
	Attribute   EntryKind = "Attribute"
	Binding     EntryKind = "Binding"
	Builtin     EntryKind = "Builtin"
	Callback    EntryKind = "Callback"
	Category    EntryKind = "Category"
	Class       EntryKind = "Class"
	Command     EntryKind = "Command"
	Component   EntryKind = "Component"
	Constant    EntryKind = "Constant"
	Constructor EntryKind = "Constructor"
	Define      EntryKind = "Define"
	Delegate    EntryKind = "Delegate"
	Diagram     EntryKind = "Diagram"
	Directive   EntryKind = "Directive"
	Element     EntryKind = "Element"
	Entry       EntryKind = "Entry"
	Enum        EntryKind = "Enum"
	Environment EntryKind = "Environment"
	Error       EntryKind = "Error"
	Event       EntryKind = "Event"
	Exception   EntryKind = "Exception"
	Extension   EntryKind = "Extension"
	Field       EntryKind = "Field"
	File        EntryKind = "File"
	Filter      EntryKind = "Filter"
	Framework   EntryKind = "Framework"
	Function    EntryKind = "Function"
	Global      EntryKind = "Global"
	Guide       EntryKind = "Guide"
	Hook        EntryKind = "Hook"
	Instance    EntryKind = "Instance"
	Instruction EntryKind = "Instruction"
	Interface   EntryKind = "Interface"
	Keyword     EntryKind = "Keyword"
	Library     EntryKind = "Library"
	Literal     EntryKind = "Literal"
	Macro       EntryKind = "Macro"
	Method      EntryKind = "Method"
	Mixin       EntryKind = "Mixin"
	Modifier    EntryKind = "Modifier"
	Module      EntryKind = "Module"
	Namespace   EntryKind = "Namespace"
	Notation    EntryKind = "Notation"
	Object      EntryKind = "Object"
	Operator    EntryKind = "Operator"
	Option      EntryKind = "Option"
	Package     EntryKind = "Package"
	Parameter   EntryKind = "Parameter"
	Plugin      EntryKind = "Plugin"
	Procedure   EntryKind = "Procedure"
	Property    EntryKind = "Property"
	Protocol    EntryKind = "Protocol"
	Provider    EntryKind = "Provider"
	Provisioner EntryKind = "Provisioner"
	Query       EntryKind = "Query"
	Record      EntryKind = "Record"
	Resource    EntryKind = "Resource"
	Sample      EntryKind = "Sample"
	Section     EntryKind = "Section"
	Service     EntryKind = "Service"
	Setting     EntryKind = "Setting"
	Shortcut    EntryKind = "Shortcut"
	Statement   EntryKind = "Statement"
	Struct      EntryKind = "Struct"
	Style       EntryKind = "Style"
	Subroutine  EntryKind = "Subroutine"
	Tag         EntryKind = "Tag"
	Test        EntryKind = "Test"
	Trait       EntryKind = "Trait"
	Type        EntryKind = "Type"
	Union       EntryKind = "Union"
	Value       EntryKind = "Value"
	Variable    EntryKind = "Variable"
	Word        EntryKind = "Word"
)

type Feed

type Feed struct {
	Entry FeedEntry `xml:"entry"`
}

type FeedEntry

type FeedEntry struct {
	// You can use any versioning system you want. Dash/Zeal will use string comparison to
	// determine whether or not to download an update.
	Version string `xml:"version"`

	// One or several <url> elements. These point to the URL of the archived docset. They
	// should refer to the same file.
	Url []string `xml:"url"`
}

type IndexEntry

type IndexEntry struct {
	Kind EntryKind
	Name string
}

Jump to

Keyboard shortcuts

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