Tp-Note - Markup enhanced granular note-taking

Save and edit your clipboard content as a note file

Jens Getreu

Cargo Documentation License

1 Overview of Tp-Note

Tp-Note is a versatile note-taking tool designed for both desktop and console environments. It allows users to create, edit, and manage notes efficiently. Tp-Note is designed to bridge the gap between unstructured clipboard data and organized, local file storage. It is primarily built in Rust and follows a “file-centric” philosophy where the filename itself acts as a synchronized piece of metadata. This tool is ideal for users looking for a simple yet powerful way to manage their notes across different platforms.

Screenshot

A more sophisticated example using the “Zettelkasten” scheme:

Screenshot-Zettelkasten

1.1 Key Features

1.2 Usage Examples

Action Command Example
Create a note from clipboard tpnote (when clipboard contains text)
Convert HTML to Markdown curl https://example.com | tpnote
Edit an existing note tpnote ./path/to/note.md
Generate PDF from a note tpnote -x - note.md | weasyprint - note.pdf

1.3 User review

On Tue, 2023-12-19 at 12:58 +1100, Dev Rain wrote:

Found Tp-Note awhile back and it has become part of my daily workflow, and indeed part of my daily note-taking life. I wanted to extend my thanks; so thank you. dev.rain

Read more in Tp-Note’s user manual, Download Tp-Note or visit the project page: Tp-Note - Minimalistic note-taking.


2 Documentation

User documentation:

Developer documentation:

3 Source code

Repository:

3.1 Distribution

3.1.1 Download installer packages and binaries

3.1.2 Tp-Note Microsoft Windows installer package

Installer package for Windows:

As this early version of the Windows installer is not signed yet, Windows will show the error message “Windows protected your PC”. As a work-around, when you click on the link “More info”, a ”Run anyway” button will appear allowing you to continue the installation process. In general, regardless of where a program comes from, I recommend checking every installable file with VirusTotal.

Once installation is complete, right-click on the Desktop and select “Show more options” to find the “New Tp-Note” entry in the menu.

3.1.3 Windows Package Manager (winget) Distribution

Tp-Note is also available through the Windows Package Manager. To install:

winget install getreu.tpnote

For more information about winget distribution, see the winget distribution guide.

Following installation, right-click the Desktop and click “Show more options” to reveal the “New Tp-Note” context menu entry.

3.1.4 Tp-Note Debian/Ubuntu installer package

Package compiled for Debian/Ubuntu:

3.1.5 Various binaries for Windows, MacOS and Linux

3.2 Tp-Note in official package repositories

3.2.1 Tp-Note on NetBSD

3.2.2 Tp-Note on NixOS

3.2.3 Get Tp-Note with the Nix package manager

3.3 Other resources

4 Installation

Tp-Note can be installed via a Windows installer package or by placing the binary directly on your desktop for easy access. It is recommended to integrate it into your file manager’s context menu for convenience.

Depending on the availability of installer packages for your operating system, the installation process is more or less automated. For Windows users the fully automated installation package tpnote-latest-x86_64.msi is available. After installation, click right on the desktop and select “Show more options”, then “New Tp-Note” to get started. For more information, please consult the Distribution section above and the Installation section in Tp-Note’s manual.

4.1 Upgrading

While upgrading Tp-Note, new features may cause a change in Tp-Notes’s configuration file structure, e.g.:

*** ERROR:
Can not load or parse the (merged) configuration file(s):
---
invalid length 3, expected fewer elements in array in `viewer.served_mime_types`


Note: this error may occur after upgrading Tp-Note due to some incompatible
configuration file changes.

Tp-Note renames and thus disables the last sourced configuration file.

Additional technical details:
*    Command line parameters:
tpnote -b
*    Sourced configuration files:
/home/joe/.config/tpnote/tpnote.toml

Mote, the configuration file backup is stored in the same directory as the last sourced configuration file, e.g. /home/joe/.config/tpnote/. If Tp-Note sources more than one configuration file, consider the possibility of syntax errors in any of these files (cf. Customization section of Tp-Note’s man-page).

5 Building

