Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SamChou19815 committed May 29, 2020
1 parent 906efcd commit 20ccbb9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions website/docs/markdown-features.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -538,26 +538,29 @@ module.exports = {
};
```

If you want to add highlighting for languages not yet supported by Prism, you can swizzle `prism-include-languages` by
If you want to add highlighting for languages not yet supported by Prism, you can swizzle `prism-include-languages`:

```bash
```bash npm2yarn
yarn swizzle @docusaurus/theme-classic prism-include-languages
```

It will produce `prism-include-languages.js` in your `src/theme` folder. You can add highlighting support for custom languages by editing `prism-include-languages.js`:

```js {6} title="src/theme/prism-include-languages.js"
```js {8} title="src/theme/prism-include-languages.js"
const prismIncludeLanguages = (Prism) => {
// ...
additionalLanguages.forEach((lang) => {
require(`prismjs/components/prism-${lang}`); // eslint-disable-line
});
require('/path/to/your/prism-language-definition');
// ...
}
```

You can refer to [PrismJS's official language definitions](https://github.com/PrismJS/prism/tree/master/components) when you are writing your own language definitions.
You can refer to [Prism's official language definitions](https://github.com/PrismJS/prism/tree/master/components) when you are writing your own language definitions.

### Line highlighting

Expand Down

0 comments on commit 20ccbb9

Please sign in to comment.