Hi! I've grown really attached to being able to set different colors for C++ comments (//) and document comments (///), and I'm looking to replicate that for python code (maybe ## or something). Glancing through LexPython, I don't see anything about document comments like I do in LexCPP. Is anyone aware of a way to achieve two different color of Python comments without modifying stock Geany? The best I have now is using triple-quoted blocks, but I find I don't use it because it's so many characters. Thanks!
I don't think there is a way to get two different comment colors without modifying the lexer code and Geany's styling.
However, the "pythonic" way is using triple-quoted strings (or well, I guess any string will do, but usually documentation is longer than that) as the first statement in e.g. a function. You can then access this in the `__doc__` property of the associated symbol. ```python def foo(): """This fooes around""" return 0xf00
print(foo.__doc__) ```
Thanks! I wasn't aware of `foo.__doc__`, that's neat.
Closed #3869 as resolved.
github-comments@lists.geany.org