[][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.



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


Deals with the note's content string.


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.



(c) Jens Getreu


Window title for error box.


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



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 some external editor. The editor can be chosen through tp-note's configuration file.


Print some error message if run() does not complete.


High level application algorithm:


Open 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.