highlight code with highlight.js

This commit is contained in:
Nick Pegg 2017-09-24 21:44:11 -07:00
parent 5e7cfcf0cb
commit e26074d01f
3 changed files with 16 additions and 4 deletions

View file

@ -1,12 +1,13 @@
import React, { Component } from 'react';
import hljs from 'highlight.js';
import 'highlight.js/styles/github-gist.css';
import { Container, Row, Column } from './skeleton';
import { Header } from './Header';
import { Footer } from './Footer';
import { NavList, TagNav, HistoryNav } from './Nav';
import { Article } from './Article';
import { Footer } from './Footer';
import { Header } from './Header';
import { NavList, TagNav, HistoryNav } from './Nav';
class App extends Component {
@ -49,6 +50,11 @@ class App extends Component {
/>
];
}
componentDidMount() {
// Auto-highlight all <pre><code> blocks
hljs.initHighlightingOnLoad();
}
}
export default App;