cardcabinet

package module
v0.0.0-...-e4cc717 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 7 Imported by: 0

README

Card cabinet

This repository is a Go library for use in other projects.

Card cabinet is a simple system of markdown files with properties in frontmatter, together with boards that collect cards in different views.

The cards (files) are fairly stand alone, leaving the boards to link or structure cards based on labels or other properties.

The intention is use this in different projects, for example a simple kanban-style issue tracker.

Non goals

Card cabinet is not a magical system where notes can reference each other in a infinite hierarchy like Org mode or Roam. The idea here is to actually simplify and remove relationships from cards themselves.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterStrings

func FilterStrings(vs []string, f func(string) bool) []string

Types

type Board

type Board struct {
	Name  string `toml:"name" json:"name"`
	Decks []Deck `toml:"deck" json:"decks"`
}

func ReadBoard

func ReadBoard(filename string) (Board, error)

ReadBoard reads a board.toml file into a board

func ReadBoards

func ReadBoards(dir string, recursive bool) []Board

ReadBoards reads all boards in dir into boards

func (Board) Path

func (board Board) Path() string

Path returns path of board

type Card

type Card struct {
	Name        string                 `json:"name"`
	Contents    string                 `json:"contents"`
	Properties  map[string]interface{} `json:"properties,omitempty"`
	Frontmatter string                 `json:"frontmatter,omitempty"`
}

Card is markdown with properties (from frontmatter).

func ReadCard

func ReadCard(filename string) (Card, error)

ReadCard takes a file path, reading file in to a card.

func ReadCards

func ReadCards(dir string, recursive bool) []Card

ReadCards reads all cards in directory, and subdirectories

func (Card) MarshalFrontmatter

func (card Card) MarshalFrontmatter(fences bool) string

MarshalFrontmatter returns properties as frontmatter string of correct type, including or excluding fences

func (Card) Match

func (card Card) Match(filter string) bool

func (Card) Path

func (card Card) Path() string

Path returns path of card

type Deck

type Deck struct {
	Name   string `toml:"name" json:"name"`
	Filter string `toml:"filter" json:"filter"`
}

func (Deck) FilterCards

func (deck Deck) FilterCards(cards []Card) []Card

FilterCards returns all cards that matches deck filter

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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