Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@

- Add latest changes here

## [41.2.2](https://github.com/isaul32/ckeditor5-math/compare/v41.2.1...v41.2.2) (2024-03-17)

- README updates ([#133](https://github.com/isaul32/ckeditor5-math/pull/133)):

- Note plugin supports DLL-based builds and is in TypeScript.
- Remove old TypeScript workaround sections.

- Chore: Typo fixes ([#133](https://github.com/isaul32/ckeditor5-math/pull/133))

## [41.2.1](https://github.com/isaul32/ckeditor5-math/compare/v41.2.0...v41.2.1) (2024-03-17)

- Rewritten in TypeScript, credit @fedemp
([#130](https://github.com/isaul32/ckeditor5-math/pull/130)).
- Rewritten in TypeScript, credit @fedemp
([#130](https://github.com/isaul32/ckeditor5-math/pull/130)).

## [41.2.0](https://github.com/isaul32/ckeditor5-math/compare/v41.1.0...v41.2.0) (2024-03-08)

Expand Down Expand Up @@ -419,7 +428,7 @@

## [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.
- Separate schema to display and inline.

### Bug fixes

Expand Down
65 changes: 15 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ckeditor5-math is a TeX-based mathematical plugin for CKEditor 5. You can use it

## Features

- Written in TypeScript (as of v41.2.1)
- DLL build support (as of v36.0.3)
- TeX syntax
- Inline and display equations
- Preview view
Expand Down Expand Up @@ -159,19 +161,19 @@ InlineEditor.defaultConfig = {

- `katexRenderOptions` - pass [options](https://katex.org/docs/options.html).

```js
InlineEditor.defaultConfig = {
// ...
math: {
engine: 'katex'
katexRenderOptions: {
macros: {
"\\neq": "\\mathrel{\\char`≠}",
},
},
}
}
```
```js
InlineEditor.defaultConfig = {
// ...
math: {
engine: 'katex'
katexRenderOptions: {
macros: {
"\\neq": "\\mathrel{\\char`≠}",
},
},
}
}
```

**Custom typesetting**

Expand Down Expand Up @@ -267,43 +269,6 @@ CKEditor5.editorInline.InlineEditorEditor

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.

## TypeScript users

ckeditor5-math does not have typings yet. TypeScript builds of CKEditor will see
this:

```sh
src/ckeditor.ts:63:18 - error TS7016: Could not find a declaration file for module '@isaul32/ckeditor5-math/src/math'.
'/path/to/your/project/node_modules/@isaul32/ckeditor5-math/src/math.js' implicitly has an 'any' type.

Try `npm i --save-dev @types/isaul32__ckeditor5-math` if it exists or add a new declaration (.d.ts) file containing
`declare module '@isaul32/ckeditor5-math/src/math';`
```

### Workaround for typings

1. Create a `d.ts` declaration file, e.g. `typings/ckeditor5-math.d.ts`

```typescript
declare module '@isaul32/ckeditor5-math';
declare module '@isaul32/ckeditor5-math/src/math';
declare module '@isaul32/ckeditor5-math/src/autoformatmath';
```
2. In your [`tsconfig.json`](https://www.typescriptlang.org/tsconfig)'s
root-level [`include`](https://www.typescriptlang.org/tsconfig#include)
option, make sure your declaration file is covered, e.g.

```json
{
"extends": "ckeditor5/tsconfig.json",
"include": [
"src",
"typings",
"../../typings"
]
}
```

## Development

Contributions, improvements and bug fixes are welcome. To aid in this, try out
Expand Down
2 changes: 1 addition & 1 deletion ckeditor5-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Math",
"className": "Math",
"description": "Adds mathematical formulars to the editor.",
"description": "Adds mathematical formulas to the editor.",
"path": "src/math.js",
"uiComponents": [
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@isaul32/ckeditor5-math",
"version": "41.2.1",
"version": "41.2.2",
"description": "Math feature for CKEditor 5.",
"keywords": [
"ckeditor",
Expand Down