zet

package module
v0.1.1-0...-720bc77 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

README

zet

zet is a command-line tool to organize and manage knowledge.

https://github.com/ericstrs/zet/assets/98285990/8fdcb3f4-278d-47b4-8f09-cb8ef17356c1

Features

  • Quick zettel (individual note) creation and linking.
  • TUI Full Text Search (FTS) for zettels.
  • Split a given zettel into separate zettels.
  • Merge zettels by replacing zettel links with the referenced content.

Install

The command can be built from source or directly installed:

go install github.com/ericstrs/zet/cmd/zet@latest

Documentation

Usage, controls, and other documentation has been embedded into the source code. See the source or run the application with the help command.

Global:

Keys Description
ESC Exit the program

Input field:

Keys Description
ctrl+Enter Use current input field text as title for new note

Results list:

Keys Description
l Open selected zettel
H Move to the top of the visible window
M Move to the middle of the visible window
L Move to the bottom of the visible window
c Open selected zettel in new tmux window
space Page down
b Page up
ESC, q Exists the search interface

FTS filters:

  • title: <term> or t: <term>
  • body: <term> or b: <term>
  • tags: <term> or #: <term>

Documentation

Overview

Package zet implements basic utilities for managing zettels within the zet system.

The zet package contains operations for adding, removing, and merging zettels.

Index

Constants

This section is empty.

Variables

View Source
var (
	Perm = 0700
)

Functions

func Add

func Add(newDirPath, editor, title, body, stdin, link string, open bool) error

Add adds a zettel (note) to an exiting zettel directory. Zettels are markdown by default. The path to the zet system is used instead of changing the zet directory to support zettel creation from scripts.

The behavior is dependent on the arguments and input methods provided:

  1. `zet add` with no arguments: * Creates a new, empty zettel. * Opens newly created zettel for editing.
  2. `zet add "title"` with one argument: * Creates a new zettel with the provided title. * Does not open the zettel for editing.
  3. `zet add "title" "body"` with two arguments: * Creates a new zettel with the provided title and body. * Does not open the zettel for editing.

All the above scenarios accept standard input. In which, content from Stdin is always appended after any argument data. Providing non-empty Stdin alongside `zet add` disables the interactive feature.

If link argument is not empty, it will be included in the newly created zettel.

func Commit

func Commit(d, p, t string) error

Commit commits a zettel file at a given path with a given commit message.

func CommitBulk

func CommitBulk(zetPath string, files []string) error

CommitBulk commits a bulk of files given a list of paths to the files. Each commit uses the zettel's title as message body.

func CreateAdd

func CreateAdd(path, editor, title, body, stdin, link string, open bool) error

CreateAdd creates a new directory with a unique identifier and then creates a new file.

func Isosec

func Isosec() string

Isosec returns the ISO date to the millisecond.

func ReadmeFiles

func ReadmeFiles(zpath string) ([]string, error)

ReadmeFiles parses the output of `git status --porcelain` to find and return the list of modified and new README.md files at the zet directory.

func SplitZettel

func SplitZettel(zetDir, zettelDir, b string) error

SplitZettel splits zettel content from stdin into sub-zettels.

Types

This section is empty.

Directories

Path Synopsis
cmd
zet
Zet is a command-line utility for managing a Zettelkasten.
Zet is a command-line utility for managing a Zettelkasten.
internal
config
Package config provides functionality related to zet configurations.
Package config provides functionality related to zet configurations.
meta
Package meta provides functions and types for handling the metadata of zettels.
Package meta provides functions and types for handling the metadata of zettels.
storage
Package storage provides the functionality for interacting with the zet database.
Package storage provides the functionality for interacting with the zet database.
ui

Jump to

Keyboard shortcuts

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