Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Syntax Highlighting to a Text Editor with Python

I am creating my own web-based text editor and I want to add in syntax highlighting. To start off I will on do highlighting for one language (Python, most likely), but later on I want to add highlighting for every language I can think of.

I would like to find a tutorial on this if possible, does anyone know of a place where I can find one

Also, if there are any other tips you can give me, that would be great.

like image 357
Brewer Avatar asked Jun 24 '11 17:06

Brewer


People also ask

What is syntax highlighting in Python?

Syntax highlighting determines the color and style of source code displayed in the Visual Studio Code editor. It is responsible for colorizing keywords like if or for in JavaScript differently than strings and comments and variable names.

How do I add syntax highlights to Notepad?

To configure syntax highlighting, click on “Language” in the top bar, then click the letter the language starts with, and then the language. If you want to define your own language, click on “Language” again, then click on “User Defined Language”, third from the bottom, and then click “Define your language”.


1 Answers

Take a look at Pygments.


highlight.js

like image 171
ba__friend Avatar answered Sep 19 '22 13:09

ba__friend