mirror of
https://gitee.com/docsifyjs/docsify.git
synced 2024-11-30 02:58:37 +08:00
update docs regarding configs as functions
This commit is contained in:
parent
732c34db55
commit
5a5b5aa932
@ -1,6 +1,6 @@
|
||||
# Configuration
|
||||
|
||||
You can configure the `window.$docsify`.
|
||||
You can configure Docsify by defining `window.$docsify` as an object:
|
||||
|
||||
```html
|
||||
<script>
|
||||
@ -12,6 +12,24 @@ You can configure the `window.$docsify`.
|
||||
</script>
|
||||
```
|
||||
|
||||
The config can also be defined as a function, in which case the first arg is the Docsify `vm` instance. The function should return a config object. This can be useful for referencing `vm` in places like the markdown configuration:
|
||||
|
||||
```html
|
||||
<script>
|
||||
window.$docsify = function(vm) {
|
||||
return {
|
||||
markdown: {
|
||||
renderer: {
|
||||
code(code, lang) {
|
||||
// ... use `vm` ...
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
## el
|
||||
|
||||
- Type: `String`
|
||||
|
Loading…
Reference in New Issue
Block a user