alphapapa / alphapapa/org-rifle

command-line client

Abierto
#66 1 comentario 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Emacs Lisp
Estrellas
515
Forks
30
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

org-rifle is hands-down the best way to find information in org-mode files.

To make it easier to use it for a general shared knowledge-base, the requirement to run it from within Emacs is limiting, though, because that excludes many wonderful colleagues who do not use Emacs as their environment. Therefore it would be great to have a command-line client to org-rifle.

Maybe a wrapper around Emacs which directly runs org-rifle to make Emacs transparent in the process.

Something like the following script (named `know`) that can be linked into ~/.local/bin and gets its configuration from a setup.el-file in the directory it is installed in:

```
#!/usr/bin/env bash

H="$(dirname "$(realpath "${0}")")"
emacsclient -nw -e '(progn (raise-frame)(select-frame-set-input-focus (selected-frame))(know))' 2>/dev/null || HOME="${H}" emacs -nw -l setup.el --visit know.org -f org-mode -f know
```

setup.el:

```
;;; setup.el
(defvar knowledge-base-filepath "~/know.org" "Path to the file to read and write the knowledge base")
(require 'use-package)
(use-package org
:custom
(org-src-fontify-natively t))
(use-package org-capture :ensure org)
(use-package helm-org-rifle :ensure t
:config
(defun know()
(interactive)
(with-current-buffer (find-file knowledge-base-filepath)
(helm-org-rifle)))
(add-to-list 'org-capture-templates
`("k" "knowlege base entry" entry
(file ,knowledge-base-filepath)
"")
t))
;;; setup.el ends here
```

With this you can always call `know` from anywhere in the commandline and rifle through the knowledge base. It’s much nicer than searching in a shared wiki.

I have the know.org file in versiontracking, so my knowledge-base entries are accessible to others after the next push.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.