Skip to content

oliveryasuna/code-block

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

<code-block>

A web component using Prism.

Getting Started

Without any attributes, the language will default to clike and theme to prism.

<code-block></code-block>

<script>
    document.querySelector('code-block').code = `function print(msg) {
  console.log(msg);
}

print('Hello, World!');`;
</script>

You can specify the language and theme with the language and theme attributes, respectively.

<code-block language="java" theme="prism-tomorrow"></code-block>

If you want to remove the theme's background graphics, use the plain attribute.

<code-block plain></code-block>

License

This code is under the BSD 3-Clause.

Sponsoring

If you like my work and want to support it, please consider sponsoring me. It's how I make the time to code great things!

About

A web component using Prism.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published