Documentation
¶
Index ¶
- type CurrentUrlState
- type DirVisited
- type Mod
- func (m *Mod) GetDirVisited() (err error)
- func (m *Mod) GetFilePath(webUrl string) (filePath string, err error)
- func (m *Mod) GetIndexedDir(rawDir string) (indexedCurrentDir, indexForNewItem string, err error)
- func (m *Mod) GetIndexedFilePath(rawPath string) (indexedCurrentFilePath string, err error)
- func (m *Mod) GetRawFilePath(webPageUrl string) (filePath string, err error)
- func (m *Mod) SaveDirVisited() (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentUrlState ¶
type CurrentUrlState struct {
// IsMD is set when the url ends with .md
// it is set iteratively everytime a url is processed
IsMD bool
CurrentURLProperties *urlproperties.URLProperties
}
type DirVisited ¶
type DirVisited struct {
// the indexed path for this dir
IndexedDirPath string
// the no. of items currently in this dir
ItemCount int8
// the complex index like i01-03-01 is carried from parent directory,
// that needs to be available for sending to create the item in this dir.
DirIndex string
}
DirVisited allows you to save below information for multiple urls not just for caching purpose, but also for to keep track of info for created dirs
type Mod ¶
type Mod struct {
// a book name when compiling books
BookName string
// the base url to be taken away as prefix from the urls' paths
BaseDir string
// this file is merged with global css rules and passed to wkhtmltopdf
CssOverrideFile string
// a rune, to mark the current running set of files & dirs, that will be
// differentiated from the past available files &dirs
HistPointer string
// these options are passed to the wkhtmltopdf object
// could be used for overriding default ones in this repository
ObjectOptions *json.RawMessage
// these options are passed to the wkhtmltopdf converter
// could be used for overriding default ones in this repository
ConverterOptions *json.RawMessage
PropertiesFiles []string
IndexedBookmarkNames bool
DisableBookGen bool
State CurrentUrlState
// contains filtered or unexported fields
}
func (*Mod) GetDirVisited ¶
GetDirVisited tries a lookup for locally stored .gob file that holds the index for already existing pdf files.
func (*Mod) GetFilePath ¶
GetFilePath wraps away the logic to provide & create indexed dir from the url path or url fragment
func (*Mod) GetIndexedDir ¶
GetIndexedDir recursively iterate through each subDir in the dirPath to return the indexedPath for the respective raw input path, along with a new index to be given to a file to be created in that indexedDir. It takes care for maintaining a cache of it's results, to save calls to subDir that have already been visited and also peeks from that cache first, before doing iteration on it.
func (*Mod) GetIndexedFilePath ¶
func (*Mod) GetRawFilePath ¶
GetRawFilePath takes the Url to be rendered and extracts the final rawPath either from url path or fragment returns the dir in which the pdf be created and the name of the pdf file.
func (*Mod) SaveDirVisited ¶
SaveDirVisited does exactly opposite it does the saving for the file