Repository: zeppelin Updated Branches: refs/heads/master 81adf09f2 -> 19e8ed989
[ZEPPELIN-958] Support syntax highlight for python and r interpreter ### What is this PR for? Support syntax highlight for python and r interpreter ### What type of PR is it? Bug Fix ### What is the Jira issue? [ZEPPELIN-958](https://issues.apache.org/jira/browse/ZEPPELIN-958) ### Screenshots (if appropriate) **Before** <img width="411" alt="screen shot 2016-06-06 at 12 21 56 am" src="https://cloud.githubusercontent.com/assets/8503346/15814633/be1550ba-2b7c-11e6-89ee-8e8534f89ec7.png"> **After** <img width="412" alt="screen shot 2016-06-05 at 7 42 55 pm" src="https://cloud.githubusercontent.com/assets/8503346/15810670/cd7960fe-2b55-11e6-8145-50517eaf2195.png"> **Before** <img width="647" alt="screen shot 2016-06-05 at 7 30 53 pm" src="https://cloud.githubusercontent.com/assets/8503346/15810554/c6e49ec6-2b54-11e6-8b8b-a327dd76d437.png"> **After** <img width="604" alt="screen shot 2016-06-05 at 7 30 31 pm" src="https://cloud.githubusercontent.com/assets/8503346/15810551/bf48cfc0-2b54-11e6-9ad1-bc16596074ee.png"> ### Questions: * Does the licenses files need update? No * Is there breaking changes for older versions? No * Does this needs documentation? No Author: Mina Lee <[email protected]> Closes #966 from minahlee/ZEPPELIN-958 and squashes the following commits: 9821f94 [Mina Lee] Support syntax hightlight for python and r interpreter Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/19e8ed98 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/19e8ed98 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/19e8ed98 Branch: refs/heads/master Commit: 19e8ed98984c2d2dc91532636ecbfa3115db2796 Parents: 81adf09 Author: Mina Lee <[email protected]> Authored: Sun Jun 5 19:33:00 2016 -0700 Committer: Alexander Bezzubov <[email protected]> Committed: Fri Jun 10 23:44:40 2016 +0200 ---------------------------------------------------------------------- zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js | 3 ++- zeppelin-web/src/app/search/result-list.controller.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/19e8ed98/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js index da17ed7..3a1e822 100644 --- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js +++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js @@ -79,8 +79,9 @@ angular.module('zeppelinWebApp') var angularObjectRegistry = {}; var editorModes = { - 'ace/mode/python': /^%(\w*\.)?pyspark\s*$/, + 'ace/mode/python': /^%(\w*\.)?(pyspark|python)\s*$/, 'ace/mode/scala': /^%(\w*\.)?spark\s*$/, + 'ace/mode/r': /^%(\w*\.)?(r|sparkr|knitr)\s*$/, 'ace/mode/sql': /^%(\w*\.)?\wql/, 'ace/mode/markdown': /^%md/, 'ace/mode/sh': /^%sh/ http://git-wip-us.apache.org/repos/asf/zeppelin/blob/19e8ed98/zeppelin-web/src/app/search/result-list.controller.js ---------------------------------------------------------------------- diff --git a/zeppelin-web/src/app/search/result-list.controller.js b/zeppelin-web/src/app/search/result-list.controller.js index 949e01f..bba88f0 100644 --- a/zeppelin-web/src/app/search/result-list.controller.js +++ b/zeppelin-web/src/app/search/result-list.controller.js @@ -43,7 +43,9 @@ angular return function(_editor) { function getEditorMode(text) { var editorModes = { - 'ace/mode/scala': /^%spark/, + 'ace/mode/scala': /^%(\w*\.)?spark/, + 'ace/mode/python': /^%(\w*\.)?(pyspark|python)/, + 'ace/mode/r': /^%(\w*\.)?(r|sparkr|knitr)/, 'ace/mode/sql': /^%(\w*\.)?\wql/, 'ace/mode/markdown': /^%md/, 'ace/mode/sh': /^%sh/
