Skip to content

Display remote inline images in org-mode with automatic caching.

License

Notifications You must be signed in to change notification settings

gaoDean/org-remoteimg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

org-remoteimg

Display remote inline images in org-mode with automatic caching.

About

This package displays remote images inline in org-mode with automatic caching. The next time you visit the file or fetch the image, it will be instantly fetched from the cache.

This feature is present in Doom Emacs, and when I switched to GNU emacs, I found that I was quite fond of that feature, so I made it here. You can finally do [[https://gaodean.me/gen/cat.jpg]], and have it display inline just like local images. The code here is adapted from the Doom Emacs codebase, and I just thought to make a small plugin to make it simpler to use for GNU emacs users.

https://gaodean.me/gen/cat.jpg

(this image would display in emacs with the plugin enabled)

Install

use-package

(use-package org-remoteimg
  :straight (org-remoteimg :type git :host github :repo "gaoDean/org-remoteimg"))

Manual

(add-to-list 'load-path "/path/to/plugin/")
(require 'org-remoteimg)

Caching

After the install, remember to do:

;; optional: set this to wherever you want the cache to be stored
;; (setq url-cache-directory "~/.cache/emacs/url")

(setq org-display-remote-inline-images 'cache) ;; enable caching

;; or this if you don't want caching
;; (setq org-display-remote-inline-images 'download)

;; or this if you want to disable this plugin
;; (setq org-display-remote-inline-images 'skip)

By default, this plugin will only cache images. If you want to cache any web request, just do:

;; this is a emacs built-in feature
(setq url-automatic-caching t)

Other

  • This plugin works quite well with org-imgtog. Remember to setup caching if you want to use it though, otherwise you’ll have a bad time.
  • Credit to Tobias Zawada and his org-yt plugin for the org-mode image display functions.
  • Credit to the Doom Emacs community for the basis of the remote image fetching function.

About

Display remote inline images in org-mode with automatic caching.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •