whaturl
replaces URLs found in text with a markup hyperlink with the contents
of the <title>
tag in the HTML of the URL. It works like a typical Unix
filter:
echo "I like https://github.com" | whaturl
I like [GitHub: Where the world builds software · GitHub](https://github.com)
Inspired by Titler by Brett Terpstra for Mac OS and org-cliplink for Emacs.
Check out releases for pre-built binaries.
A Homebrew formula is included at Formula/whaturl.rb.
brew tap staticaland/go-whaturl https://github.com/staticaland/go-whaturl
brew install whaturl
If you watch the project (Watch → Custom → Releases) you can easily upgrade to the latest version when notified:
brew upgrade whaturl
To uninstall:
brew uninstall whaturl
brew untap staticaland/go-whaturl
Usage of whaturl:
-format string
Specify link format (default "markdown")
-list
Create list of links
-relaxed
Process URLs without a schema
If you run the program, it will wait for input from stdin.
whaturl
You can write lines to it and get a result by pressing enter. To finish, press Ctrl+D to communicate end-of-transmission. However, the more common use-case is to pipe something directly:
cat urls | whaturl
I use reformatter.el
(see my reformatter.el configuration here). You may also
want to check out Apheleia. Otherwise, shell-command-on-region
(docs) is what
you are looking for. Read Executing Shell Commands in Emacs to learn more.
nnoremap <leader>l :%!whaturl<CR> vnoremap <leader>l :!whaturl<CR>
This is reminiscent of the Vim Kōan Master Wq and the Markdown acolyte.
go build whaturl.go
go run whaturl.go
You can find some table driven tests in whaturl_test.go.
go test
- markdown-link-expander
- kukushi/PasteURL
- zolrath/obsidian-auto-link-title
- sindresorhus/linkify-urls
- sindresorhus/urls-md
- alphapapa/org-protocol-capture-html
- deathau/markdownload
- kepano/obsidian-web-clipper.js
- Keyboard Maestro - Create a Markdown Link for a URL in the Clipboard
- Hyper Optimized URL grabber (Using Keyboard Maestro on the Mac)
- Vim Tip: Paste Markdown Link with Automatic Title Fetching
- Automate Copying and Pasting the Current Page Title and URL with Keyboard Maestro
javascript:(
function(){
prompt(
'',
'[['
+location.href
+']['
+document.title.replace(/ [-,|].*$/,'')
+']]'
)
}
)()
Markdown:
javascript:(
function(){
prompt(
'',
'['
+[location.href](<document.title.replace(/ [-,|].*$/,'')>)
+']('
+location.href
+')'
)
}
)()