ttscoff / searchlink

MIT License
57 stars 5 forks source link

Return page title for URLs #8

Open danielcompton opened 2 months ago

danielcompton commented 2 months ago

Sometimes when writing podcast show notes, I have a bunch of links that I want to turn into links with the page title as the link title.

[](!g https://clojure-lsp.io/)
[](!g https://langserver.org/)
[](!g https://github.com/emacs-lsp/lsp-mode)
[](!g https://cljdoc.org/d/clj-kondo/clj-kondo/2023.07.13/doc/analysis-data)
[](!g https://github.com/clojure-lsp/clojure-lsp-intellij)

This comes back as

[https://clojure-lsp.io/](https://clojure-lsp.io/)
[https://langserver.org/](https://langserver.org/)
[https://github.com/emacs-lsp/lsp-mode](https://github.com/emacs-lsp/lsp-mode)
[https://cljdoc.org/d/clj-kondo/clj-kondo/2023.07.13/doc/analysis-data](https://github.com/clj-kondo/clj-kondo)
[https://github.com/clojure-lsp/clojure-lsp-intellij](https://github.com/clojure-lsp/clojure-lsp-intellij)

Would something like !url be a good search type to add?

ttscoff commented 2 months ago

Do you have include_titles set to true in your config? With that set (and maybe other config I'm forgetting about), when I run SearchLink on your example, I get:

[Clojure LSP](https://clojure-lsp.io/ "Clojure LSP")
[Langserver.org](https://langserver.org/ "Langserver.org")
[emacs-lsp/lsp-mode:Emacs client/library for the Language Server Protocol](https://github.com/emacs-lsp/lsp-mode "emacs-lsp/lsp-mode:Emacs client/library for the Language Server Protocol")
[clj-kondo 2023.07.13](https://cljdoc.org/d/clj-kondo/clj-kondo/2023.07.13/doc/analysis-data "clj-kondo 2023.07.13")
[clojure-lsp/clojure-lsp-intellij:Intellij Plugin for Clojure & ClojureScript development via Language Server (LSP) made in Clojure](https://github.com/clojure-lsp/clojure-lsp-intellij "clojure-lsp/clojure-lsp-intellij:Intellij Plugin for Clojure & ClojureScript development via Language Server (LSP) made in Clojure")

(rendered as)

Clojure LSP Langserver.org emacs-lsp/lsp-mode:Emacs client/library for the Language Server Protocol clj-kondo 2023.07.13 clojure-lsp/clojure-lsp-intellij:Intellij Plugin for Clojure & ClojureScript development via Language Server (LSP) made in Clojure

Which seems like pretty much what you're hoping for, right?