inline-help
1 Quick Start
2 API Reference
doc
do-doc
3 Environment
9.0

inline-help🔗ℹ

Samuel B. Johnson

 (require inline-help) package: inline-help

Terminal documentation for Racket. When working on a remote machine or in a terminal without a browser, Racket’s built-in help is useless because it tries to open HTML docs in a web browser. inline-help provides a doc macro that renders documentation directly in the REPL with ANSI formatting.

1 Quick Start🔗ℹ

Install the package:

raco pkg install inline-help

Then in the REPL:

(require inline-help)
(doc map)
(doc define)
(doc string-join)

2 API Reference🔗ℹ

syntax

(doc id)

(doc id #:from module-path)
(doc str)
Looks up and displays documentation for id in the terminal.

  • (doc id) Looks up id in the racket module, which covers everything available in a standard #lang racket REPL.

  • (doc id #:from module-path) Looks up id as provided by module-path. Use this when the identifier comes from a specific library, e.g. (doc second #:from racket/list).

  • (doc str) When given a string literal, searches the documentation index. (Not yet implemented.)

The output includes:

  • The identifier name and providing module

  • The kind (procedure, syntax, value, struct, etc.)

  • The full signature from the blue box

  • The prose description from the HTML documentation

Output uses ANSI formatting (bold, color) when the terminal supports it, and falls back to plain text when TERM is dumb or unset.

procedure

(do-doc sym mod)  void?

  sym : symbol?
  mod : (or/c #f module-path?)
The runtime function underlying doc. Looks up sym in mod (defaulting to 'racket when mod is #f) and prints the documentation to current-output-port.

If the identifier is not found, prints a “not found” message.

3 Environment🔗ℹ

  • TERM When set to dumb or unset, ANSI colors are disabled. Any other value enables color output.

  • COLUMNS Sets the terminal width for word wrapping. Defaults to 80 if unset.