Prism を使ってみる(1)

HTML

<!DOCTYPE html>
<html>
<head>
  ...
  <link href="themes/prism.css" rel="stylesheet" />
</head>
<body>
  ...
  <script src="prism.js"></script>
</body>
</html>

CSS

p { color: red }

JavaScript

var Prism = require('prismjs');

// The code snippet you want to highlight, as a string
var code = "var data = 1;";

// Returns a highlighted HTML string
var html = Prism.highlight(code, Prism.languages.javascript);

Git

git checkout name-of-the-correct-branch
# grab the last commit to master
git cherry-pick master
# delete it from master
git checkout master
git reset HEAD~ --hard