Building minified version:
git clone --depth=1 https://github.com/PhilipTrauner/pygments-github-css cd pygments-github-css yarn install
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/PhilipTrauner/pygments-github-css@master/github.css" />
Pygments tokens do not map to GitHub tokens cleanly. Certain compromises had to be made to obtain a mapping that closely matches the look of GitHub's highlighter.
Actions: ✓ Apply style | ✗ Do not apply style
||Dot (.) is not treated as an operator||Dot (.) is treated as an operator||✗ (because all dots would be colored incorrectly)|
||Differentiates between builtin functions and types (completely inconsistent)||Does not differentiate||✓|
||Differentiates between builtin decorators and regular names||Does not differentiate||✓ (regular decorator style)|
|Optional arguments||Differentiates between regular arguments and optional arguments||Does not differentiate||✗|
||Namespace imports are ignored||Namespace imports are not ignored||✓|
||Treated as constants||Special case||✓|
||Functions are treated as names in some languages||Functions and variables are names||✗|
||Treated differently depending on language (C++: colored, Rust: uncolored, XML: multi-colored, ...)||Treated equally||✓|
||Frequently treated as text (LaTeX, ...)||Treated specially||✗|
||"index..." is interpreted as regular text||"index..." is still part of header||✓|
||File list is interpreted as regular text||File list is still part of subheading||✓|
Tokens that I could not find instances of on GitHub:
Generic.Emph: Marks the token value as emphasized.
Generic.Error: Marks the token value as an error message.
Generic.Output: Marks the token value as program output.
Generic.Prompt: Marks the token value as command prompt.
Error: Lexer error
If you happen to come across a piece of code that contains one of these tokens feel free to create an issue or open up a pull request. Make sure to denote the file extension!