Skip to content

Improve README with features, prompt docs, and directives#512

Merged
Octachron merged 3 commits into
ocaml-community:masterfrom
bbatsov:improve-readme
Mar 9, 2026
Merged

Improve README with features, prompt docs, and directives#512
Octachron merged 3 commits into
ocaml-community:masterfrom
bbatsov:improve-readme

Conversation

@bbatsov

@bbatsov bbatsov commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

A while ago I came across https://ocaml.org/news/about-utop and I felt it explained some aspects of utop better than the README does — things like the prompt structure, the completion system, Lwt/Async auto-evaluation, and the #typeof directive. I wanted to incorporate those items here so they're easier to discover.

I also noticed a few other small things worth fixing, so I tackled those as well — I'm a big believer in kaizen (small improvements).

- Add a Features section highlighting key capabilities (completion,
  syntax highlighting, Lwt/Async auto-eval, #typeof, short paths,
  auto toplevel printers, Lambda-term/Zed)
- Document the prompt structure (time, command number, macro counter,
  key sequence) and how to switch prompt styles
- Add a Directives table listing all utop-specific directives
- Split the old Usage section into Prompt, Completion bar, and
  Directives subsections
- Streamline the Customization/Prompt section to avoid duplication
- Fix anchor tag (href -> id) for Emacs usage section
- Fix documentation URL to use https
- Fix dune file code block language tags (elisp -> dune)
- Remove outdated opam < 2.1 instructions
- Rename "Common error" to "Troubleshooting"
@bbatsov
bbatsov requested a review from rgrinberg as a code owner March 6, 2026 13:31
Comment thread README.md Outdated
Features
--------

- **Context-sensitive completion** — utop uses the compiler internals to

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compiler internalscompiler libraries (because fortunately utop is not using a fork of the compiler source code)

Comment thread README.md Outdated
UTop.set_show_box false
```
`UTop.prompt`. Several built-in prompt styles are available via
directives — see the [Directives](#directives) table above.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the impression that it might be useful to keep mentioning the init file as a way to customize the prompt.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad - seems I deleted here a bit more than I should have. I've pushed a commit addressing this.

@Octachron Octachron left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, I agree that this is a good improvement of the utop readme.

@Octachron
Octachron merged commit fe6156f into ocaml-community:master Mar 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants