Advertisement
smeech

Inserting images (and text) - various methods

Apr 5th, 2024 (edited)
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 0.72 KB | Source Code | 0 0
  1. # Espanso inserting images (and text) - various methods
  2.  
  3. # Define a variable containing the location of the user home directory
  4. global_vars:
  5.   - name: home
  6.     type: script
  7.     params:
  8.       args: [python, -c, print(__import__('os').path.expanduser('~'))]
  9.  
  10. matches:
  11.   - trigger: :image1
  12.     markdown: |
  13.      some text
  14.       ![](file://{{home}}/path/to/picture.jpg)
  15.       some more text
  16.  
  17.   - trigger: :image2
  18.     html: |
  19.      some text
  20.       <img src="file://{{home}}/path/to/picture.jpg">
  21.       some more text
  22.  
  23.   # image_path: expansions won't work with variables except $CONFIG (the Espanso
  24.   # directory) so need absolute path specified
  25.   - trigger: :image3
  26.     image_path: $CONFIG/../../path/to/picture.jpg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement