Write or paste markdown with Rust in it, and the preview shows a formatted document where the Rust code is highlighted; share it and the reader gets the same view through a link.
A lot of Rust writing is explanation. Someone fights the borrow checker for an afternoon and writes down what the compiler said, why, and the version that compiles. A library author drafts a proposal for a new trait and wants feedback before touching the crate. A team that is adopting Rust collects small notes on ownership, error handling with Result and the ? operator, and when to reach for Arc. Those notes mix compiler messages, prose and code, and they are much easier to follow with structure.
In the rendered view, lifetimes, macros, attributes, keywords and string literals get their own colors, so &'a str is not lost in the middle of a signature and a #[derive] line is easy to spot. Compiler output can sit in an untagged fenced block, which keeps it monospaced without pretending it is Rust.
The preview never invokes cargo or rustc. What you see is your text, formatted. Shared documents are read-only for viewers, need no account to open, and are deleted automatically 15 days after they are created, so a quick explanation for a teammate does not linger anywhere.
How to view Rust in markdown
- Paste your markdown into the editor above, or edit the example.
- Wrap Rust code in a fenced block that starts with ```rust.
- The preview shows the rendered document with the code highlighted (side by side on desktop; switch to Preview on a phone).
- Select Share to get a read-only link that anyone can open without an account.
Frequently asked questions
What tag do I use for Rust blocks?
Use ```rust. The shorter ```rs is not registered as an alias, so code under that tag shows without colors.
Can I include compiler error output?
Yes. Put it in a fenced block without a language tag, or with a tag the highlighter does not know, and it stays monospaced and uncolored, which keeps it visually separate from the Rust source.
Is the code checked by the compiler?
No. sharemd.net does not build or run anything. It renders the markdown and colors the code blocks.