Pages

Navitron

2020-05-28

Notey: a command line notebook

Introducing Notey: command-line notebook.

The glorious ASCII graphics of another command-line session.

I have a real need to keep and remember short snippets of text, for example, my phone number, real name and world-domination plans. Over the years I have used many applications, such as OneNote, Google Keep, Zim, Treepad Lite, Sticky notes etc...etc, but I feel the need for a simpler app, one without any graphical fuss and nonsense. I want the same program to run just as well under Windows as it does under the Linux shell or on my Raspberry Pi. So, with the bit of time I have had on my hands in the current UK lockdown, I have built Notey: command line notebook.

Introduction

You can think of Notey as a bit like Google Keep, but you interact with a series of text commands. I am not 100% serious about this, however, it does work well and is quite powerful in terms of the actions you can perform on your data. There is a comprehensive help system built-in and the very first command you will want to learn is 'help'.

32 commands are available, but you are not expected to remember them all.

Making new pages

Notey is simply a big list of named 'pages'. The first thing you will want to do is create a new page. This is achieved with the 'open' command, for example:

> open cat
This will prompt you to create a new page called 'cat'.

The in-built help documentation for the 'open' command.

As you can see, the 'open' command is used for creating new pages as well as opening existing pages. Most commands in Notey can take various options as parameters (shown above), for example, if you are really sure that you want to create a new page called 'cat' (and not open an existing page called 'cat'), you could type the following:
> open -p cat
Commands can take multiple options, for example:

> open -rpl*d cat

Will create a new page called 'cat', lock it so it cannot be accidentally deleted, automatically tag it with today's date and mark it as 'important'. The option -r then returns a little report showing you what Notey has been up to whilst you were waiting, as you can see in the image below.

Isn't everyone's cat important?

Editing pages

When you have a page open, you will see the page name appears just before the prompt. Pages that are thus 'opened' can be edited in a number of ways. You are most likely to want to add some text to this page.

For example, you could try the following command:

> append Not a dog.

This will enter the text "Not a dog." into this page. Except - it probably won't! You will get an error. Remember how we locked the page in the previous command? Locked pages cannot be (accidentally) edited, so we have to specify that we intend to purposefully unlock our page, edit it and then lock it again.

Try:

> append -ul Not a dog.
> append -ul Like's fishes.

OK. Big wow! You will probably want to see your handiwork. To view a page on the screen, simply type:

> type

Notey has rather helpfully done a lot here. It has reminded me of my own name, as well as the number of pages I have written. It is showing me that my page 'cat' is currently open and that it is 'locked' and 'important'. When I type 'type', I get to read the note on the screen.


Currently, there are related commands for editing your pages, for example: 'prefix' and 'replace', but append will do for now.

Tags

Pages in Notey can be tagged so you can find related information easily.

Let's tag our page with a list of tags:

> tag pets,animals

This will add two tags, 'pets' and 'animals' to the current 'cat' page. We already tagged our page with the current date with the 'open -d' command earlier. Forgotten already? I don't know! Actually, it is easy to get a little confused at times when using Notey, but thankfully there are a number of ways of getting information on what you are doing.

Table of contents

You will want to see what pages you have available in your notebook. The 'toc' command brings up a table of contents. You may want additional information such as a page summary, or list of tags.

Try:

> toc -t

This will display all the pages in the book including a summary of the tags for each page.

Now I will never forget my own address again.

You can also specify a search term to filter the table of contents. For example, need to see only those pages with 'cat' in the title? Try:

> toc -t cat

If you need more advanced filtering then you need to get your head around the 'group' command.

Grouping

Groups allows you to group pages based on a search term or tag name or other property. This allows you to apply commands to all the pages in the group. For example, if you need to add the text 'remember to feed' to all pages with 'cat' in the description, that have been marked as 'important' and have been tagged as '#animals', then you need to get your head around groups.

> group -t pets

Will find all of the pages with a tag '#pets' and put them into the group.

> toc -t@

Will show the table of contents for the current group.


If you search the help documents for the various commands, you can see that the '@' symbol refers to 'all pages in the group'. For example, if you want to append some text to all the pages in the group, try:

> append -@ Remember to feed.

OK - admit it! How many note-taking apps let you edit multiple pages at the same time?

This is the power of groups in Notey. There is also an 'addto' command, which allows you to manually add pages to the group, and the 'similar' command, which lets you see similar pages.

Similar pages

OK, so, you have spent your time carefully categorising your notes with sensible names and a comprehensive library of tags. Now, it is time for the 'similar ' command. It groups pages from your notebook that are 'similar' to the currently open page.

Namelists

You will frequently want to apply the same command to multiple pages at once. This is where namelists come in.

Try:

> open cat,dog,unicorn

This will prompt you to create three pages called 'cat', 'dog' and 'unicorn' respectively.

You can use the '@' symbol to refer to the current group. For example:

> del cat,unicorn,@

Will prompt you to delete the pages called 'cat', 'dog' and whatever pages are in the current group.

Other stuff, briefly...

A quick tour of some of the other features of Notey.

Your pages can be exported to XML, HTML, plain text or Treepad Lite files.

My Notey notebook as a Treepad lite file (OK, more about Treepad lite another time - spoiler alert - it is no longer a thing but that does not mean it is gone forever!)

You can use Notey as a diary. Simply type:

> diary

This creates a page with the current date for you to record all of your evil machinations from the day (or your good deeds).

You can get a calendar for any month (within reason):

> calendar 2020 06
Next month. Unless you are living in the future (which you most likely are) in which case you know more about June 2020 than I do. It can't get any worse can it? Can it?! Why are you laughing??!

Chain

Notey can accept multiple commands on one line using the 'chain' command.

Eg:

> chain open cat; tag animals; lock

In this case, Notey will diligently open the page 'cat', tag it '#animals' and then lock it. It is vital that each command is separated by a semi-colon.

Future updates

Some things that still need doing:
  • importing pages from files;
  • running scripts from a file;
  • hiding sensitive data;
  • exporting to other formats (MS-Word, anyone?)
There are, no doubt, many bugs, and a lot that could be done more efficiently. But the source code is provided for your entertainment.

Th..th..that's all folks!

Well, that's it for this introduction. I hope you can see that Notey is a powerful personal information management system. There is much more that it can do, but you will have to explore this yourself. Remember it is just for fun and not super secure so it is not a good idea to store sensitive information at this stage.

Notey is currently in an alpha release stage. You are free to download either the python source code or the Windows executable version and do what you like with it. I am sure that I will be adding more functionality soon, and I will be encouraged by anyone who finds it useful - so Tweet ME.


...or click this OneDrive link below...


If you enjoyed this post, then it shows that you have great taste, and you might like to read more of my stuff

No comments:

Post a Comment