Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. Look at what I made... I made.. a Kate snippet... but not just any Kate snippet... it's a Kate snippet that can make a href links to selected text using clipboard content....

Look at what I made... I made.. a Kate snippet... but not just any Kate snippet... it's a Kate snippet that can make a href links to selected text using clipboard content....

Scheduled Pinned Locked Moved Uncategorized
katekdesnippet
2 Posts 2 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • rio@kawane.misskey.onlineR This user is from outside of this forum
    rio@kawane.misskey.onlineR This user is from outside of this forum
    rio@kawane.misskey.online
    wrote last edited by
    #1

    Look at what I made... I made.. a Kate snippet... but not just any Kate snippet... it's a Kate snippet that can make a href links to selected text using clipboard content.... It took me 24 hours of work because there are literally zero tutorials nor documentation on this in Japanese... I have also made this accessible with a keyboard shortcut... so that I can make href links at will.... without typing <a href="clipboardtext.html">selectedtext</a>every single time....

    Snippet:

    ${hrefwrap()}

    Script Library:
    function hrefwrap() {return "<a href=\"" + editor.clipboardText() + "\">" + view.selectedText() + "</a>";}

    #Kate #KDE #Snippet

    twilightkiddy@thecle.landT 1 Reply Last reply
    0
    • rio@kawane.misskey.onlineR rio@kawane.misskey.online

      Look at what I made... I made.. a Kate snippet... but not just any Kate snippet... it's a Kate snippet that can make a href links to selected text using clipboard content.... It took me 24 hours of work because there are literally zero tutorials nor documentation on this in Japanese... I have also made this accessible with a keyboard shortcut... so that I can make href links at will.... without typing <a href="clipboardtext.html">selectedtext</a>every single time....

      Snippet:

      ${hrefwrap()}

      Script Library:
      function hrefwrap() {return "<a href=\"" + editor.clipboardText() + "\">" + view.selectedText() + "</a>";}

      #Kate #KDE #Snippet

      twilightkiddy@thecle.landT This user is from outside of this forum
      twilightkiddy@thecle.landT This user is from outside of this forum
      twilightkiddy@thecle.land
      wrote last edited by
      #2

      @rio@kawane.misskey.online
      JS supports this funny interpolation syntax. As a bonus, you don't need to escape double quotation marks.

      function hrefwrap() {
        return `<a href="${editor.clipboardText()}">${view.selectedText()}</a>`
      }

      1 Reply Last reply
      1
      0
      • R relay@relay.mycrowd.ca shared this topic
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups