README/CHANGELOG: Format in prettier

Formatted with prettier 2.3.0
This commit is contained in:
Tony Narlock 2021-05-16 14:03:23 -05:00
parent 2738046886
commit fef1e16907
2 changed files with 121 additions and 102 deletions

View File

@ -1,164 +1,163 @@
Changelog # Changelog
=========
## [27.1.3](https://github.com/isaul32/ckeditor5-math/compare/v27.1.2...27.1.3) (2021-05-16) ## [27.1.3](https://github.com/isaul32/ckeditor5-math/compare/v27.1.2...27.1.3) (2021-05-16)
* #41: Prevent inserting empty equations, thank you @Jules-Bertholet. - #41: Prevent inserting empty equations, thank you @Jules-Bertholet.
## [27.1.2](https://github.com/isaul32/ckeditor5-math/compare/v27.1.1...v27.1.2) (2021-03-29) ## [27.1.2](https://github.com/isaul32/ckeditor5-math/compare/v27.1.1...v27.1.2) (2021-03-29)
* #38: You can now boot into a development instance with `yarn start` (supports - #38: You can now boot into a development instance with `yarn start` (supports
live reload) live reload)
* #40 (fixed #39): Support for upcasting Quill style tags - #40 (fixed #39): Support for upcasting Quill style tags
## [27.1.1](https://github.com/isaul32/ckeditor5-math/compare/v27.1.0...v27.1.1) (2021-03-29) ## [27.1.1](https://github.com/isaul32/ckeditor5-math/compare/v27.1.0...v27.1.1) (2021-03-29)
* Update dependencies for CKEditor 27.1.0 ([Release - Update dependencies for CKEditor 27.1.0 ([Release
notes](https://github.com/ckeditor/ckeditor5/releases/tag/v27.1.0)) notes](https://github.com/ckeditor/ckeditor5/releases/tag/v27.1.0))
## [27.1.0](https://github.com/isaul32/ckeditor5-math/compare/v27.0.1...v27.1.0) (2021-03-29) ## [27.1.0](https://github.com/isaul32/ckeditor5-math/compare/v27.0.1...v27.1.0) (2021-03-29)
* #33: New optional config variables: `previewClassName` and `popupClassName` as an array - #33: New optional config variables: `previewClassName` and `popupClassName` as an array
of classes, this makes it easier to style the preview: of classes, this makes it easier to style the preview:
```javascript ```javascript
{ {
"math": { "math": {
"popupClassName": ["myeditor"], "popupClassName": ["myeditor"],
"previewClassName": ["myeditor"] "previewClassName": ["myeditor"]
} }
} }
``` ```
This assures the preview appended to `document.body` and the popup both are This assures the preview appended to `document.body` and the popup both are
accessible via `.myeditor`. accessible via `.myeditor`.
## [27.0.1](https://github.com/isaul32/ckeditor5-math/compare/v27.0.0...v27.0.1) (2021-03-29) ## [27.0.1](https://github.com/isaul32/ckeditor5-math/compare/v27.0.0...v27.0.1) (2021-03-29)
* Typo fix from #32. - Typo fix from #32.
## [27.0.0](https://github.com/isaul32/ckeditor5-math/compare/v26.0.0...v27.0.0) (2021-03-29) ## [27.0.0](https://github.com/isaul32/ckeditor5-math/compare/v26.0.0...v27.0.0) (2021-03-29)
* Update dependencies. - Update dependencies.
## [26.0.0](https://github.com/isaul32/ckeditor5-math/compare/v25.0.0...v26.0.0) (2021-03-04) ## [26.0.0](https://github.com/isaul32/ckeditor5-math/compare/v25.0.0...v26.0.0) (2021-03-04)
* Update dependencies. - Update dependencies.
## [25.0.0](https://github.com/isaul32/ckeditor5-math/compare/v24.0.1...v25.0.0) (2021-03-02) ## [25.0.0](https://github.com/isaul32/ckeditor5-math/compare/v24.0.1...v25.0.0) (2021-03-02)
* Update dependencies. - Update dependencies.
## [24.0.1](https://github.com/isaul32/ckeditor5-math/compare/24.0.0...v24.0.1) (2021-02-28) ## [24.0.1](https://github.com/isaul32/ckeditor5-math/compare/24.0.0...v24.0.1) (2021-02-28)
* Fix balloon view position. - Fix balloon view position.
## [24.0.0](https://github.com/isaul32/ckeditor5-math/compare/v23.3.0...24.0.0) (2020-12-12) ## [24.0.0](https://github.com/isaul32/ckeditor5-math/compare/v23.3.0...24.0.0) (2020-12-12)
* Update dependencies. - Update dependencies.
## [23.3.0](https://github.com/isaul32/ckeditor5-math/compare/23.2.2...v23.3.0) (2020-11-07) ## [23.3.0](https://github.com/isaul32/ckeditor5-math/compare/23.2.2...v23.3.0) (2020-11-07)
* Add autoformat support. ([3354872](https://github.com/isaul32/ckeditor5-math/commit/3354872)) - Add autoformat support. ([3354872](https://github.com/isaul32/ckeditor5-math/commit/3354872))
## [23.2.2](https://github.com/isaul32/ckeditor5-math/compare/v23.2.1...23.2.2) (2020-11-03) ## [23.2.2](https://github.com/isaul32/ckeditor5-math/compare/v23.2.1...23.2.2) (2020-11-03)
* Fix placeholder handling. ([dc288ea](https://github.com/isaul32/ckeditor5-math/commit/dc288ea)) - Fix placeholder handling. ([dc288ea](https://github.com/isaul32/ckeditor5-math/commit/dc288ea))
* Fix selection after entering inline expression. ([2fea2e2](https://github.com/isaul32/ckeditor5-math/commit/2fea2e2)) - Fix selection after entering inline expression. ([2fea2e2](https://github.com/isaul32/ckeditor5-math/commit/2fea2e2))
## [23.2.1](https://github.com/isaul32/ckeditor5-math/compare/v23.2.0...v23.2.1) (2020-10-18) ## [23.2.1](https://github.com/isaul32/ckeditor5-math/compare/v23.2.0...v23.2.1) (2020-10-18)
* Fix math editing button for balloon editor. ([3629401](https://github.com/isaul32/ckeditor5-math/commit/3629401)) - Fix math editing button for balloon editor. ([3629401](https://github.com/isaul32/ckeditor5-math/commit/3629401))
## [23.2.0](https://github.com/isaul32/ckeditor5-math/compare/v23.1.0...v23.2.0) (2020-10-18) ## [23.2.0](https://github.com/isaul32/ckeditor5-math/compare/v23.1.0...v23.2.0) (2020-10-18)
* Add math editing button for balloon editor. ([aa0392c](https://github.com/isaul32/ckeditor5-math/commit/aa0392c)) - Add math editing button for balloon editor. ([aa0392c](https://github.com/isaul32/ckeditor5-math/commit/aa0392c))
## [23.1.0](https://github.com/isaul32/ckeditor5-math/compare/v23.0.0...v23.1.0) (2020-10-11) ## [23.1.0](https://github.com/isaul32/ckeditor5-math/compare/v23.0.0...v23.1.0) (2020-10-11)
* Add typesetting auto load feature. ([a665b64](https://github.com/isaul32/ckeditor5-math/commit/a665b64)) - Add typesetting auto load feature. ([a665b64](https://github.com/isaul32/ckeditor5-math/commit/a665b64))
## [23.0.0](https://github.com/isaul32/ckeditor5-math/compare/v22.0.0...v23.0.0) (2020-10-02) ## [23.0.0](https://github.com/isaul32/ckeditor5-math/compare/v22.0.0...v23.0.0) (2020-10-02)
* Update dependencies. - Update dependencies.
## [22.0.0](https://github.com/isaul32/ckeditor5-math/compare/v21.0.0...v22.0.0) (2020-08-29) ## [22.0.0](https://github.com/isaul32/ckeditor5-math/compare/v21.0.0...v22.0.0) (2020-08-29)
* Seperate schema to display and inline. - Seperate schema to display and inline.
### Bug fixes ### Bug fixes
* Fix writer. ([7d0cd01](https://github.com/isaul32/ckeditor5-math/commit/7d0cd01)) - Fix writer. ([7d0cd01](https://github.com/isaul32/ckeditor5-math/commit/7d0cd01))
### Other changes ### Other changes
* Update dependencies. - Update dependencies.
## [21.0.0](https://github.com/isaul32/ckeditor5-math/compare/v20.0.0...v21.0.0) (2020-08-03) ## [21.0.0](https://github.com/isaul32/ckeditor5-math/compare/v20.0.0...v21.0.0) (2020-08-03)
* Update dependencies. - Update dependencies.
## [20.0.0](https://github.com/isaul32/ckeditor5-math/compare/v19.0.0...v20.0.0) (2020-07-13) ## [20.0.0](https://github.com/isaul32/ckeditor5-math/compare/v19.0.0...v20.0.0) (2020-07-13)
* Update dependencies. - Update dependencies.
## [19.0.0](https://github.com/isaul32/ckeditor5-math/compare/v18.0.1...v19.0.0) (2020-05-12) ## [19.0.0](https://github.com/isaul32/ckeditor5-math/compare/v18.0.1...v19.0.0) (2020-05-12)
* Update dependencies. - Update dependencies.
## [18.0.1](https://github.com/isaul32/ckeditor5-math/compare/v18.0.0...v18.0.1) (2020-04-05) ## [18.0.1](https://github.com/isaul32/ckeditor5-math/compare/v18.0.0...v18.0.1) (2020-04-05)
### Bug fixes ### Bug fixes
* Fix spacebar before formula bug in Firefox. [isaul32/ckeditor5-math#2](https://github.com/isaul32/ckeditor5-math/issues/2). ([9d15010](https://github.com/isaul32/ckeditor5-math/commit/9d15010)) - Fix spacebar before formula bug in Firefox. [isaul32/ckeditor5-math#2](https://github.com/isaul32/ckeditor5-math/issues/2). ([9d15010](https://github.com/isaul32/ckeditor5-math/commit/9d15010))
## [18.0.0](https://github.com/isaul32/ckeditor5-math/compare/v17.0.1...v18.0.0) (2020-03-30) ## [18.0.0](https://github.com/isaul32/ckeditor5-math/compare/v17.0.1...v18.0.0) (2020-03-30)
* Update dependencies. - Update dependencies.
## [17.0.1](https://github.com/isaul32/ckeditor5-math/compare/v17.0.0...v17.0.1) (2020-02-27) ## [17.0.1](https://github.com/isaul32/ckeditor5-math/compare/v17.0.0...v17.0.1) (2020-02-27)
### Bug fixes ### Bug fixes
* Fix missing dependencies. - Fix missing dependencies.
## [17.0.0](https://github.com/isaul32/ckeditor5-math/compare/v1.0.3...v17.0.0) (2020-02-27) ## [17.0.0](https://github.com/isaul32/ckeditor5-math/compare/v1.0.3...v17.0.0) (2020-02-27)
### Bug fixes ### Bug fixes
* Fix dependencies resolving problem. Closes [isaul32/ckeditor5-math#1](https://github.com/isaul32/ckeditor5-math/issues/1). ([7d40a2c](https://github.com/isaul32/ckeditor5-math/commit/7d40a2c)) - Fix dependencies resolving problem. Closes [isaul32/ckeditor5-math#1](https://github.com/isaul32/ckeditor5-math/issues/1). ([7d40a2c](https://github.com/isaul32/ckeditor5-math/commit/7d40a2c))
## [1.0.3](https://github.com/isaul32/ckeditor5-math/compare/v1.0.2...v1.0.3) (2019-10-11) ## [1.0.3](https://github.com/isaul32/ckeditor5-math/compare/v1.0.2...v1.0.3) (2019-10-11)
### Bug fixes ### Bug fixes
* Fix preview flickering effect. ([70fefa8](https://github.com/isaul32/ckeditor5-math/commit/70fefa8)) - Fix preview flickering effect. ([70fefa8](https://github.com/isaul32/ckeditor5-math/commit/70fefa8))
* Fix disabled eslint lines. ([1f96286](https://github.com/isaul32/ckeditor5-math/commit/1f96286)) - Fix disabled eslint lines. ([1f96286](https://github.com/isaul32/ckeditor5-math/commit/1f96286))
### Other changes ### Other changes
* Update some tests. - Update some tests.
* Update readme. - Update readme.
## [1.0.2](https://github.com/isaul32/ckeditor5-math/compare/v1.0.1...v1.0.2) (2019-10-07) ## [1.0.2](https://github.com/isaul32/ckeditor5-math/compare/v1.0.1...v1.0.2) (2019-10-07)
### Other changes ### Other changes
* Update readme. - Update readme.
* Add unique identifier for math preview. ([8b6804c](https://github.com/isaul32/ckeditor5-math/commit/98815fc)) - Add unique identifier for math preview. ([8b6804c](https://github.com/isaul32/ckeditor5-math/commit/98815fc))
## [1.0.1](https://github.com/isaul32/ckeditor5-math/compare/v1.0.0...v1.0.1) (2019-10-04) ## [1.0.1](https://github.com/isaul32/ckeditor5-math/compare/v1.0.0...v1.0.1) (2019-10-04)
### Bug fixes ### Bug fixes
* Fix preview rendering bug. ([070f84e](https://github.com/isaul32/ckeditor5-math/commit/070f84e)) - Fix preview rendering bug. ([070f84e](https://github.com/isaul32/ckeditor5-math/commit/070f84e))
### Other changes ### Other changes
* Remove paste from office dependency. ([8b6804c](https://github.com/isaul32/ckeditor5-math/commit/8b6804c)) - Remove paste from office dependency. ([8b6804c](https://github.com/isaul32/ckeditor5-math/commit/8b6804c))
## [1.0.0](https://github.com/isaul32/ckeditor5-math/compare/v1.0.0...v1.0.0) (2019-10-03) ## [1.0.0](https://github.com/isaul32/ckeditor5-math/compare/v1.0.0...v1.0.0) (2019-10-03)

122
README.md
View File

@ -2,59 +2,66 @@
ckeditor5-math is a TeX-based mathematical plugin for CKEditor 5. You can use it to insert, edit, and view mathematical equations and formulas. This plugin supports [MathJax], [KaTeX] and custom typesetting engines. ckeditor5-math is a TeX-based mathematical plugin for CKEditor 5. You can use it to insert, edit, and view mathematical equations and formulas. This plugin supports [MathJax], [KaTeX] and custom typesetting engines.
[MathJax]: https://www.mathjax.org/ [mathjax]: https://www.mathjax.org/
[KaTeX]: https://katex.org/ [katex]: https://katex.org/
## Table of contents ## Table of contents
- [Features](#features)
- [Demos](#demos) - [Features](#features)
- [Screenshots](#screenshots) - [Demos](#demos)
- [Requirements](#requirements) - [Screenshots](#screenshots)
- [Examples](#examples) - [Requirements](#requirements)
- [Installation](#installation) - [Examples](#examples)
* [Styles for Lark theme](#styles-for-lark-theme) - [Installation](#installation)
- [Configuration & Usage](#configuration--usage) - [Styles for Lark theme](#styles-for-lark-theme)
* [Plugin options](#plugin-options) - [Configuration & Usage](#configuration--usage)
* [Available typesetting engines](#available-typesetting-engines) - [Plugin options](#plugin-options)
* [Supported input and output formats](#supported-input-and-output-formats) - [Available typesetting engines](#available-typesetting-engines)
- [Paste support](#paste-support) - [Supported input and output formats](#supported-input-and-output-formats)
* [From plain text](#from-plain-text) - [Paste support](#paste-support)
- [Autoformat support](#autoformat-support) - [From plain text](#from-plain-text)
- [Preview workaround](#preview-workaround) - [Autoformat support](#autoformat-support)
- [Preview workaround](#preview-workaround)
## Features ## Features
- TeX syntax
- Inline and display equations - TeX syntax
- Preview view - Inline and display equations
- Multiple typesetting engines - Preview view
- Have multiple input and output format - Multiple typesetting engines
- Paste support - Have multiple input and output format
- from plain text - Paste support
- Autoformat support - from plain text
- Autoformat support
# Demos # Demos
- [Classic editor with MathJax](https://jsfiddle.net/isaul32/qktj9h7x/)
- [Classic editor with KaTex](https://jsfiddle.net/isaul32/3wjrkLdv/) - [Classic editor with MathJax](https://jsfiddle.net/isaul32/qktj9h7x/)
- [Balloon block editor with KaTex](https://jsfiddle.net/isaul32/q01mu8kp/) - [Classic editor with KaTex](https://jsfiddle.net/isaul32/3wjrkLdv/)
- [Balloon block editor with KaTex](https://jsfiddle.net/isaul32/q01mu8kp/)
## Screenshots ## Screenshots
![Screenshot 1](/screenshots/1.png?raw=true "Screenshot 1") ![Screenshot 1](/screenshots/1.png?raw=true "Screenshot 1")
![Screenshot 2](/screenshots/2.png?raw=true "Screenshot 2") ![Screenshot 2](/screenshots/2.png?raw=true "Screenshot 2")
## Requirements ## Requirements
- Use same major version as your CKEditor 5 build - Use same major version as your CKEditor 5 build
If you get duplicated modules error, you have mismatching versions. If you get duplicated modules error, you have mismatching versions.
## Examples ## Examples
[Link to examples repository](https://github.com/isaul32/ckeditor5-math-examples) [Link to examples repository](https://github.com/isaul32/ckeditor5-math-examples)
## Installation ## Installation
Use official classic or inline build as a base: Use official classic or inline build as a base:
- [CKEditor 5 classic editor build](https://github.com/ckeditor/ckeditor5-build-classic)
- [CKEditor 5 inline editor build](https://github.com/ckeditor/ckeditor5-build-inline) - [CKEditor 5 classic editor build](https://github.com/ckeditor/ckeditor5-build-classic)
- [CKEditor 5 inline editor build](https://github.com/ckeditor/ckeditor5-build-inline)
Install plugin with NPM or Yarn Install plugin with NPM or Yarn
@ -77,7 +84,7 @@ InlineEditor.builtinPlugins = [
]; ];
``` ```
__Add math button to toolbar__ **Add math button to toolbar**
```js ```js
InlineEditor.defaultConfig = { InlineEditor.defaultConfig = {
@ -89,12 +96,15 @@ InlineEditor.defaultConfig = {
} }
}; };
``` ```
### Styles for Lark theme ### Styles for Lark theme
__Copy theme/ckeditor5-math folder__ from [https://github.com/isaul32/ckeditor5/tree/master/packages/ckeditor5-theme-lark](https://github.com/isaul32/ckeditor5/tree/master/packages/ckeditor5-theme-lark) to your lark theme repository
**Copy theme/ckeditor5-math folder** from [https://github.com/isaul32/ckeditor5/tree/master/packages/ckeditor5-theme-lark](https://github.com/isaul32/ckeditor5/tree/master/packages/ckeditor5-theme-lark) to your lark theme repository
## Configuration & Usage ## Configuration & Usage
### Plugin options ### Plugin options
```js ```js
InlineEditor.defaultConfig = { InlineEditor.defaultConfig = {
// ... // ...
@ -111,20 +121,24 @@ InlineEditor.defaultConfig = {
``` ```
### Available typesetting engines ### Available typesetting engines
__MathJax__
- Tested with __latest 2.7__ **MathJax**
- Has experimental (__CHTML__, __SVG__) support for __3.0.0__ or newer version
- Tested with **latest 2.7**
- Has experimental (**CHTML**, **SVG**) support for **3.0.0** or newer version
[<img src="https://www.mathjax.org/badge/badge-square.svg" width="130" alt="KaTeX">](https://www.mathjax.org/) [<img src="https://www.mathjax.org/badge/badge-square.svg" width="130" alt="KaTeX">](https://www.mathjax.org/)
__KaTeX__ **KaTeX**
- Tested with version __0.12.0__
- Tested with version **0.12.0**
[<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/) [<img src="https://katex.org/img/katex-logo-black.svg" width="130" alt="KaTeX">](https://katex.org/)
__Custom typesetting__ **Custom typesetting**
Custom typesetting is possible to implement with engine config. For example, custom typesetting feature can be used when use back end rendering. Custom typesetting is possible to implement with engine config. For example, custom typesetting feature can be used when use back end rendering.
```js ```js
InlineEditor.defaultConfig = { InlineEditor.defaultConfig = {
// ... // ...
@ -135,14 +149,16 @@ InlineEditor.defaultConfig = {
} }
} }
``` ```
- __equation__ is equation in TeX format without delimiters.
- __element__ is DOM element reserved for rendering.
- __display__ is boolean. Typesetting should be inline when false.
- __preview__ is boolean. Rendering in preview when true.
- **equation** is equation in TeX format without delimiters.
- **element** is DOM element reserved for rendering.
- **display** is boolean. Typesetting should be inline when false.
- **preview** is boolean. Rendering in preview when true.
### Supported input and output formats ### Supported input and output formats
Supported input and output formats are: Supported input and output formats are:
```html ```html
<!-- MathJax style http://docs.mathjax.org/en/v2.7-latest/advanced/model.html#how-mathematics-is-stored-in-the-page --> <!-- MathJax style http://docs.mathjax.org/en/v2.7-latest/advanced/model.html#how-mathematics-is-stored-in-the-page -->
<script type="math/tex">\sqrt{\frac{a}{b}}</script> <script type="math/tex">\sqrt{\frac{a}{b}}</script>
@ -156,7 +172,8 @@ Supported input and output formats are:
### Paste support ### Paste support
#### From plain text #### From plain text
Paste TeX equations with __delimiters__. For example:
Paste TeX equations with **delimiters**. For example:
```latex ```latex
\[ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} \] \[ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} \]
@ -171,9 +188,11 @@ or
### Autoformat support ### Autoformat support
#### Inline mode #### Inline mode
Ctrl+M can be used to add easily math formulas in inline mode. Ctrl+M can be used to add easily math formulas in inline mode.
#### Display mode #### Display mode
Autoformat for math can be used to add formula in display mode on a new line by adding `\[` or `$$`. This feature requires additional autoformat plugin to be added. Autoformat for math can be used to add formula in display mode on a new line by adding `\[` or `$$`. This feature requires additional autoformat plugin to be added.
Add following lines into your build Add following lines into your build
@ -189,13 +208,14 @@ InlineEditor.builtinPlugins = [
``` ```
## Preview workaround ## Preview workaround
`.ck-reset_all *` css rules from ckeditor5-ui and ckeditor5-theme-lark break rendering in preview mode. `.ck-reset_all *` css rules from ckeditor5-ui and ckeditor5-theme-lark break rendering in preview mode.
My solution for this is use rendering element outside of CKEditor DOM and place it to right place by using absolute position. Alternative solution could be using iframe, but then typesetting engine's scripts and styles have to copy to child document. My solution for this is use rendering element outside of CKEditor DOM and place it to right place by using absolute position. Alternative solution could be using iframe, but then typesetting engine's scripts and styles have to copy to child document.
## Development ## Development
Contributions, improvements and bug fixes are welcome. To aid in this, try out Contributions, improvements and bug fixes are welcome. To aid in this, try out
our developer environment w/ live reload support and [CKEditor 5 inspector]. our developer environment w/ live reload support and [CKEditor 5 inspector].
![Development environment](/screenshots/development-environment.png?raw=true "Screenshot of ![Development environment](/screenshots/development-environment.png?raw=true "Screenshot of
@ -203,10 +223,10 @@ development environment")
To enter a development loop with hot reload support: To enter a development loop with hot reload support:
- `git clone https://github.com/isaul32/ckeditor5-math.git` - `git clone https://github.com/isaul32/ckeditor5-math.git`
- `cd ckeditor5-math` - `cd ckeditor5-math`
- `yarn` - `yarn`
- `yarn start` - `yarn start`
- http://localhost:8080 - http://localhost:8080
[CKEditor 5 inspector]: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/development-tools.html#ckeditor-5-inspector [ckeditor 5 inspector]: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/development-tools.html#ckeditor-5-inspector