Organize Your Life with CherryTree

Tutorials – CherryTree

Article from Issue 202/2017
Author(s):

Work smarter and faster using this hierarchical note-taking app that's packed with power user features.

Think of all the bits of information we work with on a daily basis: notes for work, notes for your personal life, shopping lists, phone numbers, web bookmarks, passwords, code snippets, photos, and more. Yet, we all have different ways of juggling this info. You may have a single text file called NOTES.txt on your desktop with everything crammed inside (in which case, you might at least want to add some structure to it using Markdown, as described in the previous issue).

Or, perhaps you're using a web-based tool to arrange your notes, or you've gone hard-core Emacs Org-mode. Although many applications can be coerced into functioning as note and information managers, wouldn't a tool that's completely dedicated to the purpose be better? One that's built from the ground up to structure your notes, runs on Linux – oh, and is free and open source?

That's exactly what CherryTree is: a "hierarchical note taking application." CherryTree has been around for quite a few years now, yet it is only at version 0.38.1. Don't let that low version number mislead you, however; I've used the software on and off over the years and have always found it to be robust and reliable. (Indeed, as is the case with Inkscape, which is still at version 0.92 despite being used professionally for years, I think a bump to 1.0 would be good marketing. But, developers have their own reasons for waiting.)

Anyway, CherryTree is loaded with features, but some aren't so easy to find or work with. In this tutorial, then, I'll guide you through the process of setting it up, using the basics, organizing your notes and exploring its power user features.

First Steps

CherryTree is available in most major distros, so just have a peek in your package manager. If you can't find it, you can grab the latest version (with a .tar.xz extension) from CherryTree's website [1]. To run it, the dependencies you need to install beforehand are as follows:

  • python2
  • python-gtk2
  • python-gtksourceview2
  • p7zip-full
  • python-dbus
  • python-enchant
  • python-chardet

With these installed, extract the .tar.xz file you downloaded and run CherryTree with:

tar xfv cherrytree-0.38.1.tar.xz
cd cherrytree-0.38.1
./cherrytree

Alternatively, if you installed it via your distro's package manager, you can start it from the menu. Either way, you'll see a rather unwelcoming initial screen, as in Figure 1. CherryTree is a rather advanced tool designed to manage heaps of information and shouldn't be oversimplified – but, still, a welcome message and some pointers for the various bits of the interface would be good.

Figure 1: CherryTree isn't very welcoming at first, but this tutorial helps you figure it out.

What you will see is the two-pane layout of the app. The left-hand side is used to contain items in your CherryTree file – also known as "nodes" – and the right-hand pane is used for displaying and editing content inside specific nodes. So, let's get started: Click the leftmost button on the toolbar (if you mouse over it, you'll see that the tooltip says Add a Node having the same Parent of the Selected Node).

This will pop up a dialog box, asking you to give the node a name and customize some settings. Call this node TODO, make sure that Rich Text is selected in the Node Type section, and then click OK at the bottom. Now you'll see the interface come to life: The TODO node is available in the list along the left, and on the right you can start typing to add content. Note the status bar along the bottom of the window, which tells you about the type of node you're editing, when it was initially created, and when it was last modified.

The editor pane feels very much like a simple plain text editor, and you'll notice that few buttons in the toolbar are dedicated to modifying the formatting. You'll find bulleted and numbered lists, but that's about it – other formatting buttons are only displayed if you widen the window substantially. Still, a Formatting menu is always displayed, so click in there and have a look around; you'll see the usual bold, italics, and underline options, along with text justification settings and a few headline styles. One particular menu item to note is Set/Unset To-Do List, which lets you create lists with checkboxes next to them. You can then click on the checkboxes to tick them – ideal for a TODO list.

You'll also notice that most of the formatting options have keyboard shortcuts listed alongside. CherryTree isn't a newbie-friendly word processor – it's a power tool, designed to be used quickly and efficiently. As such, it's worth memorizing the most important shortcuts so that you can apply formatting without removing your hands from the keyboard.

At this stage, you may not be a big fan of the default color scheme for rich text nodes (white on dark blue). To change this, click Edit | Preferences in the menu, then go to the Rich Text section on the left. Under Theme, choose Light Background, Dark Text and click Close. Your setup will look like the one in Figure 2.

Figure 2: Rich text editing is available in nodes for adding formatting, bulleted lists, and checkboxes (ideal for to-do lists).

Pretty as a Picture

