stardiviner / Org Link Beautify
Projects that are alternatives of or similar to Org Link Beautify
- Motivation
Usually Org links only have text, it's not very intuitive to recognize what type of link it is. Add some color and icon, even image preview will help user read links.
- Screenshots
Annotate link with icon to indicate link type. And use color to indicate link file exist or not?
#+ATTR_ORG: :width 600 #+ATTR_LATEX: :width 6.0in #+ATTR_HTML: :width 600px [[file:screenshot.png]]
Supports video file link preview with thumbnail.
#+ATTR_ORG: :width 600 #+ATTR_LATEX: :width 6.0in #+ATTR_HTML: :width 600px [[file:video-thumbnail.png]]
- Features [9/10]
-
[X] Only display org-link-beautify preview images (and icons) when headline expanded. This will reduce Emacs memory and improve performance!!!
-
[X] support colorize links if file: target file does not exist
-
[X] support display icons for link types (currently already supported many link types)
-
[X] supported many different link types (If you found not supported link type, PR welcome!)
-
[X] display image for previewing image file
-
[X] display image for previewing PDF file and preview of specific PDF page number. Like this: #+begin_src org [[file:/path/to/filename.pdf]] #+end_src #+begin_src org [[pdfview:/path/to/filename.pdf::15]] #+end_src
Currently support PDF link types:
- pdfview:
- docview:
- eaf:pdfviewer::
-
[X] display thumbnail for video file link
-
[X] preview audio file link with wave form image
-
[X] add keymap on link text-property, available keybindings:
- =[Enter]= :: =org-open-at-point=, so you can press =[Enter]= to open link.
You can add more keybindings with following similar config:
#+begin_src emacs-lisp :eval no (define-key org-link-beautify-keymap (kbd "RET") 'org-open-at-point) #+end_src
- Install
-
all-the-icons :: This Emacs package icons use "[[https://github.com/domtronn/all-the-icons.el][all-the-icons]]". If you got icon problem. You need to make sure all-the-icons AND FONTS installed correctly.
-
video thumbnail feature needs package "=ffmpegthumbnailer="
For Arch Linux:
#+begin_src sh :dir /sudo:: :results none sudo pacman -S --noconfirm ffmpegthumbnailer #+end_src
-
audio wave form image preview need package "=audiowaveform="
Check out https://github.com/bbc/audiowaveform for installation guide.
-
PDF file preview with command "=pdftocairo=" or "=pdf2svg="
For Arch Linux:
#+begin_src sh :dir /sudo:: :results none sudo pacman -S --noconfirm poppler # command pdftocairo sudo pacman -S --noconfirm pdf2svg # command pdf2svg #+end_src
-
EPUB file cover image preview need command "=gnome-epub-thumbnailer="
#+begin_src sh :dir /sudo:: :results none sudo pacman -S --noconfirm gnome-epub-thumbnailer #+end_src
- Usage
#+begin_src emacs-lisp (org-link-beautify-mode 1) ; (ref:toggle org-link-beautify-mode) #+end_src
** If you want better better performance
You can toggle this option carefully to improve Org org-activate-links
performance:
#+begin_src emacs-lisp (setq org-element-use-cache t) #+end_src
- Link examples
NOTE: Because =all-the-icons= fonts has some issue on my system, so bellowing some icons might not correctly displayed. And some links are not beautified because I have not found suitable icons for them. And if file: link type source file is not available, it will be colored. If you have any idea, PR welcome.
#+begin_src org
- file link [[file:babel-R.org][kkk]]
- remote file
- non-existing file
- video thumbnail for video file link [[file:~/Downloads/Neural Network Architectures-oJNHXPs0XDk.mkv]]
- raw link [[file:babel-clojure.org]]
- file+sys link [[file+sys:README.org]]
- file link smart recognize file types [[file:~/Downloads/8-个税政治成本最高 对社会公平毫无帮助[李稻葵].pdf]]
- directory link [[file:~/Downloads/][Downloads]]
- URL link (use different icons based on url with smart all-the-icons) [[https://www.google.com]]
- elisp link [[elisp:(print "hello, org-link-beautify!")]]
- shell link [[shell:echo "hi"]]
- eww link [[eww:https://www.baidu.com]]
- A mu4e link [[mu4e:msgid:[email protected]][Re: [Suggestion] add an API function for getting link description]]
- Git link [[git:/home/stardiviner/Code/Emacs/org-mode/lisp/org.el::[email protected]{2017-06-24}::1]]
- orgit link
- orgit-rev link
- orgit-log link
- pdfview link [[pdfview:~/Downloads/社会网络 深度图查询.pdf]]
- grep link [[grep:org-link-beautify]]
- occur link [[occur:org-link-beautify]]
- man link [[man:grep]]
- info link [[info:emacs]]
- help link [[help:man]]
- rss link [[rss:https://www.gmail.com]]
- elfeed link [[elfeed:Today's news]]
- telnet link
- wikipedia link [[wikipedia:Linux]]
- mailto link [[mailto:[email protected]]]
- doi link [[doi:what?]]
- EAF link [[eaf:pdf-viewer::/home/stardiviner/Org/Wiki/Computer Technology/Programming/Programming Languages/Database/SQL/PostgresQL/Data/Books/PostgreSQL即学即用中文第2版.pdf::46][PostgreSQL即学即用中文第2版.pdf]] #+end_src
- FAQ
NOTE: This Emacs package icons use "[[https://github.com/domtronn/all-the-icons.el][all-the-icons]]". If you got icon problem. You need to make sure all-the-icons and fonts installed correctly.
- Contributions
- Thanks to John Kitchin and Nicolas Goaziou help in Org Mode mailing list.
- And [[https://emacs-china.org/t/icon-org-mode/13147][yuchen-lea's screenshot]] gives me design idea
- pdf file link preview inspired from [[https://github.com/shg/org-inline-pdf.el][org-inline-pdf.el]]