Qnote 讓您可以快速建立和搜尋數以萬計的簡訊。
#
筆記儲存在 SQLite 資料庫中(即將支援更多資料庫)。搜尋由 Bleve(預設)或 Elasticsearch 提供,並進行一些額外的設定。
如果您還沒有這樣做,則需要設定 Golang。比你剛跑
go get github.com/anmil/quicknote/cmd/qnote
這將拉取該程式庫並將其建置到您的 Golang bin 目錄中。
書籍允許您將相關筆記彼此分開,例如工作筆記與個人筆記。除非另有說明,每個操作僅在工作簿上執行。您可以使用-n
標誌變更工作簿。
創建一本新書
qnote new book <book name>
qnote ls books
您可以刪除書籍以及書中的所有筆記。
qnote rm book <book name>
如果您想刪除一本書但保留筆記。您可以將這本書合併到另一本書中。合併書籍將一本書中的所有筆記移到另一本書,然後刪除空書。
qnote merge <book to delete> <book to move notes to>
書籍可以透過兩種方式分割,可以是查詢結果,也可以是筆記 ID 清單。
透過查詢
qnote split query <book name> <query>
這將在工作簿上執行查詢搜尋(使用 QueryStringQuery),查詢結果將被移至<book name>
(如果不存在則建立它)。您不需要在查詢字串中指定書籍。它已經為您添加了。
透過 ID
qnote split ids <book name> <note ids...>
其作用相同,但不是查詢註釋,而是移動給定 id 的註釋。
開啟編輯器(預設 Vim,使用 Env: EDITOR 覆蓋)並建立新註釋
qnote new note
註解透過解析器運行,解析器將第一行作為標題,其餘的作為正文。任何以#
字元開頭的單字都用作註釋的標籤。
使用以下文字建立註釋
This is a test #note
notes are #cool and #fun
one #note is never enough
將建立一個標題為This is a test #note
、標籤為note, cool, fun
和正文的註釋
notes are #cool and #fun
one #note is never enough
您也可以從 URL 建立註釋。
qnote new url <url>
qnote 將對 URL 執行 GET 請求。它將解析傳回的 HTML 中的網頁title
、 meta[name=keywords]
和meta[name=description]
標籤。標題加上 URL 作為標題,關鍵字作為標籤,描述作為正文。它將打開填寫此資訊的編輯器,並允許您在保存之前進行更改。
列出書中的所有筆記
qnote ls notes
列出所有書中的所有筆記
qnote ls notes all
開啟編輯器並編輯註釋
qnote edit note <note id>
刪除註釋
qnote rm note `<note id>`
qnote 預設使用 Bleve,但也支援 ElasticSearch,用於索引筆記並允許搜尋。如果您不介意進行一些額外的設置,則建議使用 ElasticSearch,因為它更強大且更快。如果安裝 Elasticsearch,則可以編輯 qnote 的設定文件,該文件位於 Linux 上的$HOME/.config/quicknote
和 Max OSX 上的$HOME/Library/Application Support/quicknote
中。
使用短語前綴在工作簿中搜尋筆記
qnote search query
您也可以透過設定-q
標誌來使用更強大的查詢語法 QueryStringQuery (Bleve ElasticSearch)。請注意,使用-q
標誌時,查詢將在所有書籍上運行。
您可以搜尋的欄位包括id
、 created
、 modifed
、 title
、 tags
(公共分隔清單)、 body
和book
。因此,如果您想在“工作”一書中搜尋帶有“projectx”標籤的任何筆記。你會跑
對於布萊夫
qnote search -q "+book:Work +tag:projectx"
和彈性搜尋
qnote search -q "book:Work AND tags:projectx"
當您建立、編輯和刪除筆記時,qnote 將負責更新索引。但是,如果您由於某些原因需要重新索引,例如變更索引提供者、重新安裝 ElasticSearch、從另一個系統複製註釋資料庫。你可以運行
qnote search reindex
qnote 將重新索引所有筆記。
備份筆記最簡單的方法是複製資料目錄$HOME/.config/quicknote
Linux 上)和$HOME/Library/Application Support/quicknote
(Max OSX 上)中的 qnote.db。您也可以使用qnote ls notes
指令中的-f
標誌以 csv 或 json 格式匯出清單。
目前,無法從 csv 或 json 恢復筆記。
所有命令和標誌都是help
命令中的文件。簡單地運行qnote help <command>
查看任何命令的描述和標誌
範例1:
$ qnote help
Qnote allows you to quickly create and search tens of thousands of short notes.
Create Books to organize collections of notes.
Add tags to notes for more accurate searching.
Export your notes in text, csv, and json.
Notes are stored in an SQLite database (support for more databases is coming).
Searching is provided by Bleve by default, or Elasticsearch with some extra setup.
Usage:
qnote [command]
Available Commands:
delete Delete Note or Notebook
edit Edit Note or Notebook
get Get/List Notes, Notebook, Tags
merge Merge all notes from <book_name 1> into <book_name 2>
new Create new Note or Notebook
search Search notes
split Split Book
version Print the version of qnote
Flags:
-n, --notebook string Working Notebook (default "General")
Use "qnote [command] --help" for more information about a command.
範例2:
$ qnote help edit book
Edit the working Book's name. This requires re-index the Book
Usage:
qnote edit book <new book_name> [flags]
Global Flags:
範例3:
$ qnote get -h
Get/List Notes, Notebook, Tags
Usage:
qnote get [command]
Aliases:
get, list, ls
Available Commands:
book List all books
note List all notes in the working Book, or all notes for the given [note id...]
tag lists all tags for the working Book
Flags:
-f, --display-format string Format to display notes in [ids, text, short, json, csv] (default "text")
-d, --display-order string The order to display Notebook, Notes, Tags [asc, desc] (default "asc")
-s, --sort-by string Sort notes by [id, created, modified, title] (default "modified")
Global Flags:
-n, --notebook string Working Notebook (default "General")
Use "qnote get [command] --help" for more information about a command.