Skip to main content

3 posts tagged with "Javascript"

Articles on Javascript

View All Tags

Highlighting code syntax in react-markdown

· 2 min read
Om Athalye
Senior Front End Engineer @ Wealthy

If you're using react-markdown to render Markdown in your React application, you might notice that code blocks don’t have syntax highlighting by default. In this post, I’ll show you how I added syntax highlighting using react-syntax-highlighter, making my Markdown renderer more visually appealing—similar to how Docusaurus does it with Prism.

Building my own pastebin in Docusaurus

· 8 min read
Om Athalye
Senior Front End Engineer @ Wealthy

Today, I embarked on a journey to solve a common problem: to quickly share small code snippets, interesting online findings, or just a simple personal todo list between me and my friends or between my different devices. Essentially a personal pastebin, but one that doesnt need any server or database, and can be operable through my docusaurus static site so as to not have to rely on other third party apps like whatsapp, slack or discord. Inspired by tools like Topaz paste which uses LZMA-JS to compress and decompress textual data on client side and base64 encoding to convert the binary data into URL safe ASCII characters. One additional feature I wanted on my site was the ability to render the decoded text as markdown to make it rich text - with syntax highlighting for code snippets, and able to render headings, todos, mermaid diagrams, etc like on github.

Building a PDF Generator with Puppeteer, Express, and Nunjucks

· 8 min read
Om Athalye
Senior Front End Engineer @ Wealthy

In this blog, I’ll walk you through how I built a PDF generator for a Node.js backend service using Puppeteer for PDF rendering, Express for serving HTTP requests, and Nunjucks for HTML templating. The solution is efficient, caching previously generated PDFs to save resources, and it even manages cache cleanup to prevent overloading the system.