fav.txt format ============== A complete primer on the whys and hows of fav.txt. The first and most important rule of fav.txt: ```A single line in a fav.txt text file represents a single bookmark``` Why plain text? =============== Plain text is software and operating system agnostic. It's searchable, portable, lightweight, extensible and easily manipulated. It's unstructured. It works when someone else's web server is down or your browser files get corrupted with an update. There's no exporting and importing, no databases or tags or flags or stars or colors or __insert company name here__-induced rules on what you can and can't do with it. The essential elements of a bookmarking system ============================================== * Quick access and searchability * Easy to add new bookmarks and manipulate them * Structured and clutter free fav.txt format rules ==================== Your fav.txt is a plain text file. To take advantage of structured bookmark metadata like tags there are a few simple but flexible file format rules. Philosophically, the fav.txt file format has two goals: * The file contents should be human-readable without requiring any tools other than a plain text viewer or editor. * The file contents should be machine-readable and work well with standard tools such as grep, sed, cut, awk... But also it must be easy to create tools purposely built to work with this format. Taking into account the nature of plain text and the essential elements of a bookmarking system detailed above I've created the following spec: * As plain text is unstructured and a bookmarking system requires structure, the file format will not include any structural information, rather it will rely on the OS's file system hierarchy. * There is an unique FAV_ROOT_PATH variable to indicate where it's located in the system the directory containing the bookmarks. * There can be as many files and directories inside FAV_ROOT_PATH as you wish, they will define your bookmarks structure, no restrictions here. * Each file can have as many bookmarks as you want, one per line. * A bookmark is defined by: * URI: The only part that is a must. It doesn't have to be an HTTP URL only, it can be a local path in your computer or whatever. Must consist of non-whitespace characters and follow standard URI conventions. * Name (optional): If a name is present it must follow the URI field and must be separated by a single space character. A name may be used to describe the URI in a short sentence in order to help with search, readability & recall. * Shortcode (optional): You may want to add one shortcode to quickly find a bookmark, a shortcode is preceded by a single space and an at-sign (@) character. After the @ character the shortcode can only be composed of non-whitespace characters. It should remain unique in the set of bookmarks to be useful for quick access, although this is not a strict requirement. * Tags (optional): You may want to add multiple tags to some bookmarks to categorized bookmarks in other dimension apart from the hierarchy. Tags are preceded by a single space and a plus-sign (+) character. A tag contains any number of non-whitespace characters. * Metadata (optional): Tool developers or users may define additional formatting rules for extra metadata using the format `key:value`. Both key and value must consist of non-whitespace characters, which are not colons. Only one colon separates the key and value. Multiple key-value pairs are separated by spaces, and multiple values in the same key with commas.