tanager

0.1.0 • Public • Published

Manage your notebooks. Start writing quickly.

Build Status

Icon

tanager: Hassle Free Writing

tanager is a notebook manager. It helps you organize files for writing. Use it to organize your journals and notes. It does not impose any structure on these files, but it is opinionated about where the files are stored and how they are named. If you don't like those opinions, you can customize it to do what you want.

If you like to maintain notes in flat files and spend a lot of time navigating to the correct directories or abiding by your own naming conventions, tanager could be for you.

Overview

tanager does absolutely nothing fancy. It could just as easily be a shell script or system of shell aliases. For example, imagine this workflow. I have a meeting today with Joe. It is for work, and I like to keep my work notes in ~/Dropbox/notes. Before each meeting I type vim ~/Dropbox/notes/2017/2017-03-07_joe-meeting.md. Then I take notes. This is completely reasonable, but it's a lot of work to get up and running. Instead, I can type tanager notes joe meeting and it will accomplish the exact same thing.

I organize my journal the same way as I do my notes. I write more journal entries than notes, so my default notebook is journal. Since it is the default, tanager journal day one in peru and tanager day one in peru do the same thing. (Note that if you had a notebook called day, it might not do what you wanted, instead adding an entry to the notebook called day.) If I'm just making a quick note and I don't want to give the file name a title, the default title will be daily.

Installation

Keep in mind that however you install it, you'll have to set up a config file before it will work. Eventually I might add a smart setup option, but for now you have to do this by hand. See the Configuration section below.

You can run tanager from your local repo by cloning and typing npm install -g from the local directory. Alternatively, you can use npm:

npm install -g tanager

To run tests:

npm test

Usage

Overview

tanager helps you start writing quickly. See the understanding tanager section to see where it puts your files. To start writing notes in your notes notebook:

tanager notes meeting with vip

If the day is March 9, 2017, this will by default open your editor with a file called: 2017-03-09_meeting-with-vip.md. You can then begin editing.

If you also have a notebook called journal, you can instead type:

tanager journal day one in peru

By default this will open a file named 2017-03-09_day-one-in-peru.md, but will be in your journal notebook (i.e. saved in a different directory).

By default these files will be in your notebook saved in a directory for the year--2017 in the examples above. See the Configuration section for more information on customizing the paths.

Specifying a Date Other Than Today

You can also specify a different date using the -d flag. This does its best to do natural language parsing as provided by the chrono library. To start a journal entry for yesterday, you can say:

tanager -d yesterday leaving for lichtenstein

This will interpret yesterday to be the date, so instead it will open your editor to 2017-03-08_leaving-for-lichtenstein.md.

Editing Last Modified File

The -r/--recent and -l/--last flags will begin editing the most recently modified file in a given notebook, allowing you to repeatedly update an entry over the course of a day or jump back in after a restart.

Full Output of tanager --help

  Usage: tanager [options] <words...>

  Options:

    -h, --help                       output usage information
    -V, --version                    output the version number
    -c, --config-file <config-file>  Path to config file. Defaults to
                                       ~/.tanager.json
    -d, --date <date>                Date of the entry. Yesterday, dec5,
                                       "dec 5", etc
    -e, --editor-cmd <editor-cmd>    Editor used to edit. Defaults to
                                       config.editor, $VISUAL, then $EDITOR
    -r, --recent                     Edit the most recently modified file in
                                       a notebook (same as --last)
    -l, --last                       Edit the last modified file in a notebook
                                       (same as --recent)
    --pwd                            Print the path to the notebook

Understanding tanager

tanager separates writing into different files for each day. A basic directory structure for a journal might look like:

journal/
  2016/
    2016-03-05_day-in-london.md
    2016-03-06_daily.md
  2017/
    2017-01-01_new-year-party.md
    2017-01-01_daily.md

Some things to notice:

  • Files are organized by year.
  • Files are prefixed by date.
  • Files are saved as markdown.
  • Files can be given a title. If no title is given, it is given the default title daily.
  • Document trees, or 'notebooks' can be rooted at different locations. In this case it is rooted at journal/, but you can have multiple notebooks on the same system. In this way tanager journal would open an entry for your personal journal, but tanager notes would open an entry for your notes files.

Configuration

Config information lives in ~/.tanager.json. It should have at a minimum a notebooks object, where each property is a notebook name and points to an object that includes a path property. default: true indicates that this is the notebook that should be used if no name is specified.

For now the quickest way to understand it is with an example:

{
  "notebooks": {
    "journal": {
      "path": "~/Dropbox/journal/",
      "template": "<YYYY>/<YYYY-MM-DD>_<title>.md",
      "defaultTitle": "daily",
      "aliases": ["j", "jl"],
      "default": true
    },
    "notes": {
      "path": "~/Documents/notes"
    }
  }
}

Note the template and defaultTitle keys.

The template key allows you to organize your files within a notebook. The strings in angled brackets (except for the special case <title>) are passed to the moment.js format function. In the example above, the template says that for March 19, 2018, invoking tanager would open the file:

~/Dropbox/journal/2018/2018-03-19_daily.md

If you do not specify a title, the property defaultTitle is used. If you do not specify defaultTitle, the default daily is used. If you do not specify a template, the default template is <YYYY>/<YYYY-MM-DD>_<title>.md.

If you want your files saved by year and month, you could set template to be:

<YYYY>/<MM>/<YYYY-MM-DD>_<title>.md

If a template is specified, it must include <title>.

Shout-outs

tanager is inspired by tools like jrnl but does not try to replace them. They do different things. If you set your jrnl file to reside in the root directory of a tanager notebook, you could even get the best of both worlds--keeping jrnl for your short entries, if you like that kind of thing, but using tanager to manage longer entries.

If tanager doesn't meet your needs, here is a list of other tools that do similar things:

Readme

Keywords

Package Sidebar

Install

npm i tanager

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

5.74 MB

Total Files

14

Last publish

Collaborators

  • srsudar