D16338: Improve R documentation highlighting
Aaron Puchert
noreply at phabricator.kde.org
Sat Oct 20 17:38:57 BST 2018
aaronpuchert created this revision.
aaronpuchert added reviewers: cullmann, dhaumann.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
aaronpuchert requested review of this revision.
REVISION SUMMARY
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:
- 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.
REPOSITORY
R216 Syntax Highlighting
BRANCH
improve-rdoc
REVISION DETAIL
https://phabricator.kde.org/D16338
AFFECTED FILES
autotests/folding/test.Rd.fold
autotests/html/test.Rd.html
autotests/input/test.Rd
autotests/reference/test.Rd.ref
data/syntax/rdoc.xml
To: aaronpuchert, cullmann, dhaumann
Cc: kwrite-devel, kde-frameworks-devel, #framework_syntax_highlighting, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20181020/411c816d/attachment.html>
More information about the KWrite-Devel
mailing list