Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use syntaxhighlighter

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how to use syntaxhighlighter for you. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

SyntaxHighlighter is a client-side web application highlight plug-in! Founded in 2004, it uses seamless highlighting of code anywhere, making it easy to display source code in various languages, such as html,css,JavaScript,php, on Web. It is made using JavaScript and css, it is beautifully decorated with line numbers, and the source is displayed for easy viewing. There is also a feature that makes it easy to copy the source parts in batches, which is very convenient.

The code flow of SyntaxHighlighter is as follows

1. Add basic files to the page: shCore.js and shCore.css

2. Add the desired brushes (for example: shBrushjscript.js for JavaScript, see a list of all available brushes)

3. Including shCore.css and shThemeDefault.css

4. Use the or method to create a code snippet 5 and call the SyntaxHighlighter.all () JavaScript method

Benefits of using SyntaxHighlighter

1. Support for sources of various languages

You can shake any line number or highlight a specified line

Double-click to select only the source

4. You can use "SyntaxHighlighter" to view the source code

SyntaxHighlighterv4

SyntaxHighlighter is the client-side fluorescent pen for network and network applications! It started in 2004, and it is almost nowhere seamlessly used in seamless Highlight code for presentation purposes.

The history of this project predates most common web technologies, and it has always been a challenge to use time and work. All the previous content is in one file and the window variable is assigned. Horror!

SyntaxHighlighter is currently in use and has been used by Microsoft. Apache . Mozilla . Yahoo! Wordpress . Bug Lab. Used by Freshbooks and many other companies and blogs.

See File issues.

Start

Build real-time instructions

User's guide

Be sure to read the warning.

Frequently asked questions

V4 is fully compatible with old brushes and themes, see the build guide.

For a clearer, more seamless experience, Has been completely removed.

You still need to escape when using tags

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report