MagicPython icon indicating copy to clipboard operation
MagicPython copied to clipboard

Support for rST files and PEP257

Open blaisep opened this issue 8 years ago • 3 comments

Hi, I wonder if anyone has considered support for rST files (I'm thinking particularly of the directives and labels often used when writing for Sphinx? If I wanted to implement that, do you have any suggestions of the approach I should take?

Thanks! -Blaise

blaisep avatar Feb 09 '16 21:02 blaisep

Hi @blaisep!

Last time I checked there were some ReST highlighters for ST, but I'm not sure of their quality. You might want to check them out first. In terms of approach, I'd really recommend you to use the same files layout and build system as we're using for MP. The syntaxdev package is especially useful for unittesting.

As for PEP 257 support in MagicPython -- we already highlight docstrings differently from regular strings. For instance, we don't highlight formatting placeholders etc. Do you have any other improvements in mind?

1st1 avatar Feb 09 '16 22:02 1st1

@blaisep If you want to try and improve doctring highlighting in MagicPython, I'd suggest looking at how docstring and docstring-prompt rules are structured in here.

vpetrovykh avatar Feb 09 '16 22:02 vpetrovykh

Do you have any other improvements in mind?

VSCode has awesome docstring highlighting for JavaScript/TypeScript:

docstring_ts

It would be awesome to have similar highlighting for reST docstrings in Python, they are currently hard to read:

docstring_py

feluxe avatar Jul 10 '19 11:07 feluxe