Show code with syntax colors and a copy button.
Code Block shows code with syntax colors for 25 languages, line numbers, highlighted lines, a file name and a copy button. Choose a dark or light theme and change every color to match your site.
<?php
// Say hello to the visitor.
function bright_hello( $name ) {
return 'Hello, ' . esc_html( $name ) . '!';
}
echo bright_hello( 'world' );
Show the snippet readers need to paste, with a copy button.
Show config files with the file name in the top bar.
Use the Diff language to show added and removed lines.
A few steps from adding the widget to a finished result.
HTML and XML, CSS, SCSS, JavaScript, TypeScript, JSX, TSX, JSON, PHP, Python, Bash, SQL, YAML, Java, C, C++, C#, Go, Ruby, Rust, Diff, INI, Dockerfile, Nginx and Apache.
No. It is shown exactly as typed and never run.
Yes. Type the line numbers or ranges in Highlight Lines.
It is one of 48 widgets in the free Bright Addons plugin. Each widget loads its code only on pages that use it.