indexer

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2022 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAssets

func AddAssets(tarFile string) error

Types

type Article

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

func (Article) Data

func (a Article) Data() []byte

func (Article) Path

func (a Article) Path() string

type IndexEntry

type IndexEntry struct {
	Path     string
	Metadata IndexMetadata
}

type IndexMetadata

type IndexMetadata struct {
	Title    string
	MimeType string
	Redirect bool
}

type Node

type Node struct {
	Path     string  `json:"path"`
	Icon     string  `json:"icon"`
	MimeType string  `json:"mimeType"`
	Title    string  `json:"title"`
	Redirect bool    `json:"redirect"`
	Nodes    []*Node `json:"nodes"`
}

type SwarmZimIndexer

type SwarmZimIndexer struct {
	ZimPath string
	Z       *zim.ZimReader
	// contains filtered or unexported fields
}

func New

func New(zimPath string, enableSearch bool) (*SwarmZimIndexer, error)

func (*SwarmZimIndexer) AddEntry

func (idx *SwarmZimIndexer) AddEntry(entryPath string, metadata IndexMetadata)

func (*SwarmZimIndexer) Entries

func (idx *SwarmZimIndexer) Entries() map[string]IndexEntry

func (*SwarmZimIndexer) MakeErrorPage

func (idx *SwarmZimIndexer) MakeErrorPage(tarFile string) error

MakeErrorPage creates an error page

func (*SwarmZimIndexer) MakeIndexSearchPage

func (idx *SwarmZimIndexer) MakeIndexSearchPage(tarFile string) error

MakeIndexSearchPage creates a custom index with the text search tool and embed the current main page in the new index.

func (*SwarmZimIndexer) MakeRedirectIndexPage

func (idx *SwarmZimIndexer) MakeRedirectIndexPage(tarFile string) error

MakeRedirectIndexPage creates an redirect index to the main page when it exists in the zim archive.

func (*SwarmZimIndexer) ParseZIM

func (idx *SwarmZimIndexer) ParseZIM() chan Article

func (*SwarmZimIndexer) TarZim

func (idx *SwarmZimIndexer) TarZim(tarFile string, files <-chan Article) error

func (*SwarmZimIndexer) UnZim

func (idx *SwarmZimIndexer) UnZim(outputDir string, files <-chan Article) error

Jump to

Keyboard shortcuts

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