Links Colophon

I have long searched for a quick, easy way to record links to web pages, with annotations to remind me why I felt the page was worth saving. I use Diigo to manage links and Ctrl+D in my browser for a quick save of a link. But I wanted something quicker than Diigo but more complete than Ctrl+D.

I discovered AutoHotkey and then found a script that would allow me to use an AHK hotkey combination to write the URL of the web page I was viewing to a text file. By adding a text box input to the AHK script, I could add notes to the text file about the web page in Markdown format. Then I learned about pandoc, a document conversion tool that could turn a minimal Markdown document into a full-blown web page. My links page is the culmination of implementing the findings of my search.

My AHK script can be viewed here. (If you use the script, you will have to change the path and filename to your save file and the batch file to run pandoc.) While viewing a web page, I can hit Ctrl+Alt+G to pop up a text box, type notes and keywords about the page, hit Enter, and the URL and note are saved to a text file in Markdown format. The note is used as the link text. The text file is then used by pandoc to build the web page to display the links. Pandoc is run from a batch file that contains only the pandoc command:

pandoc -s -S -c filename.css --template=template_filename.html -t html5 -o output_filename.html -B insert_before_converted_text_file.txt -A insert_after_converted_text_file.txt file_with_links_generated_by_ahk_script.txt

The resulting HTML file, links.html in my case, is then uploaded to my web site using WinSCP. Thus my links are available wherever I have an Internet connection.

Last updated: 2017-02-24