Skip to content

Choose modules for your interface ​

Language: English | 简体中文

Oolong uses module boundaries only where dependency sets change. Start with core, then add a module when its capability or dependency belongs in your application.

Select modules by responsibility ​

This table maps each public module to the reason for importing it:

ModuleAdd it when you needDirect third-party dependencies
coreTerminal ownership, grids, input, text, layout, runtime, or in-process testsuniseg, go-runewidth, x/term, x/sys
componentsHeadless behavior, the default theme, or compound componentsNone beyond core
markdownFinished or incremental GitHub Flavored Markdown (GFM)goldmark
highlightStyled source codechroma
latexSelectable terminal mathematicsgo-latex
mermaidPrepare Mermaid PNG diagrams in a workerx/sys on Windows; external official CLI and Chromium
sshOolong over an accepted SSH sessioncharm.land/ssh
ptytestAssertions against a real pseudoterminal (PTY)x/sys

The examples and internal modules are repository tools. Applications do not import them.

Install one coordinated version ​

Install every Oolong module at the same release version. @latest resolves the current coordinated release:

sh
go get github.com/Tangerg/oolong/core@latest
go get github.com/Tangerg/oolong/components@latest

Add optional content modules only when imported:

sh
go get github.com/Tangerg/oolong/markdown@latest
go get github.com/Tangerg/oolong/highlight@latest
go get github.com/Tangerg/oolong/latex@latest

Upgrade the complete imported set together. Pre-1.0 releases may change exported APIs, and the changelog records every migration.

Use common dependency sets ​

Choose one of these starting sets:

ApplicationModules
Core-only full-screen or inline interfacecore
Forms, editors, lists, dialogs, or themed componentscore, components
Markdown readercore, markdown
Themed Markdown componentcore, components, markdown
Agent output with code and mathematicscore, components, markdown, highlight, latex
SSH-hosted interfaceThe application set plus ssh
Real terminal integration testsThe application set plus ptytest in tests

An application may use highlight or latex without Markdown. Their natural entry points return core text or a core drawable.

Keep dependencies pointing down ​

The module graph is a directed acyclic graph (DAG):

mermaid
flowchart TD
    components --> core
    markdown --> core
    highlight --> core
    latex --> core
    ssh --> core
    ptytest --> core
    mermaid[mermaid: neutral PNG]

Optional content modules remain peers. Compose them in the application through the core drawable contract; do not create imports between them.

Verify the consumer graph ​

The repository uses go.work, but consumers do not receive it. Test the graph declared by go.mod before publishing an application:

sh
GOWORK=off go mod tidy -diff
GOWORK=off go test ./...

These commands expose missing require directives and accidental reliance on unpublished workspace code.

Continue with Build your first interface for core, or Compose a themeable picker for the component layer.

Released under the Apache 2.0 License.