rust-lang / rust-lang/docs.rs

Feature request: inject syntax highlighting for TOML into crate docs

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

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.2k
Forks
232
Avg merge
11h 35m
Merged PRs (30d)
60

Description

I just ran into this while working on https://github.com/launchbadge/sqlx/pull/3383

It'd be really nice to have syntax highlighting for TOML in crate docs, because I'm including a lot of it.

I found https://github.com/rust-lang/docs.rs/issues/1047 which was closed already and the upstream issue https://github.com/rust-lang/rust/issues/43165, but the general disposition for the latter seems to be summed up by this comment: https://github.com/rust-lang/rust/issues/43165#issuecomment-551141278

It doesn't seem likely that rustdoc itself will gain support for this anytime soon.

The reason I'm opening this issue is because this comment points out that TOML syntax highlighting is already available on the details pages for crates. It doesn't seem like it would take much to inject it into the HTML for the docs themselves.

Contributor guide

No contributing guide indexed for this repository

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

Start by tracing how docs.rs adds TOML highlighting on crate details pages, then inspect the HTML generation path for crate documentation. Confirm the existing highlighting mechanism can also cover TOML code in rendered crate docs, and verify the generated HTML displays it correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.