Literate programming - using @ and @c

43 views
Skip to first unread message

Karthik Suresh

unread,
Nov 2, 2023, 9:20:52 AM11/2/23
to leo-editor
Hi,

I first came to Leo around 20 years ago when learning python and coming across literate programming. I found the @ and @c constructs very useful. I haven't used Leo for a few years, and coming back to it found that when I use them, the code is no longer colour coded in the way it used to be. I couldn't find anything in the documents, and when looking through the Leo settings discovered that in the Syntax coloring -> Default colors -> @bool color-doc-parts-as-rest = True this is now treated as a legacy approach - and this contains the folliwng:

False (legacy): color all @ and @doc parts with a uniform color.
True: call all @ and @doc parts as reStructuredText (@language rest).

For anyone else that has the same requirement, adding @bool color-doc-parts-as-rest = False to the myLeoSettings.leo file in a node gets the old behaviour back.

Just dropping a note to the group so that I can find it the next time I google this myself - but also just hope that this feature will not end up being removed as I think it's a useful one for those who still do some experimentation with literate style programming in the noweb lighter style approach.

Kind regards,
Karthik

Edward K. Ream

unread,
Nov 2, 2023, 9:27:19 AM11/2/23
to leo-editor
On Thursday, November 2, 2023 at 8:20:52 AM UTC-5 k.su... wrote:
 
in the Syntax coloring -> Default colors -> @bool color-doc-parts-as-rest = True this is now treated as a legacy approach - and this contains the following:


False (legacy): color all @ and @doc parts with a uniform color.
True: call all @ and @doc parts as reStructuredText (@language rest).

For anyone else that has the same requirement, adding @bool color-doc-parts-as-rest = False to the myLeoSettings.leo file in a node gets the old behaviour back.

Thanks for reminding me of this setting :-) Recently I wondered why Leo colored an @doc part as it did.

 just hope that this feature will not end up being removed.

Don't worry. I only remove unused settings.

Edward
Reply all
Reply to author
Forward
0 new messages