Uploaded image for project: 'Zeppelin'
  1. Zeppelin
  2. ZEPPELIN-188

Syntax highlighting for Zeppelin Notebooks

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.5.6
    • Component/s: GUI
    • Environment:

      Chrome, Mozilla,IE 10 & Above & Safari

    • Flags:
      Important

      Description

      While using the notebook feature in zeppelin the following syntax highlighting features should be available for ease of use:

      • Should support - Python, Scala, Java and JS (Angular Interpreters)
      • Syntax highlighting with focus on Richness & Correctness.
      • Display of line numbers

      In addition

      • highlighting should also be fast and not degrade performance/experience
      • size of library should be a consideration while integration.

      Some discussion around this can be found here as under:
      http://softwaremaniacs.org/blog/2011/05/22/highlighters-comparison/

        Activity

        Hide
        doanduyhai DOAN DuyHai added a comment -

        Should support - Python, Scala, Java and JS (Angular Interpreters)

        What is the need for supporting above programming languages ? As far as I know Zeppelin is a generic front-end for back-end technologies and frameworks. Supporting an interpreter for each programming language may be feasible (provided that the language offers a REPL, which is not the case for Java) but may overlap with already existing solutions. Namely, Python for example, has already IPython as a notebook equivalent to Zeppelin.

        Syntax highlighting with focus on Richness & Correctness

        I think there is already an Ace editor in Zeppelin right now but I don't know its status.

        Otherwise +1 for line number display. I'm thinking also about the idea of interactive content assist but I don't know yet if it is easily feasible

        Show
        doanduyhai DOAN DuyHai added a comment - Should support - Python, Scala, Java and JS (Angular Interpreters) What is the need for supporting above programming languages ? As far as I know Zeppelin is a generic front-end for back-end technologies and frameworks. Supporting an interpreter for each programming language may be feasible (provided that the language offers a REPL, which is not the case for Java) but may overlap with already existing solutions. Namely, Python for example, has already IPython as a notebook equivalent to Zeppelin. Syntax highlighting with focus on Richness & Correctness I think there is already an Ace editor in Zeppelin right now but I don't know its status. Otherwise +1 for line number display. I'm thinking also about the idea of interactive content assist but I don't know yet if it is easily feasible
        Hide
        rchoudhary Rohit Choudhary added a comment -

        What is the need for supporting above programming languages ? As far as I know Zeppelin is a generic front-end for back-end technologies and frameworks. Supporting an interpreter for each programming language may be feasible (provided that the language offers a REPL, which is not the case for Java) but may overlap with already existing solutions. Namely, Python for example, has already IPython as a notebook equivalent to Zeppelin.

        What I meant here was the ability to do syntax highlighting for all these languages, inside the notebook. The current default syntax highlighter does not allow the switching between different languages based on the %interpreter used in the paragraph. Example - http://ace.c9.io/build/kitchen-sink.html.

        I think there is already an Ace editor in Zeppelin right now but I don't know its status.

        This and above are the same area of improvement.

        Otherwise +1 for line number display. I'm thinking also about the idea of interactive content assist but I don't know yet if it is easily feasible

        ok

        Show
        rchoudhary Rohit Choudhary added a comment - What is the need for supporting above programming languages ? As far as I know Zeppelin is a generic front-end for back-end technologies and frameworks. Supporting an interpreter for each programming language may be feasible (provided that the language offers a REPL, which is not the case for Java) but may overlap with already existing solutions. Namely, Python for example, has already IPython as a notebook equivalent to Zeppelin. What I meant here was the ability to do syntax highlighting for all these languages, inside the notebook. The current default syntax highlighter does not allow the switching between different languages based on the %interpreter used in the paragraph. Example - http://ace.c9.io/build/kitchen-sink.html . I think there is already an Ace editor in Zeppelin right now but I don't know its status. This and above are the same area of improvement. Otherwise +1 for line number display. I'm thinking also about the idea of interactive content assist but I don't know yet if it is easily feasible ok
        Hide
        githubbot ASF GitHub Bot added a comment -

        GitHub user r-kamath opened a pull request:

        https://github.com/apache/incubator-zeppelin/pull/174

        ZEPPELIN-188 Display of line numbers

        Partial check-in with reference to : ZEPPELIN-188.

        • Add an option under the paragraph settings to show/hide line numbers in ace editor

        Since Ace editor is already integrated, with minor changes, this patch will get us line numbers. Based on comments, would like to work on improving - syntax highlighting & auto-complete.

        Thanks!

        You can merge this pull request into a Git repository by running:

        $ git pull https://github.com/r-kamath/incubator-zeppelin master

        Alternatively you can review and apply these changes as the patch at:

        https://github.com/apache/incubator-zeppelin/pull/174.patch

        To close this pull request, make a commit to your master/trunk branch
        with (at least) the following in the commit message:

        This closes #174


        commit 19aecb2ccf88946d7cee9b81af0ed9dc6963d967
        Author: Renjith Kamath <renjith.kamath@gmail.com>
        Date: 2015-07-31T15:06:57Z

        ZEPPELIN-188 Display of line numbers

        Add an option under the paragraph settings to show/hide line numbers in
        ace editor


        Show
        githubbot ASF GitHub Bot added a comment - GitHub user r-kamath opened a pull request: https://github.com/apache/incubator-zeppelin/pull/174 ZEPPELIN-188 Display of line numbers Partial check-in with reference to : ZEPPELIN-188 . Add an option under the paragraph settings to show/hide line numbers in ace editor Since Ace editor is already integrated, with minor changes, this patch will get us line numbers. Based on comments, would like to work on improving - syntax highlighting & auto-complete. Thanks! You can merge this pull request into a Git repository by running: $ git pull https://github.com/r-kamath/incubator-zeppelin master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/incubator-zeppelin/pull/174.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #174 commit 19aecb2ccf88946d7cee9b81af0ed9dc6963d967 Author: Renjith Kamath <renjith.kamath@gmail.com> Date: 2015-07-31T15:06:57Z ZEPPELIN-188 Display of line numbers Add an option under the paragraph settings to show/hide line numbers in ace editor
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user felixcheung commented on the pull request:

        https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-127507327

        is there a way to have this a sticky setting persisted across sections?
        is this settable from the interpreter tab?

        Show
        githubbot ASF GitHub Bot added a comment - Github user felixcheung commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-127507327 is there a way to have this a sticky setting persisted across sections? is this settable from the interpreter tab?
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user r-kamath commented on the pull request:

        https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-127557729

        > is there a way to have this a sticky setting persisted across sections?

        In 19aecb2 show/hide line number action is in the paragraph settings and is persisted only in the instance where it's turned on.

        > is this settable from the interpreter tab?

        We can have a new option in the Notebook settings to invoke show/hide action for all paragraphs.
        ![notebook-actions](https://cloud.githubusercontent.com/assets/2031306/9058168/bece6a66-3abc-11e5-8a7f-cfbaf112f4a5.png)

        Show
        githubbot ASF GitHub Bot added a comment - Github user r-kamath commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-127557729 > is there a way to have this a sticky setting persisted across sections? In 19aecb2 show/hide line number action is in the paragraph settings and is persisted only in the instance where it's turned on. > is this settable from the interpreter tab? We can have a new option in the Notebook settings to invoke show/hide action for all paragraphs. ! [notebook-actions] ( https://cloud.githubusercontent.com/assets/2031306/9058168/bece6a66-3abc-11e5-8a7f-cfbaf112f4a5.png )
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user corneadoug commented on the pull request:

        https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-127713971

        Current action bar is pretty full right now (and hard to understand)
        The less actions buttons, the better

        Show
        githubbot ASF GitHub Bot added a comment - Github user corneadoug commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-127713971 Current action bar is pretty full right now (and hard to understand) The less actions buttons, the better
        Hide
        githubbot ASF GitHub Bot added a comment -
        Show
        githubbot ASF GitHub Bot added a comment - Github user Leemoonsoo commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-129259358 This is screenshot comes from this branch ! [image] ( https://cloud.githubusercontent.com/assets/1540981/9157367/d3a31abc-3eaf-11e5-992c-b22b93e18ff2.png )
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user Leemoonsoo commented on the pull request:

        https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-129709364

        It looks good to me. It enables display line numbers while it does not change any default behavior. We can still discuss about action button in separate issue.

        If there're no more discussions, i'm merging it.

        Show
        githubbot ASF GitHub Bot added a comment - Github user Leemoonsoo commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-129709364 It looks good to me. It enables display line numbers while it does not change any default behavior. We can still discuss about action button in separate issue. If there're no more discussions, i'm merging it.
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user asfgit closed the pull request at:

        https://github.com/apache/incubator-zeppelin/pull/174

        Show
        githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/incubator-zeppelin/pull/174
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user eranwitkon commented on the pull request:

        https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-130825698

        Just found out that when we turn on line number or turn of line numbers it always reset the paragraph title.
        ![selection_014](https://cloud.githubusercontent.com/assets/2227083/9260477/8abd2d38-4210-11e5-9b1d-f7d0f397e1a1.png)

        Now, after adding the line numbers:
        ![selection_015](https://cloud.githubusercontent.com/assets/2227083/9260493/a4e1929e-4210-11e5-9996-bda5fed5628c.png)

        Show
        githubbot ASF GitHub Bot added a comment - Github user eranwitkon commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-130825698 Just found out that when we turn on line number or turn of line numbers it always reset the paragraph title. ! [selection_014] ( https://cloud.githubusercontent.com/assets/2227083/9260477/8abd2d38-4210-11e5-9b1d-f7d0f397e1a1.png ) Now, after adding the line numbers: ! [selection_015] ( https://cloud.githubusercontent.com/assets/2227083/9260493/a4e1929e-4210-11e5-9996-bda5fed5628c.png )
        Hide
        githubbot ASF GitHub Bot added a comment -

        Github user eranwitkon commented on the pull request:

        https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-130827787

        The problem above is due to the ```commitParagraph``` call within ```$scope.showLineNumbers``` and ```$scope.hideLineNumbers```

        Show
        githubbot ASF GitHub Bot added a comment - Github user eranwitkon commented on the pull request: https://github.com/apache/incubator-zeppelin/pull/174#issuecomment-130827787 The problem above is due to the ```commitParagraph``` call within ```$scope.showLineNumbers``` and ```$scope.hideLineNumbers```

          People

          • Assignee:
            rkamath Renjith Kamath
            Reporter:
            rchoudhary Rohit Choudhary
          • Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 336h
              336h
              Remaining:
              Remaining Estimate - 336h
              336h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development