go-grip is a lightweight, Go-based tool designed to render Markdown files locally, replicating GitHub's style. It offers features like syntax highlighting, dark mode, and support for mermaid diagrams, providing a seamless and visually consistent way to preview Markdown files in your browser.
This project is a reimplementation of the original Python-based grip, which uses GitHub's web API for rendering. By eliminating the reliance on external APIs, go-grip delivers similar functionality while being fully self-contained, faster, and more secure - perfect for offline use or privacy-conscious users.
- ⚡ Written in Go 👍
- 📄 Render markdown to HTML and view it in your browser
- 📱 Dark and light theme
- 🎨 Syntax highlighting for code
- Todo list like the one on GitHub
- Support for github markdown emojis 👍
- Support for mermaid diagrams
- hashtag linking in page (see table of contents)
- math expressions (code, inline, block)
- gh issues and prs #46 and grafana/grafana#22
- toggle state is preserved in sessionStorage
This is an inline
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
package main
import "github.com/chrishrb/go-grip/cmd"
func main() {
fmt.Sprintln("Welcome to Grip! Use `go-grip --help` for more information.")
}Tip
Support of blockquotes (note, tip, important, warning and caution) see here
Important
test
To install go-grip, simply:
go install github.com/chrishrb/go-grip@latestTip
You can also use nix flakes to install this plugin. More useful information here.
To render the README.md file simply execute:
go-grip README.md
# or
go-gripThe browser will automatically open on http://localhost:6419. You can disable this behaviour with the -b=false option.
You can also specify a port:
go-grip -p 80 README.mdor just open a file-tree with all available files in the current directory:
go-grip -r=falseIt's also possible to activate the darkmode:
go-grip -d .To disable automatic browser reload on file changes (useful for stable editing):
go-grip --no-reload README.mdTo terminate the current server simply press CTRL-C.
- Maybe use githubs original mermaid renderer with zoom option etc. (https://viewscreen.githubusercontent.com/markdown/mermaid?docs_host=https%3A%2F%2Fdocs.github.com&color_mode=dark#a5f40142-95a0-45db-8a9a-e1fb39a6488b)
- Make it possible to export the generated html
This tool is a Go-based reimplementation of the original grip, offering the same functionality without relying on GitHub's web API.
