Skip to content

Commit

Permalink
[docs] refactor react docs syntax highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
addyosmani committed May 13, 2020
1 parent eaa87ac commit ba5984d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions site/src/_includes/components/react.njk
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
### Installation

First, install the packages with [node](https://nodejs.org) and [npm](https://npmjs.com):
{% endmarkdownConvert %}

```sh
{% highlight "bash" %}
npm install quicklink webpack-route-manifest --save-dev
```
{% endhighlight %}

{% markdownConvert %}
Then, configure Webpack route manifest into your project, as explained [here](https://github.com/lukeed/webpack-route-manifest).
This will generate a map of routes and chunks called `rmanifest.json`. It can be obtained at:

Expand All @@ -23,8 +25,9 @@ Import `quicklink` React HOC where want to add prefetching functionality.
Wrap your routes with the `withQuicklink()` HOC.

Example:
{% endmarkdownConvert %}

```sh
{% highlight "js" %}
import { withQuicklink } from 'quicklink/dist/react/hoc.js';

const options = {
Expand All @@ -37,8 +40,7 @@ const options = {
<Route path="/blog/:title" component={withQuicklink(Article, options)} />
<Route path="/about" exact component={withQuicklink(About, options)} />
</Suspense>
```
{% endhighlight %}

{% endmarkdownConvert %}
{% endblock %}

0 comments on commit ba5984d

Please sign in to comment.