gan

package
v0.0.0-...-d72ceb1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDB = mustNew()
View Source
var DefaultMarkdown = goldmark.New(
	goldmark.WithExtensions(
		&wikilink.Extender{
			Resolver: DefaultDB,
		},
	),
)

Functions

func Build

func Build(src, dst string) error

func Render

func Render() error

Types

type Backlink struct {
	Note
	Context []string
}

type DB

type DB struct {
	*sql.DB
	// contains filtered or unexported fields
}

func New

func New() (*DB, error)

func (DB) FindByTitle

func (db DB) FindByTitle(title string) (*Note, error)
func (db DB) ResolveWikilink(node *wikilink.Node) (destination []byte, err error)

type MarkdownFile

type MarkdownFile struct {
	Path    string
	Content []byte
}

func GetAll

func GetAll(dir string) ([]MarkdownFile, error)

type Note

type Note struct {
	ID      int64
	Path    string
	Content string

	HTML  template.HTML
	Title string
}

func GetAllNotes

func GetAllNotes() ([]Note, error)
func (note *Note) Backlinks() ([]Backlink, error)

func (*Note) Parse

func (p *Note) Parse() error

func (*Note) Put

func (p *Note) Put() error

func (Note) Render

func (p Note) Render() error

func (Note) SelfPath

func (p Note) SelfPath() string

func (*Note) UpdateReferences

func (note *Note) UpdateReferences() error

type Reference

type Reference struct {
	SourceID      int64
	DestinationID int64
	Rel           string
	Context       string
}

func (*Reference) Put

func (p *Reference) Put() error

type ShowNote

type ShowNote struct {
	*Note
	Backlinks []Backlink
}

Jump to

Keyboard shortcuts

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