Concepts overview
Sunset has four user-visible concepts:
| Concept | Meaning |
|---|---|
| Source file | A file whose extension maps to one of the registered tree-sitter grammars. |
| Parse result | A tree and source bytes produced for one file. The public Go API exposes this as FileResult. |
| Generated document | Markdown containing frontmatter and either a summary or full CST body. |
| Incremental state | SHA-256 hashes and metadata stored in .sunset/cache/cache.json. |
The CLI engine connects them in this order:
project root -> scanner -> language registry -> parser -> output renderer
| |
+------------ cache -------------------+
The scanner and engine are internal implementation details. The pkg/sunset
package is the stable public Go surface for parsing one file, inspecting its
tree, and listing languages. The Markdown schema is implemented by
internal/output and is observable, but its internal Go structs are not public
API.
Language identity
Language detection is case-insensitive and uses the file extension. Go uses
.go; JavaScript uses .js and .jsx; TypeScript uses .ts and .tsx; and
Python uses .py. An unsupported or extensionless file returns an unsupported
language error from the parser path.