As well as text with various formatting options, you can add other things to a node's content. Look on the toolbar, for instance, and you'll see that you can insert images. When you do so, you're prompted to rotate the image to your liking and set its size before it's added to the node. Again, this may seem rather fiddly to work with, but remember that CherryTree is a tool for managing structured data rather than WYSIWYG documents like Scribus.

You can also insert tables into a node, specifying their dimensions and optionally populating them with content from a CSV file. To edit the names of columns, move them around, and delete them, just click on the title. If you want to add source code snippets to a node, click the Insert a CodeBox button in the toolbar. You can then set up the box's size, and apply syntax highlighting for many different languages. This makes CherryTree especially useful for coding (or sys admin) tasks, where you want to mix up notes and chunks of code.

A few other toolbar buttons are worth knowing about. Insert File doesn't actually put the contents of a file inside the node but, instead, provides a link to the file; double-click it, and it'll open using whatever program is assigned for that file type in your desktop environment. Similarly, you can insert links to websites, files, folders, and other nodes in your CherryTree setup, giving the links names, just as you would do in an HTML document. To turn a link into normal plain text, right-click on it and choose Dismiss from the menu.

Try experimenting with combinations of images, tables, code boxes, and links to see how they can be combined. To delete images, tables, and code boxes, just click to the right of them, which will display a large cursor – then hit the backspace key.

As your nodes become longer and more detailed, you may want to add some navigation options for them. A handy way to do this is to create a table of contents – or more precisely, get CherryTree to do all the hard work for you. Try adding a few headings to your node, via the formatting menu (choose the h1, h2, or h3 options). Scatter them around in your node and then go to the top. Click Edit | Insert TOC, and you'll see that a bunch of links are inserted into the node. These links contain the text you used for the headings; click the links to jump to the corresponding location in the node.

The Edit menu contains a few other items that you may find useful, such as the ability to insert a timestamp (i.e., a string containing the current date and time), special characters, and horizontal rules to break up content. If you've pasted in some code from a website or terminal and it has lots of annoying trailing spaces (i.e., spaces lingering on the ends of lines), then the Strip Trailing Spaces option becomes a huge time saver. You can even enable a spelling checker via the Edit menu, if you need it.

Juggling Nodes

So far, I've focused on editing and managing content inside a single node. You've see that CherryTree is already a pretty good app for this job, but its real strengths can be found in its node system. At the moment, you have just one node, so click Tree | Add Node from the menu, and you'll see that a second node is available to select in the panel on the left. This is an empty node, so click it and you can begin editing content on the right. You can now freely switch between nodes – and if you add even more, you can use the forward and backward buttons on the toolbar to move between them, much as in a web browser.

With this in mind, you can create separate nodes for different types of information: personal to-do list, work items, interesting source code snippets, and so forth. But, as mentioned previously, CherryTree is a hierarchical note-taking application. How does that come into play here? Try selecting one of your nodes in the left-hand panel, then go to Tree | Add SubNode in the menu. Give the node a name and click OK.

You'll see that the new node has now been created as a child of the one you selected – in other words, it's part of a higher-level node. Using subnodes, you can start to structure your information much more effectively, adding multiple levels of subnodes where it makes sense. Look at Figure 3, for instance: There, I've created a general Notes node, where I can put scraps of information I need for daily life.

Figure 3: Here, I've created a couple of sub-nodes, that I'm using to keep track of my coding projects.

Underneath that, I've created a Coding subnode – so this is also for notes, but on programming-related topic. There, I can add general tricks and tips that are not about any specific programming language. Underneath that, I've added yet another subnode, this time for Python snippets that may come in useful in my programming jobs.

You can see how useful this approach is when you have lots of information to manage. CherryTree has some helpful extras for managing nodes, such as Tree | Insert Today's Node from the menu. This sets up a new node for the current year, then a subnode for the current month and a subnode of that for the current day. You can use this to keep a diary, for example, or just make notes that are relevant to a specific day.

Using drag and drop, you can move nodes and subnodes around inside the left-hand panel; you can take one child node and make it a child of another node, for example. When doing this, be careful, because the undo/redo option doesn't work in this case. A context menu also pops up when you right-click on a node; to duplicate it, change its properties or move it around in the panel.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News

njobs Europe
What:
Where:
Country:
Njobs Netherlands Njobs Deutschland Njobs United Kingdom Njobs Italia Njobs France Njobs Espana Njobs Poland
Njobs Austria Njobs Denmark Njobs Belgium Njobs Czech Republic Njobs Mexico Njobs India Njobs Colombia