better-codeblock
v1.0.5
Published
<!-- README for NPM; the one for GitHub is in .github directory. -->
Downloads
9
Readme
Example
Docs
Class Codeblock
code(content)
Set the content of the code block
| Param | Type | | --- | --- | | content | string |
Example
new Codeblock(Language.JAVASCRIPT)
.code('console.log("Hello, world!")')
...
importCode(url)
Import the content of the code block
| Param | Type | Description | | --- | --- | --- | | url | string | URL or path to the file. If using path, must use absolute path. |
applyTheme(name)
Apply the theme from default prism themes. See: https://github.com/PrismJS/prism/tree/master/themes
| Param | Type | | --- | --- | | name | string |
Example
prism-coy.css -> "coy"
applyOriginalTheme(url)
Create your own using based on the default themes. See: https://github.com/PrismJS/prism/tree/master/themes
| Param | Type | | --- | --- | | url | string |
save(writeStream)
Save the code block.
| Param | Type | | --- | --- | | writeStream | WriteStream |