Skip to content

Commit

Permalink
write readme
Browse files Browse the repository at this point in the history
  • Loading branch information
pchorus committed Aug 17, 2019
1 parent b7d11ef commit 42f16d8
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,81 @@
# gridsome-remark-katex
Gridsome remark support for math equations using remark-math and katex.

## Install
- `yarn add gridsome-remark-katex`
- `npm install gridsome-remark-katex`

## Usage

In your `main.js` file, import the CSS for Katex:

```js
import 'katex/dist/katex.min.css'

export default function (Vue) {
// ...
}
```

In `gridsome.config.js`, add support for math equations to a single markdown source:

```js
module.exports = {
plugins: [
{
use: '@gridsome/source-filesystem',
options: {
path: 'blog/**/*.md',
route: '/blog/:year/:month/:day/:slug',
remark: {
plugins: [
'gridsome-remark-katex'
]
}
}
}
]
}
```

Or add support for math equations to all markdown sources:

```js
module.exports = {
plugins: [
{
use: '@gridsome/source-filesystem',
options: {}
}
],

transformers: {
remark: {
plugins: [
'gridsome-remark-katex'
]
}
}
}
```

You can also pass any option that is available in katex:

```js
module.exports = {
plugins: [
{
use: '@gridsome/source-filesystem',
options: {}
}
],

transformers: {
remark: {
plugins: [
['gridsome-remark-katex', { minRuleThickness: 0.1 }]
]
}
}
}
```

0 comments on commit 42f16d8

Please sign in to comment.