If the above precompiled binaries do not suite you, you can compile Tp-Note yourself.

  1. Install Rust

  2. Download, compile and install Tp-Note:

    Building on Linux

    cargo install tpnote
    sudo cp ~/.cargo/bin/tpnote /usr/local/bin
    # Download icon
    cd /usr/local/share/icons
    sudo wget https://blog.getreu.net/projects/tp-note/assets/tpnote.svg

    On Linux, Tp-Note displays errors and debug messages as notifications. This requires a Linux/BSD based desktop environment that follows the XDG specification, e.g. KDE, Gnome, XFCE, LXDC, Mate (and most others).1

    Recommended Linux console and server version

    The full-featured version of Tp-Note depends on GUI libraries like Xlib which might not be available on a headless system. Either download the Musl version [x86_64-unknown-linux-musl/release/tpnote] or compile Tp-Note yourself without default features:

    cargo install --no-default-features \
      --features lang-detection,renderer tpnote
    sudo cp ~/.cargo/bin/tpnote /usr/local/bin

    If Tp-Note’s binary size if of concern, omit the lang-detection feature in the cargo invocation above. The lang-detection feature causes 95% of the final binary size because of its extensive language models.

    Building on Windows and macOS

    Build the full-featured version2 with:

    cargo install tpnote

5.1 Cross compilation

Tp-Note supports cross-compilation for multiple architectures. This section explains how to build binaries that work on Debian/Ubuntu systems, including Raspberry Pi devices.

The project includes pre-configured cross-compilation settings in .cargo/config.toml. To build Debian/Ubuntu-compatible binaries, you only need to install the cross-compiler toolchains:

Prerequisites:

sudo apt update
sudo apt install crossbuild-essential-armhf crossbuild-essential-arm64

Build for Raspberry Pi 32-bit (ARMv7):

rustup target add armv7-unknown-linux-gnueabihf
cargo build --release --target armv7-unknown-linux-gnueabihf

The binary will be at: target/armv7-unknown-linux-gnueabihf/release/tpnote

Build for Raspberry Pi 64-bit (ARM64):

rustup target add aarch64-unknown-linux-gnu
cargo build --release --target aarch64-unknown-linux-gnu

The binary will be at: target/aarch64-unknown-linux-gnu/release/tpnote

5.1.2 Building from NixOS

Tp-Note can also be cross-compiled from NixOS using the Nix flake. The ARM builds produce binaries compatible with Debian 11+ and Ubuntu 20.04+:

# Build ARMv7 (32-bit) for Raspberry Pi
nix build .#tpnote-armv7-unknown-linux-gnueabihf

# Build ARM64 (64-bit) for Raspberry Pi and ARM servers
nix build .#tpnote-aarch64-unknown-linux-gnu

The binaries will be in the Nix store. Copy them to your desired location:

cp result/bin/tpnote /path/to/destination

5.1.3 Building for Musl Linux (Static)

For a fully static binary that works on any Linux distribution:

rustup target add x86_64-unknown-linux-musl
sudo apt install musl-tools
cargo build --release --target x86_64-unknown-linux-musl

5.1.4 Building for Windows

rustup target add x86_64-pc-windows-gnu
sudo apt install binutils-mingw-w64 mingw-w64
cargo build --release --target x86_64-pc-windows-gnu

5.1.5 Verifying Binary Compatibility

After building, verify that your binary links against the correct libraries:

# Check dynamic dependencies (should show glibc, not Nix store paths)
readelf -d target/armv7-unknown-linux-gnueabihf/release/tpnote | grep NEEDED

# Check the dynamic linker (should point to Debian/Ubuntu paths)
readelf -d target/armv7-unknown-linux-gnueabihf/release/tpnote | grep interpreter

The binary should NOT contain any /nix/store paths. If it does, the build environment may have introduced Nix-specific dependencies.

This project follows Semantic Versioning.

6 About

Author:

Copyright:


  1. In case an XDG desktop environment is not available, you can opt out notifications and message boxes by omitting the message-box feature by adding --no-default-features --features lang-detection,read-clipboard,renderer,viewer to cargo install tpnote. Now, all error messages are dumped on the console from where you started Tp-Note into stderr.↩︎

  2. When building for Windows or macOS, it does not make sense to exclude the message-box feature, because - under Windows and macOS - it does not rely on the notification library. Instead, it uses direct OS-API calls for popping up alert boxes. As these calls have no footprint in binary size or speed, always keep the message-box feature compiled in.↩︎