How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 15
Accepted Solution

How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

Hi,

 

I have installed the SAS kernel for Jupyter Notebooks following the instructions here:

https://sassoftware.github.io/sas_kernel/install.html#windows-install-assuming-sas-already-installed

 

I am able to connect to the SAS kernel and run code, view output, etc. but I have not been able to enable syntax highlighting. Any ideas as to how to enable that?

 

Here are a few more details about my installation:

Windows 7

SAS version 9.4 (TS1M0) is installed locally

Anaconda distribution of Jupyter

I edited the "sascfg.py" file to point to the path for SAS startup script and I edited the paths for the local classpath variable.

I also had to add the path to sspiauth.dll to my System PATH.

 

Thanks!

John

 


Accepted Solutions
Solution
‎03-25-2017 03:09 PM
SAS Employee
Posts: 10

Re: How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

@jnvickery, You can add the SAS syntax by following the instructions here: https://sassoftware.github.io/sas_kernel/install.html#installing-sas-nbextensions

 

I wrote a couple of Notebook (NB) extensions that once enabled will allow you to use the SAS syntax coloring or hte python depending on your use case.

 

Jared 

View solution in original post


All Replies
Community Manager
Posts: 2,692

Re: How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

Glad you got this going!

 

@Jared might be able to provide some guidance on the syntax highlighting.

Solution
‎03-25-2017 03:09 PM
SAS Employee
Posts: 10

Re: How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

@jnvickery, You can add the SAS syntax by following the instructions here: https://sassoftware.github.io/sas_kernel/install.html#installing-sas-nbextensions

 

I wrote a couple of Notebook (NB) extensions that once enabled will allow you to use the SAS syntax coloring or hte python depending on your use case.

 

Jared 

Occasional Contributor
Posts: 15

Re: How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

Thanks @Jared

That worked great. I hadn't realized that the functionality was controlled through the notebook extensions.

 

For anyone else installing the extensions...

When I first ran the commands to install and enable the extensions, I got the following errors:

[InstallNBExtensionApp] CRITICAL | Bad config encountered during initialization:
[InstallNBExtensionApp] CRITICAL | Unrecognized flag: '--py'

 

Updating jupyter notebooks with the following command and then re-running the install commands resolved the error.

"conda update notebook"

 

- John

 

 

SAS Employee
Posts: 10

Re: How do I add syntax highlighting to Jupyter Notebook - SAS kernel?

@jnvickery Glad it worked! The syntax actually comes from the CodeMirror mode for SAS if you find issues please let me know. 

 

Jared

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 306 views
  • 2 likes
  • 3 in conversation