[[file:readme_cn.org][中文版说明]]
** Changlog *** Version 0.4.3 (2024-11-08)
*** Version 0.4.1 (2024-11-06)
*** Version 0.4 (2024-11-04)
After this period of development, the code for org-zettel-ref-mode has finally become modular and robust. No new features will be introduced before version 0.4. Instead, the focus will be on further componentization of the code and providing more customization options.
*** Version 0.3.2 (2024-09-24)
*** Version 0.3.1 (2024-09-15)
*** Version 0.3 (2024-09-03)
M-x org-zettel-ref-init
to open the "Overview Window," displaying the notes recorded in the original document and the marked text.M-x org-zettel-ref-add-quick-note
to directly input notes.[[file:demo/org-zettel-ref-mode-demo.png]]
** Applicable Scenarios
org-zettel-ref-mode
is only effective when org-mode is activated:
However, I generally convert materials directly into org format for saving, so the second scenario is rare.
** Value: A Reading Method That Balances Breadth and Depth
TL;DR Version:
Full Version:
As a longtime note-taking enthusiast and writer, I've gradually realized some "counterintuitive" insights:
The reason is that merely transporting material only increases the amount of information without reprocessing it. Remember the classic hierarchy? Data -> Information -> Knowledge -> Wisdom.
The Zettelkasten method always emphasizes summarizing in your own words, frequently reviewing past notes, and increasing the connections between notes. From a methodological standpoint, it offers at least 4-7 opportunities for information processing.
Even so, the literature and videos introducing the Zettelkasten method often get caught up in the craze of double-linking, falling into the trap of merely saving data—essentially ignoring the method Niklas Luhmann used to handle a massive amount of literature notes.
Let me share a number: among the more than 90,000 index cards Luhmann left behind, over 10,000 were literature notes.
Luhmann's astounding productivity came from an exaggerated amount of data processing, and behind that was his efficiency in handling this data—achieved through the creation of literature notes.
Luhmann had a habit of taking literature notes while reading. His books or materials had no underlining, no margin notes, and were incredibly clean, almost as if they hadn't been read. Each literature note was essentially an index of the material. He only excerpted the original text from the book when absolutely necessary.
However, after understanding how researchers create literature notes, I discovered that Luhmann's literature notes are almost identical to standard research literature notes. They are also annotated in one's own words, while recording the specific location of inspiration in the paper, for future in-depth reading.
In other words, this method of taking literature notes balances efficiency and depth.
When it's unnecessary to deeply understand a material, literature notes can record key points (not the important content, but the insights useful to oneself). When a deep understanding is needed, the literature notes can quickly point to the corresponding context for in-depth reading and thinking, without wasting time re-reading from the beginning.
Besides balancing efficiency and depth, literature notes also have the advantage of easily distinguishing between existing and new information. Concepts or key points that have been annotated similarly before are existing information, and it is unnecessary to annotate them again when encountered in another material. Conversely, concepts, data, or ideas that have not been encountered before are worth annotating and recording their sources, making the discovery of new knowledge easier.
** Installation *** Installation Steps
org-zettel-ref-mode.el
file.~/.emacs.d/lisp/
).~/.emacs
or ~/.emacs.d/init.el
):Example Configuration 1:
(add-to-list 'load-path "~/.emacs.d/lisp/") (require 'org-zettel-ref-mode)
Example Configuration 2:
(use-package org-zettel-ref-mode :ensure t ; If installed via package manager :init (setq org-zettel-ref-overview-directory "~/Documents/org-overviews/") :config (setq org-zettel-ref-quick-markup-key "C-c m"))
Example Configuration 3 (Doom Emacs users):
In ~/.doom.d/packages.el
:
(package! org-zettel-ref-mode :recipe (:host github :repo "username/org-zettel-ref-mode"))
In ~/.doom.d/config.el
:
(use-package! org-zettel-ref-mode :config (setq org-zettel-ref-overview-directory "~/Documents/org-overviews/"))
** Basic Usage
*** Activating the Mode
In any org-mode buffer, run:
M-x org-zettel-ref-init
*** Clean Up <<>> in Source Files
Since the core functionality of adding notes involves adding <<>> target links in the original text, many materials converted to org format come with a lot of <<>> text.
Before annotating or marking text in the org file for the first time, you can use org-zettel-ref-clean-targets
to clean up the format and ensure the quick note feature works correctly.
*** Adding Quick Notes
M-x org-zettel-ref-add-quick-note
*** Quick Markup
M-x org-zettel-ref-quick-markup
*** Sync Overview Files
Automatic sync by default: Automatically runs when saving the source file.
Manual sync: M-x org-zettel-ref-sync-overview
*** Manage Source Files
[[file:demo/org-zettel-ref-list.gif]]
~M-x org-zettel-ref-list~
Reminder: The following commands are all executed within the panel interface.
[[file:demo/org-zettel-ref-list-rename-file.gif]]
~M-x org-zettel-ref-list-rename-file~
Rename according to the fixed format AUTHOR__TITLE==KEYWORDS.org.
[[file:demo/org-zettel-ref-list-edit-keywords.gif]]
~M-x org-zettel-ref-list-edit-keywords~
Independently add one or more keywords to the source file.
[[file:demo/org-zettel-ref-list-delete-file.gif]]
Delete a single file ("d") ~M-x org-zettel-ref-list-delete-file~
[[file:demo/org-zettel-ref-list-delete-marked-files.gif]]
Delete multiple files ("D") Press "m" in the list to mark multiple files, then execute ~M-x org-zettel-ref-list-delete-marked-files~
If the marked files are incorrect, press "u" to clear the marked status, and press "U" to clear all marked statuses.
[[file:demo/org-zettel-ref-list-filter-by-regexp.gif]]
Simple Filter ("/ r"): Use Author, Title, Keywords as filter conditions, only one filter condition can be applied at a time ~M-x org-zettel-ref-filter-by-regexp~
Complex Filter ("/ m"): Multiple filter conditions can be applied using Author, Title, Keywords as conditions
*** ⚠️ Caution
If you're upgrading from an older version, your existing "-overview" files will still work. However, for new files, we recommend using the new association mechanisms.
*** Debugging in org-roam Mode
The M-x org-zettel-ref-check-roam-db
function checks the status of the org-roam database.
*** Overview File Sync Mechanism Optimization
In version 0.3, org-zettel-ref-mode made significant optimizations to the overview file synchronization mechanism:
These optimizations provide the following benefits:
For users who frequently use the overview feature, these optimizations will bring noticeable performance improvements. *** Custom Note Saving Modes (Updated 2024-08-29) org-zettel-ref-mode provides three modes: normal, org-roam, and denote, allowing note files to be saved in the corresponding format. For example, after selecting org-roam mode, the saved note files will automatically include an ID, making them easier to retrieve.
Configuration Method:
=(setq org-zettel-ref-mode-type 'normal) ; Options: 'normal, 'denote, 'org-roam)=
*** Custom Overview File Location
(setq org-zettel-ref-overview-directory "~/my-notes/overviews/")
*** Adjusting Auto-Sync Behavior Disable Auto-Sync:
(org-zettel-ref-disable-auto-sync)
Enable Auto-Sync:
(org-zettel-ref-enable-auto-sync)
*** Enabling Debug Mode If you encounter issues during use, you can enable debug mode to get more information:
(setq org-zettel-ref-debug t)
*** Using Scripts to Convert Documents in PDF, ePub, HTML, MD, TXT Formats to Org Files
[[file:demo/pkm-system-diagram.png]]
Script: [[file:convert-to-org.py]]
org-zettel-ref-mode now supports directly calling external Python scripts from within Emacs to convert various document formats into org files.
**** Key Features
Multi-format Support:
OCR Functionality:
File Management:
Flexible Configuration:
**** Usage Instructions
Configure Python Environment:
(setq org-zettel-ref-python-environment 'conda) ; or 'system, 'venv (setq org-zettel-ref-python-env-name "your-env-name") ; If using Conda or venv
Set Script Path and Folders:
(setq org-zettel-ref-python-file "~/path/to/document_convert_to_org.py") (setq org-zettel-ref-temp-folder "~/Documents/temp_convert/") (setq org-zettel-ref-reference-folder "~/Documents/ref/") (setq org-zettel-ref-archive-folder "/Volumes/Collect/archives/")
Run Conversion Script:
Use the command M-x org-zettel-ref-run-python-script
to execute the conversion.
**** ⚠️ Caution
**** Workflow Recommendations
This feature significantly expands the application range of org-zettel-ref-mode, making it a more comprehensive knowledge management tool. **** ⚠️ Caution It is recommended to use this script for converting ePub, markdown, txt, and electronic PDF documents.
It is not recommended to use this script to convert scanned PDFs due to slow conversion speed and suboptimal conversion quality.
** Available Commands
Here are the main commands provided by org-zettel-ref-mode:
M-x org-zettel-ref-init
: Initialize org-zettel-ref-mode, create or open an overview fileM-x org-zettel-ref-add-quick-note
: Add a quick note at the current positionM-x org-zettel-ref-sync-overview
: Manually sync the overview fileM-x org-zettel-ref-quick-markup
: Quickly add markup to selected textM-x org-zettel-ref-clean-multiple-targets
: Clean up excess targets in the source fileM-x org-zettel-ref-enable-auto-sync
: Enable auto-syncM-x org-zettel-ref-disable-auto-sync
: Disable auto-syncM-x org-zettel-ref-check-roam-db
: Check org-roam database statusM-x org-zettel-ref-run-python-script
: Run the specified Python script** Configurable Variables
Here are the main configurable variables for org-zettel-ref-mode:
setq org-zettel-ref-overview-directory "~/org-zettel-ref-overviews/"
: Set the overview file storage directorysetq org-zettel-ref-mode-type 'normal
: Set the mode type (options: 'normal, 'denote, 'org-roam)setq org-zettel-ref-include-empty-notes nil
: Set whether to include empty quick notessetq org-zettel-ref-include-context nil
: Set whether to include more context in the overviewsetq org-zettel-ref-quick-markup-key "C-c m"
: Set the shortcut key for quick markupsetq org-zettel-ref-python-environment 'system
: Set the Python environment type (options: 'system, 'conda, 'venv)setq org-zettel-ref-python-env-name nil
: Set the Python environment namesetq org-zettel-ref-python-file "~/path/to/script.py"
: Set the Python script file pathsetq org-zettel-ref-temp-folder "~/Documents/temp_convert/"
: Set the temporary folder pathsetq org-zettel-ref-reference-folder "~/Documents/ref/"
: Set the reference materials folder pathsetq org-zettel-ref-archive-folder "/Volumes/Collect/archives/"
: Set the archive folder pathsetq org-zettel-ref-debug nil
: Set whether to enable debug mode** FAQ
Q: How do I use org-zettel-ref-mode across multiple projects?
A: You can set different overview directories for each project, dynamically changing the value of org-zettel-ref-overview-directory
when switching projects using let-bound
.
Q: What should I do if the overview file becomes too large?
A: Consider splitting the overview file by topic or time period. You can customize the org-zettel-ref-create-or-open-overview-file
function to achieve this.
Q: How do I back up my notes? A: Include both the source files and overview files in your version control system (e.g., Git). Additionally, regularly perform file system-level backups.
Q: How can I check the status of the org-roam database?
A: You can use the M-x org-zettel-ref-check-roam-db
command to check the status of the org-roam database, including version information, number of nodes, etc.
** Troubleshooting
If you encounter issues:
emacs -q
).*Messages*
buffer for any error messages.org-zettel-ref-debug
to t
) to get more detailed log information.If the issue persists, please submit an issue on the GitHub repository, including a description of the problem, steps to reproduce it, and debug logs.
** Contributions
We welcome community contributions! Here are some ways you can get involved:
** Acknowledgments
org-zettel-ref-mode was inspired by my friend [[https://github.com/lijigang][@lijigang]]'s [[https://github.com/lijigang/org-marked-text-overview][org-marked-text-overview]]. Due to extensive modifications, I decided to release it separately as org-zettel-ref-mode after discussing it with him.
** Version History
org-zettel-quick-markup
** Future Plans
If you like it, please Star.