Tp-Note: fast note taking with templates and filename synchronization

Organize your notes with your favourite editor and markup-language

Jens Getreu


Table of Contents

How students take notes
Fast start note-taking (when the lecture starts)
Taking notes about a file
Bookmark and comment a hyperlink
Copy a page from a book
How it works: Organize your files and notes with sort-tags
Quickstart
Installation
Usage
Troubleshooting
Optional customization
Integration with file manager
Windows file explorer configuration
Linux file manager configuration

Markup languages like Markdown, ReStructuredText, asciidoc, textile, txt2tags or mediawiki are perfectly suited for fast note-taking. Type your notes with your favourite editor and chose your favourite markup language[1].

Tp-Note helps you to quickly get started writing notes with its powerful template system. As Tp-Note takes care that the note’s filename is always synchronized with its document title, you will find back your notes easily.

Tp-Note is available for Linux, Windows and iOS. This manual illustrates its main use-cases and how to get started:

  1. Fast start note-taking (when the lecture starts).

  2. Take a note about an existing (downloaded) file.

  3. Bookmark and comment a hyperlink.

If you want to customize Tp-Note with own templates, another markup language, please consult the [man-page] for more technical details.

The project is hosted on Github: getreu/tp-note. The project’s webpage is on http://blog.getreu.net. The documentation of this project is dived into tow parts:

How students take notes

A fellow student still uses paper and pen. I ask her why, and she replied I can better concentrate. My computer distracts me. I will do all other things, but not listening..

This is certainly true. As far as I am concerned, I am not good at logistics. For me having all documents and notes in one little machine is a blessing.

To illustrate how to work with Tp-Note here my most common workflows.

Fast start note-taking (when the lecture starts)

Figure 1. The folder in which the new note will be created.

The folder in which the new note will be created.

Alternatively you can open the folder you want to create a new note in and right-click on some empty white space.

Figure 2. The new unmodified note created by template on disk

The new unmodified note created by template on disk

Figure 3. The new unmodified note created by template

The new unmodified note created by template

Figure 4. Change the title

Change the title

Figure 5. Add some text

Add some text

Figure 6. The new note file on disk after closing the editor

The new note file on disk after closing the editor

Note

Before and after launching the editor Tp-Note renames the file to be in sync with the note’s metadata (i.e. title and subtitle). For more details see [Document title - filename sync]

Taking notes about a file

Figure 7. We want to take a note about a pdf

We want to take a note about a pdf

Figure 8. The new unmodified note created by template

The new unmodified note created by template

The source-code of the note shows, that the link has a target. The left-click, opens the .odt document.

---
title:      "03-Lied-Das_ist_mein_Teddybär - Lernstationen - Arbeitsblätter"
subtitle:   "Note"
author:     "getreu"
date:       "March 10, 2020"
lang:       "en_GB.UTF-8"
revision:   "1.0"
---

[03-Lied-Das_ist_mein_Teddybär - Lernstationen - Arbeitsblätter.odt](03-Lied-Das_ist_mein_Teddybär - Lernstationen - Arbeitsblätter.odt)

Figure 9. Annotate

Annotate

Figure 10. The new note file on disk after closing the editor

The new note file on disk after closing the editor

Bookmark and comment a hyperlink

Figure 11. Copy a link in markdown format

Copy a link in markdown format

To copy a link in markdown format a browser addon is needed. I recommend the addons Copy as Markdown and Copy Selection as Markdown available for Firefox.

Figure 12. Right-click on or in the new note’s destination folder and start tp-note

Right-click on or in the new note’s destination folder and start tp-note

Figure 13. The new unmodified note created by template

The new unmodified note created by template

The source code of the note shows the link target:

---
title:      "Rustacean Station"
subtitle:   "URL"
author:     "getreu"
date:       "March 10, 2020"
lang:       "en_GB.UTF-8"
revision:   "1.0"
---

