notes

package
v0.0.0-...-325f451 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const Schema = `` /* 392-byte string literal not displayed */

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	Title string

	// Filename will be set after parsing.
	Filename string `json:"-"`

	// URL will be set after parsing.
	URL string `json:"-"`

	// Raw tells the parser not to include the standard header and footer.
	Raw bool

	Tags []string

	ReviewedOn *string `json:"reviewed_on" db:"reviewed_on"`

	ReviewBy *string `json:"review_by" db:"review_by"`

	Extra map[string]string

	Body []byte

	// MarkdownLua can be used both to filter the Body at render time as
	// well as allowing interactive functionality implemented in the page
	// itself
	MarkdownLua []byte

	// RawContents contains the full, unparsed contents of the source
	// file.
	RawContents []byte
}

func ReadArticle

func ReadArticle(r io.Reader) (Article, error)

func ReadArticleFromFS

func ReadArticleFromFS(fss fs.FS, f string) (Article, error)

type DB

type DB struct{ *sqlx.DB }

func NewDB

func NewDB(name string) (*DB, error)

func (*DB) DeleteArticle

func (d *DB) DeleteArticle(db sqlx.Preparer, name string) error

func (*DB) InsertArticle

func (d *DB) InsertArticle(db sqlx.Preparer, a Article) error

func (*DB) LoadArticle

func (d *DB) LoadArticle(db sqlx.Preparer, name string) (Article, error)

func (*DB) ReplaceArticle

func (d *DB) ReplaceArticle(db sqlx.Preparer, a Article) (err error)

type Rules

type Rules []rule

Rules has an ordered list of regexp+callback rules

func NewRules

func NewRules(token string) (Rules, error)

NewRules creates default rule set

func (Rules) Dispatch

func (rules Rules) Dispatch(input string, media []twilio.Media) (string, error)

Dispatch selects and runs rules based on input

type WatchDirFS

type WatchDirFS interface {
	fs.FS

	Watch(path string) (func(), chan struct{}, error)
}

type Zine

type Zine struct {
	fs.FS

	PublicPrefix string

	DB

	Q func(string, ...string) ([]map[string]interface{}, error)
	// contains filtered or unexported fields
}

func NewZine

func NewZine(dbName string) (*Zine, error)

func (*Zine) Load

func (z *Zine) Load(as *[]Article) error

func (*Zine) Render

func (z *Zine) Render(a Article) ([]byte, error)

func (*Zine) RenderToMarkdown

func (z *Zine) RenderToMarkdown(a Article) ([]byte, error)

Directories

Path Synopsis
note ast is noteast is not east is west
note ast is noteast is not east is west

Jump to

Keyboard shortcuts

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