Course Overview
Locked video preview

Paid video

Please purchase the course to watch.

Building the article view

What's markdown and do you parse it

Here is a summary of the video transcript:

  • Introduction to Markdown
    Markdown is a lightweight markup language created in 2004 that uses plain text syntax to structure documents. It is readable in raw form and can be converted into formats like HTML or PDF.

  • Why Use Markdown for Developer Content
    Markdown keeps authors focused on content rather than formatting and integrates well with version control systems like Git. It supports code blocks natively and is widely adopted across platforms such as GitHub and Stack Overflow.

  • Need for Markdown-to-HTML Conversion
    Raw Markdown cannot be directly rendered as styled web content. It must be converted into HTML elements to enable proper styling and presentation in a web application.

  • Using Goldmark in Go
    The video introduces Goldmark, a Markdown parser written in Go, to handle Markdown-to-HTML conversion. It supports extensions such as GitHub Flavored Markdown, syntax highlighting, heading IDs, attributes, and custom rendering options.

  • Parser Configuration
    A Goldmark instance is configured with extensions for syntax highlighting, line numbers, tab width, and styling (e.g., Groovebox theme). Render options such as hard wraps and unsafe rendering are also enabled.

  • Implementing Markdown Parsing
    A Go function is created to convert Markdown content into HTML using the configured parser. The function handles errors and returns the resulting HTML as a string.

  • Handling Safe Rendering in Templates
    Because the templating system escapes HTML by default for security, a custom wrapper function is implemented to mark trusted HTML as safe. This ensures that parsed Markdown renders correctly in the browser.

  • Final Result and Next Steps
    After integrating the parser and safe rendering wrapper, Markdown content is successfully displayed as formatted HTML with headings, lists, and highlighted code blocks. The next step is improving the site’s visual design and responsiveness.