How to use highlightjs-solidity - 1 common examples

To help you get started, we’ve selected a few highlightjs-solidity examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hackjutsu / Lepton / app / containers / codeArea / index.js View on Github external
import '../../utilities/vendor/prism/prism.scss'
import './jupyterNotebook.scss'
import './markdown.scss'

const logger = remote.getGlobal('logger')
const conf = remote.getGlobal('conf')

// resolve syntax highlight style based on app theme
if (conf.get('theme') === 'dark') {
  require('../../utilities/vendor/highlightJS/styles/atom-one-dark.css')
} else {
  require('../../utilities/vendor/highlightJS/styles/github-gist.css')
}

hljsDefineSolidity(HighlightJS) // register solidity to hightlight.js

export default class CodeArea extends Component {
  createJupyterNotebookCodeBlock (content, language, kTabLength) {
    try {
      const notebook = nb.parse(JSON.parse(content))
      const notebookHtml = notebook.render().outerHTML
      return `<div class="jupyterNotebook-section">${notebookHtml}</div>`
    } catch (err) {
      logger.error(`Failed to render Jupyter Notebook content with err ${err}`)
      return this.createHighlightedCodeBlock(content, language, kTabLength)
    }
  }

  createMarkdownCodeBlock (content) {
    return `<div class="markdown-section">${Markdown.render(content)}</div>`
  }

highlightjs-solidity

highlight.js syntax definition for Ethereum's Solidity language

MIT
Latest version published 2 years ago

Package Health Score

51 / 100
Full package analysis

Popular highlightjs-solidity functions