Comments (1)
Dummy data for testing purposes can now be automatically created using the minimal-setup.el
provided in the wiki.
The relevant elisp functions are the following ones:
(setq test-org-roam-directory (make-temp-file "roam-" t))
(with-eval-after-load 'org-roam
(defun create-org-roam-dummy-note (title body)
"Create an org-roam note file with TITLE and content BODY."
(let* ((slug (org-roam-node-slug (org-roam-node-create :title title)))
(filename (concat (file-name-as-directory org-roam-directory)
(format "%d-%s.org"
(time-convert (current-time) 'integer)
slug)))
(org-id-overriding-file-name filename)
id)
(with-temp-buffer
filename
(insert ":PROPERTIES:\n:ID: \n:END:\n#+title: "
title)
(goto-char 25)
(setq id (org-id-get-create))
(goto-char (point-max))
(newline 2)
(insert body)
(write-file filename)
(org-roam-db-update-file filename))))
(defun populate-org-roam-with-dummy-notes ()
"Create some test notes in org-roam-directory."
(let ((elems '("alpha" "bravo" "charlie" "delta" "echo" "foxtrot")))
;; Check existence of org-roam-directory
(when (not (file-directory-p org-roam-directory))
(make-directory org-roam-directory))
;; Create the single notes
(dolist (elt elems )
(create-org-roam-dummy-note elt
(concat "This is the body of a note about " elt)))))
(populate-org-roam-with-dummy-notes))
This snippet creates notes in a uniquely named temp-directory by iterating over elems
.
The resulting files have the following simplistic structure:
:PROPERTIES:
:ID: a8b97174-48e6-453d-8f73-8e3cd1d955b0
:END:
#+title: alpha
This is the body of a note about alpha
This can be conveniently used to test consult-org-roam
's functionality
from consult-org-roam.
Related Issues (20)
- Question: purpose of consult-org-roam-file-find HOT 3
- Strip leading path of candidates presented by consult-org-roam-file-find
- [BUG] cursor moved when previewing the same buffer and the first item is far from the current cursor HOT 5
- consult-buffer doesn't show capture buffers HOT 4
- consult-buffer shows duplicate capture buffers
- `consult-buffer` slowness when using `consult-org-roam` HOT 6
- Remove org-roam-buffer-source when disabling consult-org-roam-mode
- After using :preview-key M-., how to jump to the previewed file directly? HOT 3
- `org-roam-node-insert` failed to insert into correct place. HOT 2
- Sorting (sort-fn) function does not work HOT 7
- major-mode not applied in previews for consult-org-roam-node-read HOT 2
- consult-org-roam-buffer-after-buffers does not produce the expected outcome
- consult-org-roam-buffer, do not alter visiting order of buffers HOT 4
- How to jump to the search result? HOT 3
- Org heading node is not searched HOT 3
- consult-org-roam-forward-links is not working HOT 2
- Why the order is not respected ? HOT 6
- Get only Org results HOT 2
- Can I call `consult-org-roam-buffer` source as a command ? HOT 1
- Feature request: Display buffer name as org-roam node title in consult-buffer list, but not in dedicated group
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consult-org-roam.