# Markdowns as comments

**URL:** <https://internals.rust-lang.org/t/markdowns-as-comments/17486>\
**Category:** documentation\
**Created:** [October 4, 2022, 11:42am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486 "2022-10-04T11:42:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitisinhk](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/rohitisinhk/32/9889_2.png) [@rohitisinhk](https://internals.rust-lang.org/u/rohitisinhk)\
**Post date:** [October 4, 2022, 11:42am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486/1 "2022-10-04T11:42:18Z")

</div>

At present the comments look and work ok but I wish we could write comments as markdown so it gets highlighted and formatted so they are more readable both in editor and online such as github.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [October 4, 2022, 11:46am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486/2 "2022-10-04T11:46:39Z")

</div>

Doc comments are already written in markdown. As for non-doc comments you can use whatever format you want. If you want highlighting you could implement it yourself in your editor. As for github, they don't highlight doc comments either.

---

<div class="post-metadata">

**Author:** ![rohitisinhk](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/rohitisinhk/32/9889_2.png) [@rohitisinhk](https://internals.rust-lang.org/u/rohitisinhk)\
**Post date:** [October 7, 2022, 12:02am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486/3 "2022-10-07T00:02:08Z")

</div>

> If you want highlighting you could implement it yourself in your editor. As for github, they don't highlight doc comments either.

Am suggesting this to be a standard as part of rust spec so VSCode, github and diff tools can inline highlight the comments out of the box (as a standard or as an extension); so we as a developer can gain productivity.

I think seeing markdown based comments will help comments more readable, these comments will pop out, highlight and make it easy to read as compared to now

---

<div class="post-metadata">

**Author:** ![jhpratt](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jhpratt/32/11640_2.png) [@jhpratt](https://internals.rust-lang.org/u/jhpratt)\
**Post date:** [October 7, 2022, 12:21am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486/4 "2022-10-07T00:21:01Z")

</div>

> [@rohitisinhk](#):
>
> so VSCode, github and diff tools can inline highlight the comments out of the box

Tools can already do this. It doesn't have to be formally "part" of Rust. The reason doc comments are specified to be markdown is because that's what rustdoc — an integral part of Rust — expects.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [October 7, 2022, 6:54am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486/5 "2022-10-07T06:54:38Z")

</div>

And vscode and github doesn't highlight doc comments either despite those being specified as markdown, so it is unlikely they will highlight regular comments with your proposal. (if you see highlighting of doc comments in vscode, that is coming from rust-analyzer, not vscode itself)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/system/32/14092_2.png) [@system](https://internals.rust-lang.org/u/system)\
**Post date:** [January 5, 2023, 6:55am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486/6 "2023-01-05T06:55:26Z")

</div>

Closed on January 5, 2023, 6:55am UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
