MagicPython
MagicPython copied to clipboard
Support for rST files and PEP257
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
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?
@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.
Do you have any other improvements in mind?
VSCode has awesome docstring highlighting for JavaScript/TypeScript:
It would be awesome to have similar highlighting for reST docstrings in Python, they are currently hard to read: