On this page
Registering selfdoc's whole command tree on one strictcli application, so one binary answers for every project kind and carries every command group.
#internal/cli
#internal/cli
Package cli registers selfdoc's whole command tree on one strictcli application.
One binary carries what used to be two Python CLIs, so every cross-CLI refusal they made is gone: build --target unified builds a unified site here rather than naming another package, and check answers for every project kind. What each command does, refuses and prints is otherwise the Python's, verbatim.
Nothing here changes the process's working directory. The directory a command operates on is Options.Dir, which the editor's publish path sets explicitly so an in-process invocation can act on a repository that is not the one the editor was started in.
#AppHelp
const AppHelp = "Code-aware static site generator with directive-based content extraction"AppHelp is the one-line description selfdoc --help prints.
#Options
type Options structOptions is everything one application is built from.
Only Version comes from the binary itself; every other member has a working zero value. Those members exist for the two callers that are not the binary: the editor's publish path, which runs a command in-process against a stated directory and collects its output, and the suite, which stubs the two registries a toolchain pin is checked against.
#New
func New(opts Options) *strictcli.AppNew builds the selfdoc application.
Installing the lint-code validator is part of building the binary rather than optional: internal/config keeps the check as a seam so it stays loadable without the lint registry, and while the seam is nil a config's lint_ignore list is accepted as written.
#publisher.Descriptor
func (p *publisher) Descriptor() editor.DescriptorDescriptor projects the publish command's own declaration out of the application's schema, so the consent dialog renders what the command really declares rather than a copy of it kept here.
#publisher.Plan
func (p *publisher) Plan(projectDir string) (editor.Plan, error)Plan reports what a publish of projectDir would make public, read off the same post discovery the publish itself runs.
#publisher.Publish
func (p *publisher) Publish(projectDir string, approveConsequential bool, out io.Writer) (int, error)Publish runs the publish command in process against projectDir, writing everything it emits to out.
#reloadServer.ServeHTTP
func (s *reloadServer) ServeHTTP(w http.ResponseWriter, r *http.Request)#injectingWriter.Header
func (w *injectingWriter) Header() http.Header { return w.rw.Header() }#injectingWriter.WriteHeader
func (w *injectingWriter) WriteHeader(status int) { w.status = status }#injectingWriter.Write
func (w *injectingWriter) Write(p []byte) (int, error) { return w.buf.Write(p) }