feat(v2): add ability default lang for code blocks (#1910)

* feat(v2): add ability default lang for code blocks

* Add support for CodeBlock

* changelog

* more changelog

* Add checks

* docs

* docs

* Fix changelog

* revert config

* Update theme-classic.md

* Update packages/docusaurus-theme-classic/src/theme/CodeBlock/index.js

Co-Authored-By: Endi <endiliey@gmail.com>
This commit is contained in:
Alexey Pyltsyn 2019-11-05 10:36:22 +03:00 committed by GitHub
parent 3b9309fa87
commit c507028cb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 64 additions and 10 deletions

View file

@ -201,7 +201,7 @@ Use the matching language meta string for your code block, and Docusaurus will p
console.log('Every repo must come with a mascot.');
```
By default, the Prism [syntax highlighting theme](https://github.com/FormidableLabs/prism-react-renderer#theming) we use is [Palenight](https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/themes/palenight.js). You can change this to another theme by passing `prismTheme` as `themeConfig` in your docusaurus.config.js.
By default, the Prism [syntax highlighting theme](https://github.com/FormidableLabs/prism-react-renderer#theming) we use is [Palenight](https://github.com/FormidableLabs/prism-react-renderer/blob/master/src/themes/palenight.js). You can change this to another theme by passing `theme` field in `prism` as `themeConfig` in your docusaurus.config.js.
For example, if you prefer to use the `dracula` highlighting theme:
@ -209,7 +209,9 @@ For example, if you prefer to use the `dracula` highlighting theme:
// docusaurus.config.js
module.exports = {
themeConfig: {
prismTheme: require('prism-react-renderer/themes/dracula'),
prism: {
theme: require('prism-react-renderer/themes/dracula'),
},
},
};
```