This commit is contained in:
Sung Won Cho 2018-01-21 15:25:16 +11:00 committed by GitHub
commit 922bb4ba04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 110 additions and 174 deletions

96
COMMANDS.md Normal file
View file

@ -0,0 +1,96 @@
# Commands
* [add](#dnote-add)
* [edit](#dnote-edit)
* [remove](#dnote-remove)
* [ls](#dnote-ls)
* [upgrade](#dnote-upgrade)
* [login](#dnote-login)
* [sync](#dnote-sync)
## dnote add
*alias: a, n, new*
Add a new note to a book.
### `dnote add [book name]`
Launch a text editor to add a new note to the specified book.
### `dnote add [book name] -c "[content]"`
Write a new note with a content to the specified book.
e.g.
$ dnote add linux -c "find - recursively walk the directory"
## dnote edit
*alias: e*
Edit a note
### `dnote edit [book name] [note index]`
Launch a text editor to edit a note with the given index.
### `dnote edit [book name] [note index] -c "[note content]"`
Edit a note with the given index in the specified book with a content.
e.g
$ dnote edit linux 1 "New Content"
## dnote remove
*alias: d*
Remove either a note or a book
### `dnote remove [book name] [index]`
Removes the note with `index` in the specified book.
### `dnote remove -b [book name]`
Removes the book with the `book name`.
e.g
$ dnote remove JS 1
$ dnote remove -b JS
## dnote ls
*alias: l, notes*
List books or notes
### `dnote ls`
List all books.
### `dnote ls [book name]`
List all notes in the book.
e.g
$ dnote ls
$ dnote ls golang
## dnote upgrade
Upgrade the Dnote if newer release is available
## dnote sync
*Dnote Cloud only*
Sync notes with Dnote cloud
## dnote login
*Dnote Cloud only*
Start a login prompt

186
README.md
View file

@ -1,200 +1,40 @@
# Dnote CLI
![Dnote](assets/main.png)
A command line interface for spontaneously capturing the things you learn while coding.
A command line interface for spontaneously capturing the things you learn while coding
![Dnote](assets/dnote.gif)
## Installation
## Install
On macOS, or Linux, run:
On Linux or macOS, run:
curl -s https://raw.githubusercontent.com/dnote-io/cli/master/install.sh | sh
In some cases, you might need `sudo`. Feel free to inspect [install.sh](https://github.com/dnote-io/cli/blob/master/install.sh):
In some cases, you might need an elevated permission:
curl -s https://raw.githubusercontent.com/dnote-io/cli/master/install.sh | sudo sh
On Windows, download [binary](https://github.com/dnote-io/cli/releases)
On Windows, download [binary](https://github.com/dnote-io/cli/releases).
## Overview
Dnote categorizes your **notes** by **books**.
We learn everyday while programming. And we forget most of them exponentially because don't write them down.
All your books and notes are stored in `$HOME/.dnote` as a JSON file.
You can optionally sync your note with Dnote server. Syncing will allow you to interact with your notes using the web frontend at https://dnote.io, and set up digest notifications.
Dnote is designed for writing technical notes without switching context from programming.
## Commands
### dnote use [book name]
*alias: u*
Change the book to write your note in.
e.g.
dnote use linux
### dnote new
*alias: n, add*
Write a new note.
#### Usage
* `dnote new "content"`
Writes a new note with `content` to the current book.
* `dnote new [book name] "content"`
Writes a new note with `content` to the book with the name `[book name]`.
e.g.
dnote new "set -e instructs bash to exit immediately if any command has non-zero exit status"
dnote new linux "Use find - recursively walk the directly."
### dnote edit
*alias: e*
Edit a note
#### Usage
* `dnote edit [note index] "[note content]"`
Edits the note with `note index` in the current book.
* `dnote edit [book name] [note index] "[note content]"`
Edits the note with `note index` in the specified book.
e.g
$ dnote notes
* [0] - Content index 0.
* [1] - Content index 1.
* [2] - Content index 2.
$ dnote edit 1 "New content"
[+] Edited Note : 1
$ dnote notes
* [0] - Content index 0.
* [1] - New content.
* [2] - Content index 2.
$ dnote notes linux
* [0] - Linux Content 0
* [1] - Linux Content 1
* [2] - Linux Content 2
$ dnote edit linux 1 "New Content"
[+] Edited Note : 1
$ dnote notes linux
* [0] - Linux Content 0
* [1] - New Content
* [2] - Linux Content 2
### dnote delete
*alias: d*
Delete either a note or a book
#### Usage
* `dnote delete [book name] [index]`
Deletes the note with `index` in the specified book.
* `dnote delete -b [book name]`
Deletes the book with the `book name`.
e.g
$ dnote notes JS
* [0] - Content 0.
* [1] - Content 1.
* [2] - Content 2.
$ dnote delete JS 1
[+] Edited Note : 1
$ dnote notes
* [0] - Content 0.
* [1] - Content 2.
$ dnote books
JS
linux
Go
$ dnote delete -b JS
$ dnote books
linux
Go
### dnote books
*alias: b*
List all the books that you created
e.g.
$ dnote books
javascript
* linux
tmux
css
### dnote notes
*alias: ls*
List all notes in the current book
#### Options
* `-b [book name]`
Specify the name of the book to read from
e.g.
$ dnote notes
On note JS
* .bind() creates a new function
* arrow function uses less memory than function with .bind()
* the time passed to setTimeout is minimum, no guaranteed time
### dnote sync
Sync notes with Dnote server
### dnote login
Start a login procedure which will store the APIKey to communicate with the server
### dnote upgrade
Upgrades the Dnote if newer release is available
Please refer to ![commands](/COMMANDS.md).
## Links
* [Website](https://dnote.io)
* [Making Dnote (blog article)](https://sungwoncho.io/making-dnote/)
* [Pitching Dnote (pitch to live audience and panelists)](https://sungwoncho.io/pitching-dnote/)
* [Dnote](https://dnote.io)
* [Dnote Cloud](https://dnote.io/cloud)
* [Making Dnote](https://sung.io/making-dnote/)
* [Pitching Dnote](https://sung.io/pitching-dnote/)
## License
MIT
[![Build Status](https://travis-ci.org/dnote-io/cli.svg?branch=master)](https://travis-ci.org/dnote-io/cli)
-------
> Made by [sung](https://sungwoncho.io)

BIN
assets/dnote.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

View file

@ -18,7 +18,7 @@ import (
const (
// Version is the current version of dnote
Version = "0.2.0-beta.1"
Version = "0.2.0"
// TimestampFilename is the name of the file containing upgrade info
TimestampFilename = "timestamps"