Improve R documentation highlighting

Authored by aaronpuchert on Oct 20 2018, 6:31 PM.


Improve R documentation highlighting

After trying out the highlighting on a larger set of files and reading
parts of the specification again, I've come to the conclusion that there
is room for improvement. The following changes are included:

  • Some sections don't support markup, so we highlight them as "names": \name, \keyword, \docType and \encoding.
  • The \email keyword nominally supports markup inside of it, but it's not clear how that actually works, so we highlight it as verbatim.
  • We separate R and R-like contexts. The former are actual R code and might be executed as such, but the latter will not be executed, and might not even be syntactically correct R code. So we don't use R highlighting for R-like code, and rather print it as verbatim.
  • We now support \verb and \figure which I forgot for some reason in the original version.
  • We added some markup support inside of R code. Note that because we also use R highlighting, the markup only works on the top level.
  • Error recovery wasn't any good. When expecting an argument and not getting it, we now back off after highlighting whatever comes before the next opening brace. Otherwise it's just to noisy when writing code. We also highlight extra spaces before { as erroneous.
  • Spell checking makes no sense for R source, item names and errors.

Reviewers: cullmann, dhaumann

Reviewed By: dhaumann

Subscribers: kwrite-devel, kde-frameworks-devel, Framework: Syntax Highlighting

Tags: Kate, Frameworks

Differential Revision:


aaronpuchertOct 20 2018, 6:31 PM
Differential Revision
D16338: Improve R documentation highlighting
R216:dd52b4cd3dd2: No spell checking for Metamath except in comments