Browse Source

use ` for effective name instead of ~

main
familyfriendlymikey 2 years ago
parent
commit
6458e70275
  1. 12
      app/client.imba
  2. 8
      readme.md

12
app/client.imba

@ -50,13 +50,13 @@ tag app
def add_initial_links def add_initial_links
let initial_links = [ let initial_links = [
"tutorial github.com/familyfriendlymikey/fuzzyhome" "tutorial github.com/familyfriendlymikey/fuzzyhome"
"!brave search ~b search.brave.com/search?q=" "!brave search `b search.brave.com/search?q="
"!youtube youtube.com/results?search_query=" "!youtube youtube.com/results?search_query="
"photopea photopea.com" "photopea photopea.com"
"twitch twitch.tv" "twitch twitch.tv"
"messenger ~me messenger.com" "messenger `me messenger.com"
"instagram ~in instagram.com" "instagram `in instagram.com"
"localhost ~3000 http://localhost:3000" "localhost `3000 http://localhost:3000"
] ]
for link in initial_links for link in initial_links
try try
@ -162,7 +162,7 @@ tag app
{ href:url, host } = parse_url url { href:url, host } = parse_url url
let icon = await fetch_image_as_base_64 host let icon = await fetch_image_as_base_64 host
let name let name
if split_text[-1].startsWith "~" if split_text[-1].startsWith "`"
name = split_text.pop!.slice(1) name = split_text.pop!.slice(1)
let display_name = split_text.join(" ") let display_name = split_text.join(" ")
let is_bang = no let is_bang = no
@ -195,7 +195,7 @@ tag app
let link_text = "" let link_text = ""
link_text += "!" if link.is_bang link_text += "!" if link.is_bang
link_text += link.display_name link_text += link.display_name
link_text += " ~{link.name}" if link.name isnt link.display_name link_text += " `{link.name}" if link.name isnt link.display_name
link_text += " {link.url}" link_text += " {link.url}"
link_text link_text

8
readme.md

@ -69,15 +69,15 @@ but now it looks bad.
To solve this, fuzzyhome allows you to add an "effective name" To solve this, fuzzyhome allows you to add an "effective name"
to a link: to a link:
``` ```
instagram ~in instagram.com instagram `in instagram.com
``` ```
To add an effective name to a link, To add an effective name to a link,
simply add the name prefixed with a tilde right before the URL. simply add the name prefixed with a backtick right before the URL.
This also works for bang links. This also works for bang links.
Let's say we wanted `a` to correspond to `!amazon`: Let's say we wanted `a` to correspond to `!amazon`:
``` ```
!amazon ~a amazon.com/s?k= !amazon `a amazon.com/s?k=
``` ```
Now when you type `in` or `a`, Now when you type `in` or `a`,
you can have confidence that your you can have confidence that your
@ -135,7 +135,7 @@ Let's say you've been typing `in` for `instagram`, but recently added `indeed` a
and `indeed` keeps showing up first. and `indeed` keeps showing up first.
Simply change the effective name of the `instagram` link to `in`: Simply change the effective name of the `instagram` link to `in`:
``` ```
instagram ~in instagram.com instagram `in instagram.com
``` ```
### A Link Is Blocking My Search ### A Link Is Blocking My Search

Loading…
Cancel
Save