typst / typst/typst

Proposal for a visual debug mode

Open
#5,226 2 comments 16 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request ide layout
Dominant language
Rust
Stars
56.1k
Forks
1.7k
Avg merge
3d 10h
Merged PRs (30d)
22

Description

Description

This likely borders on something that could be achieved with a package, but integrating it into the compiler might also make sense, depending on the scope. So I'm proposing the idea here.

When setting layouts, it is often difficult to determine where a particular (possibly unwanted) spacing comes from or what the dimensions/indents etc. of a single element are. Of course, you can use fills and strokes to some degree, but this is often burdensome or doesn't show the whole picture in an easy-to-overview manner.

Similar to the inspector in HTML/CSS environments or tools like geometry/showframe or lua-visual-debug in the LaTeX universe, a debug mode would be very useful.

This mode could show, for example:

  • Outlines of blocks and page parts without affecting the layout
  • Dimensions and x/y position of blocks and boxes without affecting content or layout
  • Spacings and paddings for each element
  • Whitespace, line and page breaks
  • Baselines and lines per element
  • Broken characters
Use Case

This approach would make debugging more intuitive, significantly reducing support requests and enhancing ease of use.

Rudimentary examples (not showing many possible features mentioned above):
p0V9V
kOwa3
Image Source: https://tex.stackexchange.com/questions/2083/how-can-i-visualize-boxes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The proposal does not name any files, tests, or compiler entry points to inspect. Start by determining whether the functionality belongs in the compiler or an external package, then define a focused initial scope and acceptance criteria for the visual debug output before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.