mirror of
https://github.com/zadam/trilium.git
synced 2025-11-13 18:08:56 +01:00
Add preview fix
This commit is contained in:
parent
2e94edf4f3
commit
e6605706c0
34
README.md
34
README.md
@ -34,12 +34,6 @@ InlineEditor.defaultConfig = {
|
|||||||
// ...
|
// ...
|
||||||
'math'
|
'math'
|
||||||
]
|
]
|
||||||
},
|
|
||||||
// ...
|
|
||||||
math: {
|
|
||||||
engine: 'mathjax',
|
|
||||||
outputType: 'script',
|
|
||||||
forceOutputType: false
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
```
|
```
|
||||||
@ -52,6 +46,19 @@ Styles requires PostCSS like offical CKEditor plugins.
|
|||||||
|
|
||||||
## Configuration & Usage
|
## Configuration & Usage
|
||||||
|
|
||||||
|
### Plugin options
|
||||||
|
```js
|
||||||
|
InlineEditor.defaultConfig = {
|
||||||
|
// ...
|
||||||
|
math: {
|
||||||
|
engine: 'mathjax', // or katex or function (equation, element, display) => { ... }
|
||||||
|
outputType: 'script', // or span or math
|
||||||
|
forceOutputType: false, // forces output to use outputType
|
||||||
|
enablePreview: true // Enable preview view
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Available typesetting engines
|
### Available typesetting engines
|
||||||
__MathJax__
|
__MathJax__
|
||||||
- Tested by using version __2.7.5__ and __TeX-MML-AM_HTMLorMML__ configuration. It has also experimental (__CHTML__, __SVG__) support for __3.0.0__ or newer version.
|
- Tested by using version __2.7.5__ and __TeX-MML-AM_HTMLorMML__ configuration. It has also experimental (__CHTML__, __SVG__) support for __3.0.0__ or newer version.
|
||||||
@ -67,7 +74,7 @@ It's possible to implement with engine config. For example, this feature can be
|
|||||||
InlineEditor.defaultConfig = {
|
InlineEditor.defaultConfig = {
|
||||||
// ...
|
// ...
|
||||||
math: {
|
math: {
|
||||||
engine: (equation, element, display) => {
|
engine: (equation, element, display, previewHack) => {
|
||||||
// ...
|
// ...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -76,20 +83,9 @@ InlineEditor.defaultConfig = {
|
|||||||
- __equation__ is equation in TeX format without delimiters.
|
- __equation__ is equation in TeX format without delimiters.
|
||||||
- __element__ is DOM element reserved for rendering.
|
- __element__ is DOM element reserved for rendering.
|
||||||
- __display__ is boolean. Typesetting should be inline when false.
|
- __display__ is boolean. Typesetting should be inline when false.
|
||||||
|
- __previewHack__ is boolean. Enable preview hack when true. It adds equation element to end of the body and use absolute position.
|
||||||
|
|
||||||
|
|
||||||
### Plugin options
|
|
||||||
```js
|
|
||||||
InlineEditor.defaultConfig = {
|
|
||||||
// ...
|
|
||||||
math: {
|
|
||||||
engine: 'mathjax', // or katex or function (equation, element, display) => { ... }
|
|
||||||
outputType: 'script', // or span or math
|
|
||||||
forceOutputType: false // forces output to use outputType
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### Supported input and output formats
|
### Supported input and output formats
|
||||||
Supported input and output formats are:
|
Supported input and output formats are:
|
||||||
```html
|
```html
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user