imports:
  - "../../private/espanso/finance.yml"
  - "../../private/espanso/personal.yml"
  - "../../private/espanso/work.yml"

matches:
  - trigger: ":fn"
    label: Markdown Footnote
    vars:
      - name: form
        type: form
        params:
          layout: |
            Author:
            [[author]]

            Publication Title:
            [[title]]
          fields:
            title:
              multiline: true
      - name: "clipboard"
        type: "clipboard"
      - name: year
        type: date
        params:
          format: "%Y"
      - name: id
        type: shell
        params:
          cmd: 'echo "{{form.author}}$(date +%Y)" | perl -pe "s/(\b[a-z])/\u$1/g" | perl -pe "s/(\s)/\u/g"'
    replace: |
      [^{{id}}]

      [^{{id}}]: {{form.author}} ({{year}}): {{form.title}}, <{{clipboard}}>.

  - trigger: ":y"
    label: Youtube-Shortlink
    vars:
      - name: "clipboard"
        type: "clipboard"
    replace: "https://youtu.be/{{clipboard}}"
