$ show mmcgrana/gobyexample
This repository is the source code and build toolchain for the Go by Example website (https://gobyexample.com), an educational tutorial for the Go programming language (a concurrent, channel-based language). The site teaches Go through annotated example programs. The repository contains example source files (Go code with embedded documentation), a set of command-line tools written in Go that parse these examples, render them into HTML using templates, and output a static site. The build pipeline includes syntax highlighting via chroma, Markdown rendering via blackfriday, and deployment to S3. The project also includes a local preview server, a line length enforcer, and CI/CD via GitHub Actions that regenerates the site and diffs against the committed output to ensure consistency. The architecture is a collection of focused Go tools (generate, serve, upload, measure, test) orchestrated by shell scripts. The codebase demonstrates clean separation of concerns, template-driven HTML generation, and a custom lexer for shell output formatting.
The LLM identified 1 files worth highlighting for reuse:
The core generator that parses annotated Go example files, splits them into alternating documentation and code segments, renders Markdown documentation, applies syntax highlighting via chroma (including a custom lexer for shell output), and assembles HTML pages using Go's text/template system. The segment-based rendering pattern (parseSegs) is a clean, reusable approach for building documentation sites from annotated source files. The custom SimpleShellOutputLexer demonstrates non-obvious skill in extending chroma for tutorial output formatting. This module could be extracted and adapted for other programming tutorial sites with minimal modification.