From b06d1fe67fd140d477ce9967d388fe7c7d751e70 Mon Sep 17 00:00:00 2001 From: Jeroen Akkerman Date: Wed, 11 Nov 2020 22:40:51 +0100 Subject: [PATCH] Add documentation and typings --- CHANGELOG.md | 3 +++ README.md | 1 + types/easymde-test.ts | 2 ++ types/easymde.d.ts | 1 + 4 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e71dd9..0e2beb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added - CodeMirror autorefresh plugin and autoRefresh option (Thanks to [@mbolli], [#249]). +- `lineNumbers` option to display line numbers in the editor (Thanks to [@nhymxu], [#267]). ### Fixed - CSS scoping issues when the editor is used in combination with other CodeMirror instances ([#252]). @@ -195,6 +196,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown [#9]: https://github.com/Ionaru/easy-markdown-editor/issues/9 +[#267]: https://github.com/Ionaru/easy-markdown-editor/pull/267 [#249]: https://github.com/Ionaru/easy-markdown-editor/pull/249 [#244]: https://github.com/Ionaru/easy-markdown-editor/pull/244 [#235]: https://github.com/Ionaru/easy-markdown-editor/pull/235 @@ -229,6 +231,7 @@ Project forked from [SimpleMDE](https://github.com/sparksuite/simplemde-markdown [#19]: https://github.com/Ionaru/easy-markdown-editor/pull/19 +[@nhymxu]: https://github.com/nhymxu [@mbolli]: https://github.com/mbolli [@ivictbor]: https://github.com/ivictbor [@JoshuaLicense]: https://github.com/JoshuaLicense diff --git a/README.md b/README.md index 0322477..232e2dc 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,7 @@ easyMDE.value('New input for **EasyMDE**'); - image - link - table +- **lineNumbers**: If set to `true`, enables line numbers in the editor. - **lineWrapping**: If set to `false`, disable line wrapping. Defaults to `true`. - **minHeight**: Sets the minimum height for the composition area, before it starts auto-growing. Should be a string containing a valid CSS value like `"500px"`. Defaults to `"300px"`. - **maxHeight**: Sets fixed height for the composition area. `minHeight` option will be ignored. Should be a string containing a valid CSS value like `"500px"`. Defaults to `undefined`. diff --git a/types/easymde-test.ts b/types/easymde-test.ts index cda8c1f..4750c4d 100644 --- a/types/easymde-test.ts +++ b/types/easymde-test.ts @@ -169,6 +169,7 @@ const editorImagesCustom = new EasyMDE({ new EasyMDE({ sideBySideFullscreen: true, + lineNumbers: false, autosave: { enabled: true, delay: 2000, @@ -186,6 +187,7 @@ new EasyMDE({ new EasyMDE({ sideBySideFullscreen: false, + lineNumbers: true, maxHeight: '500px', toolbar: [ 'bold', diff --git a/types/easymde.d.ts b/types/easymde.d.ts index 7edb44a..8963537 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -176,6 +176,7 @@ declare namespace EasyMDE { indentWithTabs?: boolean; initialValue?: string; insertTexts?: InsertTextOptions; + lineNumbers?: boolean; lineWrapping?: boolean; minHeight?: string; maxHeight?: string;