$ show docgeni/docgeni
Docgeni is a documentation generator for Angular component libraries and markdown documentation. It operates as a CLI tool (serve, build, init) and a set of libraries that parse Angular component metadata, build navigation, render markdown with custom extensions (embed, code groups, tabs), and generate a static or server-side rendered Angular site. The architecture is a monorepo with packages: @docgeni/cli (entry point), @docgeni/core (orchestration, builders, plugins), @docgeni/template (Angular site components and services), @docgeni/ngdoc (TypeScript parser for Angular decorators), @docgeni/toolkit (utilities for file system, git, templates), and @docgeni/create-docgeni (scaffolding). Key data flows: user provides markdown docs and Angular component libraries; the core builders parse docs, extract component metadata via ngdoc, generate navigation trees, and produce an Angular application with live examples, API tables, and multi-language support. External dependencies include Angular CLI, TypeScript compiler API, marked (markdown parser), Prism (syntax highlighting), Handlebars (templates), cosmiconfig (configuration), and chokidar (file watching). The generated site supports CSR, SSR, and SSG render modes, theming, and i18n.
The LLM identified 4 files worth highlighting for reuse:
Abstract base class for emitting files during a build process. Provides change tracking (which files were emitted, changed, or deleted) and a consistent interface for subclasses. Could be extracted to any build tool that needs to track file output changes, such as a static site generator or bundler plugin.
Wraps Angular's virtual file system host with additional methods like readFile, writeFile, copy, watchAggregated, and getDirs. Provides a clean, promise-based API for file operations and directory watching. Could be reused in any Node.js tool that needs a portable filesystem layer with watch support, independent of Angular.
Parses Angular component, directive, service, and pipe metadata from TypeScript source files using the TypeScript compiler API. Extracts inputs, outputs, methods, properties, and decorator details. This is a non-trivial, self-contained module that could be reused by any tool needing to introspect Angular component APIs, such as IDE extensions or custom documentation generators.
Custom markdown renderer built on top of 'marked' with extensions for embedding files, code groups with tabs, and syntax highlighting via Prism. Demonstrates a clean plugin architecture for markdown transformations. Could be extracted as a standalone markdown processor for documentation tools that need these advanced features.