Skip to content
Close

Code Highlighting

Sharing code on your website or blog? Use code highlighting to display the proper syntax

pwr-icon-theme-settings
Set your languages
Choose from over 150 programming languages that you'd like to use syntax highlighting for, chose a color scheme and options.
pwr-icon_feature-mega-menu
Highlight Code
Add the pre and code tags to highlight code added to any Rich Text editors throughout the theme.
pwr-icon_rocket
CODE AWAY
That's it, now you can add as much code to your website that you want to share!

EXAMPLES

Code can be added inline or in blocks depending on the tags added. There's also an option to add a copy button that displays in the upper right when you hover over the code blocks.

Some text with code amet consetetur lorem ipsum dolor sit amet consetetur lorem ipsum dolor sit amet consetetur amet consetetur lorem ipsum dolor sit amet consetetur lorem ipsum dolor sit amet consetetur  document.querySelector('a').addClass("abc"); in it lorem ipsum dolor sit amet consetetur lorem ipsum dolor sit amet consetetur lorem ipsum dolor sit amet consetetur amet consetetur lorem ipsum dolor sit amet consetetur lorem ipsum dolor sit amet consetetur amet consetetur lorem ipsum dolor sit amet consetetur lorem ipsum dolor sit amet consetetur

JS

document.fonts.ready.then(function () {
  document.querySelectorAll('.vanilla .pwr-js-masonry__container').forEach((e) => e.iso ? e.iso.layout() : null);
  pwr.aos.refresh();
});  


Inline HTML

<div width='100px'>Test</div>


CSS

.pwr-adc {
    width: 100%;
    display: block;
    overflow: hidden;
}
.pwr-adc--border-top:before {
    background-color: rgba(var(--clr-base-dk-rgb), .1);
    content: "";
    height: 1px;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 1;
}


Python

# Sum of natural numbers up to num

num = 16

if num < 0:
   print("Enter a positive number")
else:
   sum = 0
   # use while loop to iterate until zero
   while(num > 0):
       sum += num
       num -= 1
   print("The sum is", sum)


JSON

{
    "global": false,
    "smart_type": "NOT_SMART",
    "icon": "../../images/icons/module/icon-module-sec-map.svg",
    "host_template_types": [
        "PAGE",
        "BLOG_POST",
        "BLOG_LISTING"
    ],
    "label": "POWER Sec Map",
    "is_available_for_new_content": true
}


Objective C

#import 

int main(int argc, const char * argv[]) {
    @autoreleasepool {
        // insert code here...
        NSLog(@"Hello, World!");
    }
    return 0;
}

WHAT PROGRAMMING LANGUAGE WILL YOU HIGHLIGHT?

As long as you don't say profanity, it's probably included - there are over 150 languages to choose from.