# googlearchive/code-prettify

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/googlearchive-code-prettify).**

5,767 stars · 885 forks · JavaScript · Apache-2.0 · archived

## Links

- GitHub: https://github.com/googlearchive/code-prettify
- awesome-repositories: https://awesome-repositories.com/repository/googlearchive-code-prettify.md

## Description

Code-prettify is a browser-based tool and HTML syntax highlighter that adds visual formatting and line numbers to raw code blocks on web pages. It functions as a client-side code formatter and a customizable lexer library for defining language-specific highlighting rules.

The system allows for the creation of custom lexers to provide syntax highlighting for proprietary or uncommon programming languages. Visual presentation is managed through custom code styling and the integration of external CSS stylesheets to define colors and fonts.

The project provides automatic syntax highlighting and sequential line numbering for source code snippets embedded in HTML. It supports the addition of custom language support and the styling of technical documentation.

## Tags

### User Interface & Experience

- [Syntax Highlighting](https://awesome-repositories.com/f/user-interface-experience/presentation-frameworks/code-presentation-utilities/code-line-highlighting/syntax-highlighting.md) — Adds readable syntax highlighting to source code snippets embedded in HTML pages for better readability.
- [Syntax Highlighters](https://awesome-repositories.com/f/user-interface-experience/syntax-highlighters.md) — Applies syntax highlighting to source code snippets embedded in HTML pages via CSS styling.
- [CSS Class-Based](https://awesome-repositories.com/f/user-interface-experience/syntax-highlighters/css-class-based.md) — Maps identified syntax tokens to predefined CSS classes to separate highlighting logic from visual presentation.
- [Custom Highlight Rules](https://awesome-repositories.com/f/user-interface-experience/syntax-highlighters/custom-highlight-rules.md) — Allows the creation of specialized syntax highlighting rules for proprietary or uncommon programming languages.
- [Syntax Highlighting Styles](https://awesome-repositories.com/f/user-interface-experience/syntax-highlighting-styles.md) — Defines the visual appearance of highlighted code elements by applying specific CSS classes to marked-up text. ([source](https://github.com/googlearchive/code-prettify#readme))
- [Compatible Stylesheets](https://awesome-repositories.com/f/user-interface-experience/syntax-highlighters/compatible-stylesheets.md) — Integrates external CSS stylesheets to define specific colors, fonts, and print appearances for highlighted code. ([source](https://github.com/googlearchive/code-prettify/blob/master/docs/getting_started.md))

### Part of an Awesome List

- [Language Support](https://awesome-repositories.com/f/awesome-lists/devtools/language-support.md) — Enables the addition of custom lexers to provide syntax highlighting for languages not supported by default. ([source](https://github.com/googlearchive/code-prettify#readme))

### Development Tools & Productivity

- [Regex-Based Colorizers](https://awesome-repositories.com/f/development-tools-productivity/regular-expressions/regex-based-colorizers.md) — Uses regular expression patterns to identify language tokens and wrap them in HTML spans for styling.

### Programming Languages & Runtimes

- [Regular Expression Lexer Libraries](https://awesome-repositories.com/f/programming-languages-runtimes/regular-expression-lexer-libraries.md) — Provides a system for defining language-specific rules to highlight syntax using regular expression patterns.

### Software Engineering & Architecture

- [Pluggable Lexer Architectures](https://awesome-repositories.com/f/software-engineering-architecture/pluggable-lexer-architectures.md) — Provides a pluggable architecture for adding new language definitions via custom tokenization rules.

### Web Development

- [Client-Side Code Formatters](https://awesome-repositories.com/f/web-development/client-side-code-formatters.md) — Functions as a browser-based tool that adds line numbers and visual formatting to raw code blocks.
- [Code Formatting](https://awesome-repositories.com/f/web-development/code-formatting.md) — Organizes and numbers lines of code within web pages to help users follow complex scripts.

### Content Management & Publishing

- [Technical Documentation Styling](https://awesome-repositories.com/f/content-management-publishing/technical-documentation-styling.md) — Improves the visual presentation of code examples in guides and manuals using customizable CSS themes.

### Operating Systems & Systems Programming

- [Code Line Numbering](https://awesome-repositories.com/f/operating-systems-systems-programming/terminal-command-line-environments/terminal-interface-systems/terminal-output-management/code-line-numbering.md) — Calculates line breaks in source text to insert sequential numbering at the start of each code block.
