How unixfile/dirview works
dirview serves local directories and fetched forge repositories as linked browser pages. The main reader workflow is to start drvu, route a browser request to a served tree, and render its files; code, search, and history provide parallel reading features. Separate workflows cover server and lock management, online-repository fetching, and PDF output. The graph combines README-documented capabilities with sampled routing and syntax-helper details; several subsystem links are dashed where implementation excerpts were not available.
Main entry points: server.go HTTP server · page.go Page routing · serve.go Server lifecycle · syntax.go Code pages
Components 25
Runtime and servers
- Local command
cmd/local/main.go - Public command
cmd/public/main.go - CLI options
args.go - Server lifecycle
serve.go - Locks and registry
registry.go - HTTP server
server.go - Served tree
server.go - Safety guards
guard.go
Pages and navigation
- Page routing
page.go - Tree listings
treepage.go - Page rendering
render.go - Linked pages
links.go - Live reload
live.go - PDF export
pdf.go
Code understanding
- Code pages
syntax.go - Syntax helper
syntax/main.go - Code scopes
scope.go
History and search
- Search
search.go - Git history
git.go - History pages
historypage.go - Semantic diffs
semantic.go - History feeds
feed.go
Online repositories
- Online repo service
web.go - Forge fetching
webclone.go
Other components
- Reader
Connections 27
- Reader → Local command: starts local
- Reader → Public command: starts public
- Local command → CLI options: parses options
- Public command → CLI options: parses options
- CLI options → Server lifecycle: configures serving
- Server lifecycle → Locks and registry: registers trees
serve.go - Server lifecycle → HTTP server: starts server
- HTTP server → Served tree: routes requests
server.go - HTTP server → Safety guards: wraps handlers
server.go - Reader → HTTP server: requests pages
- HTTP server → Page routing: dispatches pages
- Page routing → Tree listings: shows listings
- Page routing → Page rendering: renders pages
- Tree listings → Linked pages: links files
- HTTP server → Live reload: serves reload
server.go - Page routing → Code pages: shows code
- Code pages → Syntax helper: parses syntax
syntax/main.go - Code pages → Code scopes: shows scopes
- Served tree → Search: searches files
- Served tree → Git history: reads history
- Git history → History pages: provides revisions
- History pages → Semantic diffs: shows semantic diffs
- History pages → History feeds: offers feeds
- Reader → Online repo service: opens online repo
- Online repo service → Forge fetching: fetches repositories
web.go - Online repo service → HTTP server: serves fetched repos
web.go - Page routing → PDF export: exports PDF