Get prism.js working

I can’t get work prism-js plugin for highlight code.

I added it to bower.json but it doesn’t work. The js and the css are correctly minified inside the mains files but simply it doesn’t work. You just can try it

Let me know

Strange, I have it working here

Notice that if I add the JS manually in the footer, it works… Could help?

You have to tell bower where to find the source files because the author didn’t set up the package properly:

Hi austin, I think I already did. This is my bower.json:

{
  "name": "sage",
  "homepage": "https://roots.io/sage/",
  "authors": [
    "Ben Word <ben@benword.com>"
  ],
  "license": "MIT",
  "private": true,
  "dependencies": {
    "modernizr": "2.8.2",
    "bootstrap-sass-official": "3.3.5",
    "font-awesome": "~4.3.0",
    "animate.less": "*",
    "prism": "*",
    "Blur.js": "*"
  },
  "overrides": {
    "modernizr": {
      "main": "./modernizr.js"
    },
    "bootstrap-sass-official": {
      "main": [
        "./assets/stylesheets/_bootstrap.scss",
        "./assets/javascripts/bootstrap/transition.js",
        "./assets/javascripts/bootstrap/alert.js",
        "./assets/javascripts/bootstrap/button.js",
        "./assets/javascripts/bootstrap/carousel.js",
        "./assets/javascripts/bootstrap/collapse.js",
        "./assets/javascripts/bootstrap/dropdown.js",
        "./assets/javascripts/bootstrap/modal.js",
        "./assets/javascripts/bootstrap/tooltip.js",
        "./assets/javascripts/bootstrap/popover.js",
        "./assets/javascripts/bootstrap/scrollspy.js",
        "./assets/javascripts/bootstrap/tab.js",
        "./assets/javascripts/bootstrap/affix.js",
        "./assets/fonts/bootstrap/glyphicons-halflings-regular.eot",
        "./assets/fonts/bootstrap/glyphicons-halflings-regular.svg",
        "./assets/fonts/bootstrap/glyphicons-halflings-regular.ttf",
        "./assets/fonts/bootstrap/glyphicons-halflings-regular.woff",
        "./assets/fonts/bootstrap/glyphicons-halflings-regular.woff2"
      ]
    },
    "font-awesome": {
      "main": [
        "./scss/font-awesome.scss",
        "./fonts/*"
      ]
    },
    "prism": {
      "main": [
        "./prism.js",
        "./themes/prism-okaidia.css"
      ]
    },
    "Blur.js": {
      "main": [
        "./blur.js"
      ]
    }

  }
}

Guys, I made a clean installation of WP+Sage+bower.json above, and Prism doesn’t work! But if I add manually in footer.php it works… :confused:

Solved, the problem was prism related. I didn’t load in bower.js the js component for each languages.

@greatcat could you throw the solution over at https://github.com/austinpray/asset-builder/wiki/User-Contributed-Examples#prismjs ?

Hey @austin, I added a solution for Prism at the above link; feel free to edit as necessary, but that worked for me with getting everything wired up as separate deps.