roam/index.org

115 lines
4.3 KiB
Org Mode

:PROPERTIES:
:ID: a0164681-10a3-4634-8fc9-5bcbdd0b4da4
:END:
#+TITLE: Correl's Personal Knowledge Base Index
These are my notes, taken using the [[https://www.orgroam.com/][Org Roam]] tool. As such, they are a
collection of text files written in the Emacs [[https://orgmode.org/][Org]] syntax with heavy use of
hyperlinking to form an interconnected wiki. This means there is no filesystem
hierarchy, with the sole exception of the daily journal entries. Instead, it is
best navigated as a graph.
The graph below is interactive, and double-clicking on a node will browse to
that document.
#+begin_src emacs-lisp :results silent :exports results
(let ((filename "graph.json")
(nodes (org-roam-db-query
[:select [nodes:id nodes:title nodes:file (funcall count links:dest)]
:from nodes
:left-join links
:on (= nodes:id links:dest)
:group-by [nodes:id nodes:title nodes:file]]))
(edges (org-roam-db-query
[:select :distinct [source dest]
:from links
:where (= type "id")])))
(with-temp-buffer
(insert (json-encode
(list (cons 'nodes (mapcar (lambda (row) `((id . ,(nth 0 row))
(label . ,(nth 1 row))
(title . ,(nth 1 row))
(value . ,(nth 3 row))))
nodes))
(cons 'edges (mapcar (lambda (row) `((from . ,(nth 0 row))
(to . ,(nth 1 row))))
edges))
(cons 'urls (mapcar (lambda (row) (cons (nth 0 row)
(concat (string-remove-suffix
".org" (string-remove-prefix
org-roam-directory (nth 2 row)))
".html")))
nodes)))))
(write-file filename))
filename)
#+end_src
#+begin_export html
<script type="text/javascript" src="js/vis-network.min.js"></script>
<div id="network-graph" style="border: 1px solid lightgrey; height: 500px; width: 100%;"></div>
<script type="text/javascript">
var network = null;
var urls = null;
async function draw() {
// Instantiate our network object.
var container = document.getElementById("network-graph");
var options = {
nodes: {
shape: "dot",
},
physics: {
stabilization: false,
solver: "forceAtlas2Based",
},
interaction: {
navigationButtons: true,
}
};
var data = await (await fetch("graph.json")).json();
urls = data.urls;
network = new vis.Network(container, data, options);
network.on("doubleClick", params => {
var node = params.nodes[0];
if (!node) { return; }
var url = urls[node];
window.location = './' + url;
})
}
window.addEventListener("load", () => {
draw();
});
</script>
#+end_export
A collection of entry points to various interests and ideas.
- [[id:df5b2861-3838-409d-b4e4-fce7f302f778][How I Work]]
- [[id:9e68d422-cced-4177-96d1-90f777b9a493][Software Development]]
- [[id:2073a538-7846-4c4c-b385-58922d129cf7][Building electronics projects]]
- [[id:2059634f-422e-4be2-8812-22f5f0dc2626][Our house]]
- [[id:4d9e7aa6-1212-4487-84e7-5f9ac8205585][Digital Audio Processing]]
- [[id:3dc8df7d-0050-4afb-9c93-5d0c50d324d0][Taking better notes]]
- [[id:a54fc4a6-4496-4f99-9c9d-c85481b65452][The Phoenix Inquisitor]]
- [[id:5dddbae0-ddc1-4fa8-b824-113731ca9d64][Being transgender]]
- [[id:ca88b99d-cc12-4595-ba14-c567db34d3b6][OpenAPI Core]]
* Recently updated notes
#+name: recently-updated
#+begin_src emacs-lisp :results list :exports results :eval export
(seq-map
(lambda (row)
(let ((id (nth 0 row))
(title (nth 1 row)))
(org-link-make-string (concat "id:" id) title)))
(org-roam-db-query
[:select [nodes:id, nodes:title]
:from nodes
:join files :on (= nodes:file files:file)
:where (= nodes:level 0)
:group-by [nodes:id, nodes.title]
:order-by files:mtime :desc
:limit 15]))
#+end_src