💾 Archived View for tilde.team › ~bh › gemlog › 012_2022-06-28.gmi captured on 2023-03-20 at 19:06:22. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Bookmarklet to copy page title and URL into markdown format

As a trying out to boost productivity and organization, I am starting to taking notes in markdown flat files and with the help of Zettlr - a markdown editor turbocharged with a lot of functionality of a document editor and a zettelkasten tool.

I save a lot of links as bookmarks and now I want to turn them into text for easier structuring, developing and connecting different pieces into a story. The very first frustration came from annotating the links into markdown format and only fools will do it by hand. There are a lot of extension for both Chrome and Firefox to get the job done, but I always have little respect for using WebExtension API for some single task, i.e., if you write an extension, it's better something complicated. As a sidenote, Edge (the browser) has the ability to retain the page title (via some metadata? I dunno) when pasting a URL, but it's even worse than an extension to get attach to another browser, which are nowadays always an ecosystem. Finally, if I understand correctly, the "suggested" workflow is to use a reference manager, such as Zotero and JabRef, which also...has an extension to import the webpage as reference into the database. While I am a researcher in real life and have written countless documents with citation, be it proposals, reports, reviews, or paper, I am frustrated to stick to the same workflow for every document. An original article with a few dozens of citations is OK to use a reference manager, a notetaking to jot down ideas and hundreds of bookmarks is not.

So I never forget that at least Javascript in browser has something actually useful for these task, namely the bookmarlet. I wrote a small bookmarklet to simply get the job done and no other gimmicks. Now I can simply click on the bookmarklet to have the page title and the URL copied into the clipboard and readily handy to paste into my markdown editor. Here's the brainlessly simple snippet:

javascript:navigator.clipboard.writeText('%5B'+document.title+'%5D('+location.href+')')();