$ show gobyexample-cn/gobyexample
Go by Example δΈζη is a static site generator that produces a Chinese-language tutorial website for Go programming. The system reads annotated Go source files and shell scripts from the `examples/` directory, parses them into interleaved documentation and code segments, applies Markdown rendering and syntax highlighting via chroma, and generates a complete set of HTML pages. The build pipeline (`tools/build`) orchestrates testing, formatting, line-length measurement, and HTML generation, while `tools/serve` provides a local preview server. The site is deployed to S3 using a dedicated upload script. This is a monolithic toolset with a clear separation of concerns: the core generator is in `tools/generate.go`, templates are in `templates/`, and static assets are served directly. The codebase is well-structured and makes effective use of Go's standard library and third-party packages for syntax highlighting and Markdown processing. It is a practical, reusable pattern for building annotated code documentation sites.
The LLM identified 1 files worth highlighting for reuse:
This is the core engine that transforms annotated Go source files into HTML. It implements a custom parser (`parseSegs`) that separates documentation comments from code lines using a regex pattern, building a list of segments that can be rendered side by side. It uses `chroma` for syntax highlighting and `blackfriday` for Markdown rendering, and integrates with the Go Playground for code execution. The logic is self-contained, and the segment-parsing approach can be extracted and reused for any project that needs to generate documentation from annotated source files. The `SimpleShellOutputLexer` demonstrates a custom chroma lexer for shell output, showcasing non-obvious skill in extending the syntax highlighting library.