[][src]Crate tp_note

Tp-Note is a note-taking-tool and a template system, that consistently synchronizes the note's meta-data with its filename. tp-note collects various information about its environment and the clipboard and stores them in variables. New notes are created by filling these variables in predefined and customizable Tera-templates. In case <path> points to an existing tp-note-file, the note's meta-data is analysed and, if necessary, its filename is modified. For all other file types, tp-note creates a new note that annotates the file <path> points to. If <path> is a directory (or, when omitted the current working directory), a new note is created in that directory. After creation, tp-note launches an external editor of your choice. Although the note's structure follows pandoc-conventions, it is not tied to any specific markup language.

Modules

config

Collects tp-note's configuration from a configuration file, the command-line parameters. It also reads the clipboard.

content

Deals with the note's content string.

filter
note

Creates a memory representations of the note by inserting tp-note's environment data in some templates. If the note exists on disk already, the memory representation is established be reading the note-file with its front matter.

Constants

AUTHOR

(c) Jens Getreu

MESSAGE_ALERT_WINDOW_TITLE

Window title for error box.

VERSION

Use the version-number defined in ../Cargo.toml.

Functions

create_new_note_or_synchronize_filename

Create a new note by inserting tp-note's environment in a template. If the note to be created exists already, open it, read the YAML front matter and synchronize the filename if necessary.

launch_editor

Launches some external editor. The editor can be chosen through tp-note's configuration file.

main

Print error message is run() does not complete.

run

High level application algorithm:

synchronize_filename

Opens the note file path on disk and reads its YAML front matter. Then calculate from the front matter how the filename should be to be in sync. If it is different, rename the note on disk and return the new filename.