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>
หนังสือสามารถแบ่งได้สองวิธี จากผลลัพธ์ของการสืบค้นหรือรายการ Note ID
โดยการสอบถาม
qnote split query <book name> <query>
สิ่งนี้จะสร้างการค้นหาแบบสอบถามล่วงหน้า (โดยใช้ QueryStringQuery) ในสมุดงานและผลลัพธ์ของแบบสอบถามจะถูกย้ายไปยัง <book name>
(สร้างขึ้นหากไม่มีอยู่) คุณไม่จำเป็นต้องระบุหนังสือในสตริงการสืบค้น มันถูกเพิ่มไว้สำหรับคุณแล้ว
โดยรหัส
qnote split ids <book name> <note ids...>
ซึ่งทำเช่นเดียวกัน แต่แทนที่จะค้นหา Notes จะย้าย Notes สำหรับรหัสที่กำหนด
หากต้องการเปิดตัวแก้ไข (Vim เริ่มต้นแทนที่ด้วย Env: EDITOR) และสร้างบันทึกใหม่
qnote new note
โน้ตจะถูกส่งผ่าน parser ซึ่งใช้บรรทัดแรกเป็นชื่อและส่วนที่เหลือเป็นเนื้อหา คำใดๆ ที่ขึ้นต้นด้วยอักขระ #
จะถูกนำมาใช้เป็นแท็กสำหรับบันทึกย่อ
การสร้างบันทึกด้วยข้อความต่อไปนี้
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 จะสร้างคำขอ GET ล่วงหน้าบน URL มันจะแยกวิเคราะห์ 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 ที่อยู่ใน $HOME/.config/quicknote
บน Linux และ $HOME/Library/Application Support/quicknote
บน Max OSX
หากต้องการค้นหาบันทึกย่อของคุณในสมุดงานโดยใช้คำนำหน้าวลี
qnote search query
คุณยังสามารถใช้ไวยากรณ์คิวรีที่มีประสิทธิภาพยิ่งขึ้น QueryStringQuery (Bleve ElasticSearch) ได้ด้วยการตั้งค่าแฟล็ก -q
หมายเหตุ เมื่อใช้แฟล็ก -q
เคียวรีจะรันบนหนังสือทั้งหมด
ฟิลด์ที่คุณสามารถค้นหาได้ ได้แก่ id
, created
, modifed
, title
, tags
(รายการที่แยกกันทั่วไป), body
และ book
ดังนั้น หากคุณต้องการค้นหาบันทึกย่อในหนังสือ "งาน" ที่มีแท็ก "projectx" คุณจะวิ่ง
สำหรับเบลฟ
qnote search -q "+book:Work +tag:projectx"
และ ElasticSearch
qnote search -q "book:Work AND tags:projectx"
เมื่อคุณสร้าง แก้ไข และลบบันทึกย่อ qnote จะดูแลการอัปเดตดัชนี แต่หากคุณต้องการจัดทำดัชนีใหม่ด้วยเหตุผลต่างๆ เช่น เปลี่ยนผู้ให้บริการจัดทำดัชนี ติดตั้ง ElasticSearch ใหม่ การคัดลอกฐานข้อมูลบันทึกย่อจากระบบอื่น คุณสามารถวิ่งได้
qnote search reindex
และ qnote จะจัดทำดัชนีบันทึกทั้งหมดใหม่
วิธีที่ง่ายที่สุดในการสำรองข้อมูลบันทึกย่อของคุณคือการคัดลอก qnote.db ในไดเร็กทอรีข้อมูล $HOME/.config/quicknote
บน Linux และ $HOME/Library/Application Support/quicknote
บน Max OSX คุณยังสามารถส่งออกรายการในรูปแบบ csv หรือ json ด้วยแฟล็ก -f
ในคำสั่ง qnote ls notes
ขณะนี้ยังไม่มีวิธีกู้คืนบันทึกย่อจาก 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.