alphapapa / alphapapa/org-rifle

command-line client

オープン
#66 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Emacs Lisp
スター
515
フォーク
30
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。