Giter Club home page Giter Club logo

husk's Introduction

Husk

Husk is an API and CLI written in Python for the Cornell Note-taking System.

Install

# using pip
pip install husk

# using easy_install
easy_install husk

CLI

General Help

Husk command help:

usage: husk [-h] [-v] {init,add,move,remove,workon,info} ...

Husk is an API and CLI written in Python for the Cornell Note-taking System.

positional arguments:
  {init,add,move,remove,workon,info}

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

Initialize Repository

usage: husk init [-h] [-d] [path]

Initialize a Husk repository in the current working directory (cwd) unless a
`path` is specified.

positional arguments:
  path            Path to Husk repository

optional arguments:
  -h, --help      show this help message and exit
  -d, --defaults  Add a copy of the Husk defaults to the repo control
                  directory.

The result will be the creation of a .husk directory in the specified path.

Add Note

usage: husk add [-h] [-r REPO] [-f] [path [path ...]]

Adds a note to the repository specified by it's `path`. If `path` is an
existing directory/note, pass `--force` to register it with the repository.
Existing files of the same name will not be overwritten.

positional arguments:
  path                  Paths to note directory

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  Path to Husk repository
  -f, --force           Force an existing unregistered note to be added to the
                        repository

Move a Note

usage: husk move [-h] [-r REPO] src dest

Moves an existing note to a new path.

positional arguments:
  src                   Source path to note that will be moved
  dest                  Destination path of the note

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  Path to Husk repository

Remove a Note

usage: husk remove [-h] [-r REPO] [-d] [path [path ...]]

Remove a note from the specified repo. By default note files are not deleted.

positional arguments:
  path                  Path to note directory

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  Path to Husk repository
  -d, --delete          Delete note files from disk

Workon a Note

usage: husk workon [-h] [-r REPO] path [files [files ...]]

Command to "work on" a note of files with the editor defined in your Husk
settings and falls back to what is set in the $EDITOR environment variable.

positional arguments:
  path                  Path to note directory
  files                 Filenames to be opened

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  Path to Husk repository

Repo Info

usage: husk info [-h] [-r REPO] [{notes} [{notes} ...]]

Shows various info about the repo.

positional arguments:
  {notes}               Specify which kinds of info to be presented

optional arguments:
  -h, --help            show this help message and exit
  -r REPO, --repo REPO  Path to Husk repository

husk's People

Contributors

bruth avatar

Stargazers

 avatar  avatar

Watchers

 avatar

husk's Issues

Subcommand help info doesn't show subcommand name

For instance, $ husk init -h outputs:

usage: husk [-h] [-d] [path]

Initialize a Husk repository in the current working directory (cwd) unless a
`path` is specified.

positional arguments:
  path            Path to Husk repository

optional arguments:
  -h, --help      show this help message and exit
  -d, --defaults  Add a copy of the Husk defaults to the repo control
                  directory.

where the first line
usage: husk [-h] [-d] [path]
should be
usage: husk init [-h] [-d] [path]

Add commit command

If the repository is tracked using Git, changes to notes may be committed using the husk commit command. The autocommit option will be introduced to auto-commit changes after a successful exit after using husk workon. If a non-successful exit occurs a warning message will be printed to tell the user to use husk commit (or of course manually using git).

Add API test cases

The CLI tests do a decent job at testing the functionality of the underlying API, but adding tests will ensure the API is sound for independent usage.

Implement Git hooks for deriving the history of a note

This hook will be available if the repo is also a Git repo. The history of a note can be derived version to version. Useful info surrounding a note's history may include:

  • date of each change (timeline)
  • number of additions/deletions in each change (significance/impact)

Integrate a note "info file" to store various metadata about the note

This implementation is an alternative to #8 to store metadata such as a title of the note, tags, etc. This would exist the .husk repo directory as a directory of named relative to their directory paths. Given a few notes:

$ husk info
2 notes
-----
bar
foo/bar/baz

A corresponding set of files would be written to .husk/info:

$ ls .husk/info
bar.ini  foo-bar-baz.ini

The file would be a typical .ini file looking like the following:

[general]
title = An Awesome Note About Bar
tags = foo, bar, baz

Abstract out API from CLI

Ensure the non-CLI code raises the correct exceptions, but the CLI wrappers should print the error messages or may even exit safely in certain cases.

Implement "in-memory" interface across repo-related classes

This serves two purposes. The primary purpose is the ability to programmatically create a repo, config and populating bundles without writing to disk. This enables writing to multiple directories using the same in-memory data structure. A side effect of this is the ability to clone a repo and write it to another location.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.