|
From: Robert D. <rob...@gm...> - 2025-07-08 15:51:09
|
On Tue, Jul 8, 2025 at 7:27 AM Raymond Toy <toy...@gm...> wrote: > Oh, that is really weird. I'll modify configure to have a new option to enable syntax highlighting (defaulting to off). > > Done. The option is --enable-syntax-highlighting, which defaults to no. I dunno. Most examples are mostly easier to read with highlighting, as it helps distinguish different kinds of tokens. I think turning it off is a loss. Yes, it can be reenabled, but that's never going to happen, right? (Some small number of people are building the documentation, and an even smaller number look at all the configure options.) > Huh. According to https://github.com/highlightjs/highlight.js/blob/5697ae5187746c24732e62cd625f3f83004a44ce/src/languages/maxima.js#L4, Robert wrote the support for syntax highlighting in highlightjs for maxima. > > We can probably fix up the issues with highlighting.... I cobbled together a syntax highlighting package by adapting some existing colorization scheme (I forget which one). The major issue is probably the list of keywords which are considered built-in. As you can see from the link above, it's a pretty long list -- I think I may have extract the list from the @deffn's and @defvr's in the Texinfo manual. The plot_options example looks funny because some symbols are colored as built-in and some aren't. I suppose we could try to expand the list to include everything in all packages, or maybe trim it down so e.g. the option symbol is colored but the values are not. I suppose we're going to find the same symbol appearing as one or the other in different contexts; short of context-sensitive colorization, I don't know what we can do about that. Anyone is welcome to try to improve the HTML highlighting -- I think the workflow is that you submit a pull request to the highlight.js project. I also submitted colorization packages to Vim and Pygments. Interested parties are invited to improve those as well. FWIW Robert PS. Aside from colorization, the plot_options is hard to read because of [[putting, the], [list, of], [key, value], [pairs, like]] this. It would be a lot easier to read with key = value. |