https://robinglen.medium.com/how-i-centralize-and-distribute-my-bookmarks-cc8b11bb7475 Get started Open in app Robin Glen Sign in Get started 82 Followers About Get started Open in app How I centralize and distribute my bookmarks Robin Glen Robin Glen Just now*5 min read At a large company there are thousands of different internal URLs, from multiple development environments, workflow tools and HR systems. New tools are often introduced, old ones decommissioned or hostnames changed, I often joked that if I cleared my internet history I wouldn't be able to do my job. The only real authority of truth was crowdsourced by asking in Slack what the URL was for a certain service. If you were lucky someone might have already set up a bot to respond, if you were unlucky it might start a flamewar about how bad the latest HR platform was. The idea of crowdsourcing URLs and their authority of truth would run through mind for a while. At the start of this year I moved to a start up and while there are a lot less URLs they were still distributed in different tools and not always up-to date. I again started thinking about a way to centralise bookmarks while still allowing you to use your existing tools. Having spent the last few years of my career working in infrastructure there was only one solution in my mind... YAML! label: Bookworms description: These are sample bookmarks folders: - label: folder 1 description: This is to describe the folder structure folders: - label: sub folder 1 description: This is to describe the sub folder structure bookmarks: - label: sample url 1 description: this is used to describe the bookmark href: 'https://www.mywebsite.com' - label: folder 2 folders: - label: sub folder 2 bookmarks: - label: sample url 2 description: this is used to describe the bookmark href: 'https://www.mywebsite.com' - label: sample url 3 description: this is used to describe the bookmark href: 'https://www.mywebsite.com' - label: sub folder 3 bookmarks: - label: sample url 4 description: this is used to describe the bookmark href: 'https://www.mywebsite.com' Creating a standardised structure for URLs based on bookmarks and folders would allow people to easily contribute and add the ability to transform this data into different formats. Markdown Something very common in the industry is people maintaining a list of useful links and storing them in Github as a README.md . You can see a great example here: https://github.com/binhnguyennus/ awesome-scalability If you have your bookmarks stored as YAML this is a pretty straight forward transformation. With a few lines in NodeJS I was able to convert the bookmarks YAML into a README.md. [1] [1] Chrome While converting into markdown is a nice way to self document a repository I wanted these bookmarks to be more practical and be available when and where I need them. Looking into the Chrome Bookmark manager I saw exporting your bookmarks just saved a HTML file. All I needed to do was generate this HTML file from the YAML. [1] [1] Again I was able to do this with NodeJS, generating and saving a file I could import into my browser. [1] [1] My bookmarks were now available within my Chrome toolbar. To my surprise this HTML is standardised in most common browsers, from testing file works for: * Chrome * Safari * Edge * Firefox * Brave You can find instructions of how to import bookmarks on the links above, other browsers might also work but they have not yet been tested. Bookworms [1] [1] Bookworms is the tool I wrote that allows, people, teams or a company to store, share, update and centralize their important links while giving multiple useful outputs. Currently you need to have Node and npm installed on your machine once this is done you can use it with the following command: npx bookworms get ./my-bookmarks.yaml This will generate the files README.md and a browsers.html in the same directory it's run. You can also fetch bookmarks from a remote location and output the exports into a different directory: npx bookworms get https://raw.githubusercontent.com/thearegee/bookworms/main/demo/config/bookmarks.yaml -d="./output" For storing your bookmarks I recommend having a repository that contains the YAML, README.md and browsers.html files together, here people can view, import or contribute to your bookmarks. You can see an example here: https://github.com/thearegee/bookworms/tree/main/ demo Currently you need to run the npx command after each update to the YAML file, check in the the changes and then reimport browsers.html, however this is something I'm working on automating. You can also import Bookworms like a normal npm module and then use it programmatically. I recently did this at a company hackathon where I built a Slackbot that could respond with company bookmarks. This started by building a simple web server using Fastify. This server is exposing an endpoint that can be used by Slack's slash commands. When this endpoint is called we inspect the body looking to see if they added additional information after the the slash. This allows us to give different responses based on what the user requests but before that we need to load the bookmarks into memory. This code is loading the YAML into memory, converting it into markdown then based on the slash comment coming from the webhook returning the bookmarks of the folder requested. The final part is formatting a response for Slack. These two simple methods are used to respond to Slack slash commands returning a stylised response. There are some slight nuances between standard markdown and Slacks version, I used slackifyMarkdown to take care of that. Below you can see some examples that are running on our AGORA Slack channel. When a user calls /bookmarks or /bookmarks all they are returned all the different commands they can use based on the top level folders in the bookmarks YMAL . [1] [1] If the user enters a folder name not recognised they get returned a helpful error: [1] [1] On a successful request they will get all the bookmarks returned in the same structure as the README.md but this time only scooped to the requested folder. [1] [1] Try it out! The CLI is available on Github to export your existing bookmarks, generate bookmark YAMLand import them into your browser or project. If you are interested in contributing or maybe you have another idea for how you can use Bookworms, you can read more here: https:// github.com/thearegee/bookworms Thank you and happy bookmarking! Robin Glen ex-principal developer @NET-A-PORTER, VP of Engineering @AGORA Follow * Bookmarks * Nodejs * JavaScript * Chrome * Developer Tools More from Robin Glen Follow ex-principal developer @NET-A-PORTER, VP of Engineering @AGORA