Skip to content

Conversation

@julioest
Copy link
Collaborator

@julioest julioest commented Dec 10, 2025

Implements a custom lightweight C++ syntax highlighter to replace highlight.js for consistent code styling.

Changes

  • Created cpp-highlight.js with comprehensive C++ language support
  • Added cpp-highlight.css for syntax highlighting styles
  • Integrated highlighter into the Antora UI bundle

Syntax Highlighting

  • Keywords: Blue, bold (e.g., const, if, class, template)
  • Strings: Dark red (#a31515) - handles raw strings, prefixes (L, u8, U)
  • Preprocessor: Purple (#6f008a) - #include, #define, etc.
  • Comments: Green (#008000), italic (C++ and C-style)
  • Identifiers: Default black (function names, variables, etc.)

Features

  • Supports C++20 features (concepts, coroutines, modules)
  • Handles raw string literals with delimiters
  • Processes multi-line preprocessor directives
  • Correctly identifies preprocessor at line start only

Fixes issue with inconsistent C++ syntax highlighting colors.

Related to boostorg/website-v2#2033

@cppalliance-bot
Copy link

cppalliance-bot commented Dec 10, 2025

An automated preview of the documentation is available at https://556.site-docs.prtest2.cppalliance.org/index.html

If more commits are pushed to the pull request, the docs will rebuild at the same URL.

2025-12-12 21:14:33 UTC

@julioest julioest force-pushed the add-cpp-highlight-js branch from 2c0eac5 to 6f27b24 Compare December 10, 2025 03:15
@julioest julioest linked an issue Dec 10, 2025 that may be closed by this pull request
@julioest julioest force-pushed the add-cpp-highlight-js branch from 6f27b24 to 9a7c9dd Compare December 10, 2025 22:05
@julioest julioest force-pushed the add-cpp-highlight-js branch 4 times, most recently from 81073e7 to 38e8482 Compare December 12, 2025 21:07
@julioest julioest merged commit 398b5a2 into boostorg:develop Dec 12, 2025
8 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stronk C++ syntax highlighting

2 participants