Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include ASCII art/diagrams in Rust source-code comment documentation?

Tags:

rustdoc

How should Markdown be used with rustdoc to include diagrams or ASCII art?

From reading the manual, triple back-ticks can be used for code-snippets. How do I include literal, non-formatted text?

(Something like Doxygen's <pre>...</pre>)

like image 921
ideasman42 Avatar asked Jan 06 '23 02:01

ideasman42


1 Answers

You use triple graves

```text
like this
```

Note the text. This tells rustdoc to not syntax highlight what's inside; the default is to think it's Rust code.

like image 159
Steve Klabnik Avatar answered May 16 '23 09:05

Steve Klabnik