Package: donno
DonnoA full-featured note-taking application in terminal.FeaturesEasy note management: add, update, list, remove note;Organize notes in hierarchical notebooks;Full featured formating support: you can add rich texts (markdown),
mathematical formula (mathjax, LaTeX), diagrams, charts (mermaid),
images, and attachments. All will be rendered and displayed lively in your browser;Powerful and fast full-text search. Get all information at your fingers;Safe and secure: all notes are saved in plain texts (markdown). You own your data.
You can view and update your notes without any specific applications
but a text editor when necessary. All notes store in private git repository;Live in console: git style APIs. No need to learn a new GUI app.
Get your notes anytime, anywhere: Linux, macOS, Windows (through WSL),
Android (by Termux), SSH, ...Installpip install donnoPrerequisitesgitfor note synchronization;pandocandmermaidfor preview with browser.On Debian-based systems, install them with:apt install git pandoc
npm install -g @mermaid-js/mermaid-cli mermaid-filterUsagedon add        # create a new note
don list       # list notes in all notebooks
don list-notebooks    # list existing notebooks in alphabet order
don search nim thunder    # search notes contains "nim" and "thunder"
don edit 3     # edit note #3 in note list or searching results
don delete 3   # delete note #3 in note list or searching results

don backup     # backup notes to remote repository
don restore    # restore notes from remote repository
don backup-patch  # backup notes out of git revision to tarball, default to /tmp
don restore-patch # restore notes from patch file

don preview 3  # preview note #3 in console editor
don pv 3       # preview note #3 in browser
don ads -b Tech -n nim -t config -c compile  # advanced search, see below for explanations
don s '(python.*program|learning.*algorithm)'  # search notes with regex, see below for explanations
don pub        # publish notes to blogNote:Most long commands have aliases (abbreviation) for convenience.
For example,afor add,lfor list,sfor search,adsforadvanced-search, etc. Get alias of a command with-hoption.The command options have 2 forms: full and abbreviation.
For example, in commandads,-bis the abbr. of--book,-t:--tag,-n:--name, etc.Add attachments in a noteYou can add attachments in your notes.
They could be image files, which are added by![<image-file-name>](),
or other files, which are added by[<attachment-file-name>]()(without exclamation mark ahead, like common markdown links).The attachment file specified in the link must exist in the folder you add the
note (the folder you rundon a),
or "attachment file not exists" error will be raised.Under the hoodWhen you save a note and quit the editor,
donno will scan all[<filename>]()pattern in the note.
If the s exist in the current folder,
donno do the following things:Generate a  for each attachment;Copy each file to /resources folder (get the path of
 withdon conf get repo)
with their s;Update the link in the note from[<filename>]()to[<filename>](<internal-name>)The  is composed of 5 parts:Prefixresources/, for all attachments are saved in this folder inattOrder numberFile extension of original fileFor example, if you add the following attachments in the note with filenamenote201118140711.md:![myimage.png]()
[mydoc.pdf]()They  will be updated to:![myimage.png](resources/note201118140711att1.png)
[mydoc.pdf](resources/note201118140711att2.pdf)If the attachment file doesn't exist in the current folder,
donno will give a warning:File myimage.png does not exist in the current folder.
You can run `don e ...` at the folder where myimage.png exists.ConfigurationFile path: ~/.config/donno/config.jsonConfiguration ItemsGeneralapp_home: root folder of donno data files. Default: ~/.donnorepo: folder to save all note files and resource files. Default: $app_home/repoeditor: which application to use to create/update note. Default:nvimviewer: which application to use to view notes in console. Default:nvim -Rdefault_notebook: default notebook name for a new note. Default:/Diarylogging level: debug or info(default)editor_envs: environment variables of the editor. For example,
envXDG_CONFIG_HOMEis used by neovim to load config/plugins to parse markdown files.
Default:~/.configBlogurl: blog urlpublish_cmd: command to publish notes to blogManage Configurationsdon conf get                # list all current configurations
don conf get edtior         # get which editor to use
don conf set editor nvim    # set the editor, make sure you've installed it
don conf set default_notebook /Diary/2020

# set nested attribute:
don conf set editor_envs.XDG_CONFIG_HOME $HOME/.config/vimrcs/text

# restore default values of configurations:
don conf restoreUpdate and uninstallpip install --upgrade donno
pip uninstall donnoImport & Export between Other Note-taking AppsSupported import formats:JoplinSupported export formats:JSONmarkdownExamples:Import notes from Joplin:jop export --format json jopdb
don imports jopdb --source-type joplinExport notes as JSON files and save into folderdonno_export:don exports --type jsonList parameters withdon export -handdon import -h.Advanced searchTo be updated!To search notes with more details, useadvanced-searchcommand.
For example, to search notes in notebookTech, and "nim" in title,
"config" in tags, "compile" in contents:don ads -b Tech -n nim -t config -c compilewhich is abbreviation form of:don advanced-search --book Tech --name nim --tag config --content compileYou can also use regex in search term.
For example, to search notes contains "python...program"or"learning...algorithm":don s '(python.*program|learning.*algorithm)'Synchronization between Multiple DevicesMain method: VCSTo sync notes between multiple devices,
you need aremoteVCS (version control system) repository.
The simplest way is creating it on a source-code-hosting platform,
such as github.com, gitlab.com, gitee.com, etc.Then push yourlocal note folder(get its path withdon conf get repo,
if you didn't set it explicitly) to remote repository.On a new device, clone the remote repository to the local note folder.When you update notes on device A, and want to sync the changes to device B,
rungit pullin the local note folder of device B.With the powerful merge function of git,
you can create and/or update notes on multiple devices simultaneously,
then sync them withrebaseor other methods.Complement method: patch fileWhen the changes of notes are too small to form a meaningful commit,
you can patch them to a file, then restore it on another device.Publish to BlogIf you want to publish notes in a specified notebook to blog,
seeblog docfor details.Some notesInstall in virtual environmentFor those who don't want install apps in global environment,
install it in a virtual environment:mkdir ~/apps/donno
cd ~/apps/donno
python -m venv env
. env/bin/activate
pip install donno

cat << EOF >> ~/.zshrc
function dn() {
  source $HOME/apps/donno/env/bin/activate
  don $@
  deactivate
}
EOFNow the command isdninstead ofdon.RoadmapIn developingOn scheduleBasic publishing module: publish to blog, such as github.ioAdvanced publishing function: publish specific note, or notes in specific notebookSearch notes with the whole words;Better appearance: beautify output table with libraries likecolored,tabulate, etcSearch notes with keywords (which is extracted with AI algorithms, such as NLP, TF-IDF, etc);Similar notes recommendations of a specific note with recommendation algorithms;Note syntax check with NLP;Knowledge graph construction and visualization (in TUI) from a specific root (note);Note translation, English to Chinese and vice versa.Suggest when typing. For example: press TAB after inputdon s py, some candidates displayed
below: python, pyhive, pynvim, ...CompletedSynchronize notes with patch file as the complement to the main sync
mechanism based on git;Basic note-taking functions: add, delete, list, search, view, update notesConfiguration module: seeConfiguration;Preview: render markdown notes to HTML and previewed in browserSupport adding attachments into notes, especially imagesAdd logging system, distinguish application (for end user) and debugging (for developer) logsNotebook management: list notebooks, list notes in specified notebookSynchronize notes between hosts (based on VCS, such as git)Import/Export from/to other open source note-taking apps,
such asJoplinAdvanced search function: search by title, tag, notebook and contentSearch with regular expression