Insert Markdown links from various sources.
This tiny Emacs package provides five interactive commands:
-
markdown-links-insert-from-filesPrompt for a file and link to it. -
markdown-links-insert-from-buffersPrompt for an open buffer and link to its file. -
markdown-links-insert-from-projectLink to all files in the currentproject.elproject. -
markdown-links-insert-from-gitLink to all files tracked by Git in the current repository. -
markdown-links-insert-from-diredIn Dired, link to marked files (with optional recursion into directories), and then insert them in a chosen buffer.
All commands insert inline links at point (or at point in a target buffer).
(use-package markdown-links
;; Load from a local copy
:load-path "/path/to/markdown-links.el"
;; ... or clone from the GitHub
;; :vc (:url "https://github.com/sonofjon/markdown-links.el"
;; :rev :newest)
:commands (markdown-links-insert-from-files
markdown-links-insert-from-buffers
markdown-links-insert-from-project
markdown-links-insert-from-git
markdown-links-insert-from-dired)
:bind (:map markdown-mode-map
("C-c C-a f" . markdown-links-insert-from-files)
("C-c C-a b" . markdown-links-insert-from-buffers)
("C-c C-a p" . markdown-links-insert-from-project)
("C-c C-a g" . markdown-links-insert-from-git)
:map dired-mode-map
("C-c C-a d" . markdown-links-insert-from-dired)))Run any of these commands to insert links at point in your current Markdown buffer:
M-x markdown-links-insert-from-filesM-x markdown-links-insert-from-buffersM-x markdown-links-insert-from-projectM-x markdown-links-insert-from-git
Run this command from within Dired to insert links for marked files (and files in marked directories) at point in a selected buffer:
M-x markdown-links-insert-from-dired
- Emacs 30.1+
- markdown-mode ≥ 2.7
- A working Git command in
PATHformarkdown-links-insert-from-git.