From Markdown to HTML
With syntax highlighting 🎨
func h(w http.ResponseWriter, r *http.Request) {
title := "It works! 👷"
md := []byte("# It works!\n```go\nvar k = 4\nprintln(k)\n```\n")
err := renderinghtml.Markdown2HTMLPage(w, md, title)
if err != nil {
slog.Error("render", "err", err)
w.WriteHeader(http.StatusInternalServerError)
return
}
}If you are seeing this in your web browser, try visiting the test page.
- Markdown Rendering
- Syntax Highlighting
- Minify CSS/JS/HTML
echo "hello world"package main
import "fmt"
func main() {
fmt.Println("hello world")
}console.log("hello world");#include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}SELECT * FROM users WHERE id = 1;Included is a basic markdown2html command
markdown2html README.md
# Outputs:
# /tmp/markdown2html_README.html# open browser
xdg-open file:///$(markdown2html README.md)