Advertisement
smeech

Inserting images (and text) - various methods

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