fs

package
v0.0.0-...-9979796 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repo

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

Repo allows access to the content of your zettelkasten. Repo satisfies the zet.Repo, index.Indexer, export.Exporter and imports.Reader interface. path represents the path to the directory, where your zettelkasten lies.

func New

func New(path string, p zet.Parser) Repo

func (Repo) GetBibkeys

func (r Repo) GetBibkeys() ([]string, error)

func (Repo) GetContents

func (r Repo) GetContents(uri string) ([]string, error)

GetContents reads the files in the path and extracts from allowed files the text content.

func (Repo) GetIndex

func (r Repo) GetIndex() (zet.Index, []zet.InconErr, error)

GetIndex returns the index of your zettelkasten. One index entry is a keyword with several ids in the form of:

Evolution: 170311a

One index entry can also have several ids:

Technology: 220112d, 190314f

An Index is used as access point into a line of thought (=zettel chain) regarding this keyword. ParsingErrors are returned with the second parameter []error. All other errors via the last parameter.

func (Repo) GetZettel

func (r Repo) GetZettel() ([]zet.Zettel, []zet.InconErr, error)

GetZettel returns all zettel of your zettelkasten. zet.Zettel are ordered by id (descending).

The second parameter []string contains all inconsistencies that occureed during parsing the zettel filename. Only if not an error happened, it will return zettel and inconsistencies.

func (Repo) PersistIndex

func (r Repo) PersistIndex(links map[string]string) error

CreateFolgezettelStruct creates a tree like link structure, so called "Folgezettel" in the fs. This represents the physical representation how Niklas Luhmann arranged his Zettel in his wooden zettelkasten boxes. This is used for creating chains of thoughts. Topic is e.g. "Evolution" and the map contains all links[linkname]targetId

func (Repo) PersistInfo

func (r Repo) PersistInfo(m map[string][]string) error

CreateInfo persists some statistics in form of a txt file about a topic like e.g. keywords, context or literature.

func (Repo) Save

func (r Repo) Save(zfs map[string]string) (int, error)

Save creates text files with a valid filename and the content. The parameter expects map[filename]content.

Jump to

Keyboard shortcuts

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