[Rustacean Station](https://rustacean-station.org/)

In this example we copied only one Markdown-link Rustacean Station. Furthermore, Tp-Note allows you also to insert a list of Markdown links in a template. For example with Copy as Markdown you could copy a link list of all open tabs. In this case, Tp-Note would retain only the name of the first link as document title, whereas the whole link-list would appear in the body of the note.

Figure 14. Annotate

Annotate

Figure 15. The new note file on disk after closing the editor

The new note file on disk after closing the editor

Copy a page from a book

Figure 16. Copy some chapters

Copy some chapters

Figure 17. Right-click on or in the new note’s destination folder and start tp-note

Right-click on or in the new note’s destination folder and start tp-note

Figure 18. The new unmodified note created by template

The new unmodified note created by template

The source code of the note shows the completed template:

---
title:      "Winston kept his back turned to the telescreen"
subtitle:   "Note"
author:     "getreu"
date:       "2020-03-23"
lang:       "en_GB.UTF-8"
revision:   "1.0"
---

Winston kept his back turned to the telescreen. It was safer, though, as he well
knew, even a back can be revealing. A kilometre away the Ministry of Truth, his
place of work, towered vast and white above the grimy landscape...

In this example we copied only text. Tp-Note suggests the first sentence as title. This can be changed before saving as illustrated above. Here we just save and observe the file on the disk.

Figure 19. The new note file on disk after closing the editor

The new note file on disk after closing the editor

How it works: Organize your files and notes with sort-tags

Consider the following Tp-Note-file:

20151208-Make this world a better place--Suggestions.md

The filename has 4 parts:

{{ sort-tag }}-{{ title }}--{{ subtitle }}.{{ extension }}

A so called sort-tag is a numerical prefix at the beginning of the filename. It is used to order files and notes in the file system. Besides numerical digits, a sort-tag can be any combination of 0123456789-_[2] and is usually used as:

  • chronological sort-tag

      20140211-Reminder.doc
      20151208-Manual.pdf
    
  • or as a sequence number sort-tag.

      02-Invoices
      08-Tax documents
      09_02-Notes
    

The figures below illustrate organizing files with *sort-tags".

Figure 20. Folders with sequence number sort-tag

Folders with sequence number sort-tag

Figure 21. File with chronological sort-tag

File with chronological sort-tag

When Tp-Note creates a new note, it prepends automatically a chronological sort-tag of today. The {{ title }} part is usually derived from the parent directory’s name omitting its own sort-tag.

Quickstart

Tp-Note can be easily configured for your personal preferences and needs[3]. However, this section explains the basic standard setup to get you started quickly.

Installation

  • Windows

    Download the tp-note executable for Windows [4] and place it on your desktop.

  • Linux

    Download the Tp-Note-binary for Linux and place it on your Desktop:

    > cd ~/Desktop
    > wget https://blog.getreu.net/projects/tp-note/_downloads/x86_64-unknown-linux-gnu/release/tp-note
    > chmod 755 tp-note
    

A new Tp-Note-icon appears on your desktop.

Usage

To create a new note, either double-click on the Tp-Note-icon, or drag a folder or file and drop it on the to-note-icon. This opens an editor with your new note.

For more comfort, I recommend integrating Tp-Note into the file-manager’s context menu. See section Integration with file manager for more details. There you also will find a list of tested Markdown-editors, if you wish to use one. Tp-Note works with every Unicode text editor and Markdown-editor (see section Optional customization and man-page for more details).

Tp-Note’s note-files can be converted into e.g. .docx, .odt, .html with Pandoc and then printed.

Troubleshooting

  • Windows

    When you see only Chinese characters in notepad, update Windows to the latest version or install Notepad++.

    Display Tp-Note’s error messages:

    1. Open the command-prompt: Click on Windows-Start, type cmd and [Enter].

    2. Type:

      Desktop\tp-note.exe -d >Desktop\debug.txt 2>&1
      

      This creates the file debug.txt on your desktop. Open the file and scroll to the end.

  • Linux

    Display Tp-Note’s error messages:

    1. Open a console and change to the directory where you saved the Tp-Note-executable.

    2. Type:

      > tp-note -d 2>&1 | less
      

Optional customization

  • Your preferred markup language is not Markdown, but ReStructuredText, T2t, Textile, Wiki, Mediawiki or Asciidoc? Change it!

    Please refer to Tp-Note’s man-page to learn how to change its templates in the configuration file.

  • Your preferred text editor is not Notepad? Change it![5]

    Note-taking with Tp-Note is more fun with a good markup (Markdown) text editor, although any Unicode text editor will do (even Notepad >= Windows 10-update 1903). Tp-Note it preconfigured to work with:

    Please refer to Tp-Note’s man-page to learn how to register your text editor in Tp-Note’s configuration file.

  • You prefer working in a desktop environment instead of working on a shell?

    Read Integration with file manager.

Integration with file manager

This section shows how to integrate Tp-Note in the context menu of your file manager. The context menu appears, when you click right on a file icon, on a directory icon or on the white space in between (cf. figure below). In the following we will configure the file-manager to launch Tp-Note with the path to the selected icon.

Figure 22. Tp-note in the context-menu (right-click menu)

Tp-note in the context-menu (right-click menu)

Windows file explorer configuration

The following works for me with Windows-version 10.0.18362.

  1. Make the directory C:\Windows\tp-note\ and move tp-note.exe into it.

  2. Open the notepad text editor and paste the following registry-key into it.

     Windows Registry Editor Version 5.00
    
     [HKEY_CLASSES_ROOT\Directory\Background\shell\Tp-Note]
    
     [HKEY_CLASSES_ROOT\Directory\Background\shell\Tp-Note\command]
     @="\"C:\\Program Files\\tp-note\\tp-note\""
    
     [HKEY_CLASSES_ROOT\*\OpenWithList\tp-note.exe]
     @=""
    
  3. Save the file as:

    • File name: tp-note.reg

    • Save as type: All files

    • Encoding: UTF-16 LE

  4. Double-click on tp-note.reg and confirm several times.

Linux file manager configuration

To simplify the configuration we first place the binary Tp-Note in our $PATH:

> cd /usr/local/bin
> sudo wget https://blog.getreu.net/projects/tp-note/_downloads/x86_64-unknown-linux-gnu/release/tp-note
> sudo chmod 755 tp-note

Debian and Ubuntu user can also download a binary package from debian/tp-note and install it with:

> sudo dpkg -i tp-note_X.X.X_amd64.deb

Configure Thunar’s custom actions

Most file-manager allow extending the context menu. As an example, the following images show the configuration of the Thunar-file-manger. In Thunar’s menu go to:

Edit -> Configure custom actions...

Figure 23. Thunar’s custom action configuration

Thunar’s custom action configuration

Figure 24. Edit custom action

Edit custom action

Figure 25. Appearance Condition

Appearance Condition

Figure 26. Thunar’s custom action configuration with tp-note

Thunar’s custom action configuration with tp-note

Configure Thunar’s custom actions system-wide

Alternatively, instead of manually adding custom actions for each user, you can do this system-wide:

sudo nano /etc/xdg/Thunar/uca.xml

Search for </actions> and replace it with:

<action>
        <icon>accessories-text-editor</icon>
        <name>Tp-Note</name>
        <command>tp-note %f</command>
        <description>Tp-Note</description>
        <patterns>*</patterns>
        <directories/>
        <audio-files/>
        <image-files/>
        <other-files/>
        <text-files/>
        <video-files/>
</action>
</actions>

The change becomes effective only after the user deletes his own configuration file in ~/.config/Thunar/uca.xml.

Configure Pcmanfm’s custom actions system-wide

Pcmanfm is the default file-manager Lubuntu and in Raspbian on the Raspberry Pi.

Create the configuration file:

sudo nano /usr/local/share/file-manager/actions/tp-note.desktop

with the following content:

[Desktop Entry]
Type=Action
Name[en]=Tp-Note
Tooltip=Tp-Note
Icon=package-x-generic
Profiles=profile-zero;

[X-Action-Profile profile-zero]
Name[en]=Default profile
Exec=tp-note %f

The above creates the custom context-menu item Tp-Note.



[1] Tp-Note is preconfigured to work with many well-known external text editors: e.g.: code, atom, retext, geany, gedit, mousepad, leafpad, nvim-qt, and gvim under Linux and notpad++ and notepad under Windows. To register your own text editor, please consult the man-page. For best user experience, I recommend text editors with internal markup previewer.

[2] The characters _ and - are not considered to be part of the sort-tag when they appear in first or last position.

[3] For a personalized setup read Tp-Note’s man-page.

[4] Versions for other operating systems and a Debian package are available here.

[5] Tp-Note is preconfigured to work with many well-known external text editors: e.g.: code, atom, retext, geany, gedit, mousepad, leafpad, nvim-qt, and gvim under Linux and notpad++ and notepad under Windows. To register your own text editor, please consult the man-page. For best user experience, I recommend text editors with internal markup previewer.