Skip to content

Instantly share code, notes, and snippets.

@smeech
Last active January 31, 2025 16:57
Show Gist options
  • Select an option

  • Save smeech/eaa94190d1a0b80a75eee63b32c466b6 to your computer and use it in GitHub Desktop.

Select an option

Save smeech/eaa94190d1a0b80a75eee63b32c466b6 to your computer and use it in GitHub Desktop.
[Rich text images] HTML and Markdown examples, including the injection of images +/- text #espanso #html #markdown
# Espanso Html and Markdown examples, including the injection of images:
# Define a variable containing the location of the home directory
global_vars:
- name: home
type: script
params:
args:
- python
- -c
- print(__import__('os').path.expanduser('~'))
matches:
- trigger: :image1
markdown: |
some text
![](file:///{{home}}/path/to/picture.jpg)
some more text
- trigger: :image2
html: |
some text
<img src="file:///{{home}}/path/to/picture.jpg">
some more text
# image_path: expansions won't work with variables except $CONFIG (the Espanso
# directory) so need absolute path specified
- trigger: :image3
image_path: /home/stephen/path/to/picture.jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment