atom-language-rust icon indicating copy to clipboard operation
atom-language-rust copied to clipboard

Provide markdown syntax highlighting within doc comments

Open frewsxcv opened this issue 9 years ago • 6 comments

It might be possible to utilize the markdown+atom plugin grammar into this rust+atom plugin.

A similar example to this would be CSS or JS syntax highlighting within HTML documents https://github.com/atom/language-html

frewsxcv avatar Jul 03 '15 06:07 frewsxcv

I like this idea. Markdown is quite common in comments, so highlighting comments (or maybe only doc comments?) would be nice.

Unfortunately, I'm quite busy with my main job at the moment and I don't get much time for Github. But feel free to submit a pull request ;)

zargony avatar Jul 23 '15 09:07 zargony

I've tried to implement this but struggle with a few edge cases:

Markdown block elements don't work in line doc comments: Demo with line doc comments

I guess this is because line comments are recognised individually

Stars in block doc comments: Stars in block doc comments

It's probably obvious why this happens, but I really don't know how to prevent this.

With normal block comments every thing works as expected: Working demo with normal doc block commnets

Every help is welcome!

MoritzKn avatar Jul 05 '16 09:07 MoritzKn

I am trying to add a spell-checker for rust doc comment using the linter-spell package, and this would be needed to prevent spell checking of links, examples and other in documentation comments. I can not help here, as I do not know enough of javascript and atom internals. But I wanted to let you know that this would be really nice to have!

Luthaf avatar Oct 22 '16 19:10 Luthaf

Is there a branch were this is being worked on?

Nokel81 avatar Aug 08 '17 21:08 Nokel81

Is there an update to this discussion?

AlexGrafe avatar Apr 28 '19 10:04 AlexGrafe

Okay it's five years later and I completely forgot I opened this and opened an identical issue 🙃.

@MoritzKn I guess this is because line comments are recognised individually

Regarding the line comments issue, is it possible we could capture all the line comments as a single block, instead of capturing them individually? Could that get us closer?

frewsxcv avatar May 23 '20 19:05 frewsxcv