├── README.org ├── opennote.sh └── org-logseq.el /README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: Org-logseq 2 | 3 | A script for navigating and editing [[http://logseq.com/][logseq]] files using emacs. 4 | 5 | ** Install 6 | 7 | The installation process is not automated at this time. 8 | 9 | 1. Copy the =opennote.sh= file into the =~/bin/opennote.sh= directory. 10 | 11 | 2. Copy the contents of the =org-logseq.el= file into your emacs 12 | configuration file (or just evaluate it by pressing =C-x= =C-e=). 13 | 14 | 3. Assign a key combination to call the =open-logseq= function. 15 | 16 | ** Usage 17 | 18 | 1. Open any file in the pages directory. 19 | 20 | 2. Place the cursor on a link of the form =[[ Another Page ] ]=. 21 | 22 | 3. Call the =open-logseq= function. 23 | 24 | 4. The desired page will open in another buffer (if necessary, the 25 | page will be created) 26 | 27 | ** Development plans 28 | 29 | - Use use-package 30 | 31 | - Rewrite code from bash to elisp 32 | 33 | Contributions are welcome! 34 | -------------------------------------------------------------------------------- /opennote.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | A=$@ 4 | 5 | line=`grep -i -r "^#+\(TITLE\|ALIAS\)" | grep -i "\(: \|, \|\[\[\)$A\($\|\]\]\)" | head -n 1 | cut -d":" -f1` 6 | 7 | if [[ "$line" != "" ]] 8 | then 9 | echo -n $line 10 | else 11 | fn=`echo "$A" | sed 's/[^a-zA-Zа-яА-Я0-9]/_/g' | sed 's/№/_/g'`.org 12 | echo "#+TITLE: $A" > $fn 13 | echo -n $fn 14 | fi 15 | -------------------------------------------------------------------------------- /org-logseq.el: -------------------------------------------------------------------------------- 1 | (defun open-logseq (&optional arg) 2 | (interactive "P") 3 | (org-open-file (shell-command-to-string ( 4 | concat "bash ~/bin/opennote.sh " (org-element-property :path (org-element-context))))) 5 | ) 6 | --------------------------------------------------------------------------------