1.0.11 • Published 19 days ago

@tryghost/kg-lexical-html-renderer v1.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
19 days ago

Koenig Lexical Html Renderer

Renders a lexical editor state string to a HTML string.

This library differs from Lexical's own lexical-html package in a few ways:

  1. it's output target is not an editor but rendered web pages or emails which means the handling of nodes (especially custom DecoratorNodes) will differ to the node's built-in editor-focused rendering
  2. render output will vary based on supplied options and targets, e.g. when rendering for email the output may use <table> elements in place of modern HTML structure
  3. it's primary usage environment is server-side

Install

npm install @tryghost/kg-lexical-html-renderer --save

or

yarn add @tryghost/kg-lexical-html-renderer

Usage

Basic usage:

const LexicalHTMLRenderer = require('@tryghost/kg-lexical-html-renderer');
const renderer = new Renderer();

const lexicalState = '{...}';
const html = await renderer.render(lexicalState);

Options can be passed in as the second argument to .render().

const html = await renderer.render(lexicalState, {target: 'email'});
OptionValues
target'html' (default), 'email'

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo. 1. git clone this repo & cd into it as usual 2. Run yarn to install top-level dependencies.

Test

  • yarn lint run just eslint
  • yarn test run lint and tests

Running in Ghost Admin

In order to run local changes, perform the following: 1. Run yarn link within kg-lexical-html-renderer 2. Run yarn link @tryghost/kg-lexical-html-renderer within ghost/core

kg-default-nodes must also be linked when linking this package as they are codependencies.

Copyright & License

Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.

1.0.11

19 days ago

1.0.10

21 days ago

1.0.9

3 months ago

1.0.8

3 months ago

1.0.7

3 months ago

1.0.6

4 months ago

1.0.5

4 months ago

1.0.4

4 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.3

5 months ago

1.0.0

5 months ago

0.3.51

5 months ago

0.3.0

10 months ago

0.3.6

10 months ago

0.3.5

10 months ago

0.3.8

9 months ago

0.3.7

9 months ago

0.3.2

10 months ago

0.3.1

10 months ago

0.3.4

10 months ago

0.3.3

10 months ago

0.3.50

6 months ago

0.3.42

7 months ago

0.3.41

7 months ago

0.3.40

7 months ago

0.3.49

6 months ago

0.3.48

6 months ago

0.3.47

6 months ago

0.3.46

6 months ago

0.3.45

6 months ago

0.3.44

6 months ago

0.3.43

6 months ago

0.3.31

7 months ago

0.3.30

8 months ago

0.3.39

7 months ago

0.3.38

7 months ago

0.3.37

7 months ago

0.3.36

7 months ago

0.3.35

7 months ago

0.3.34

7 months ago

0.3.33

7 months ago

0.3.32

7 months ago

0.3.29

8 months ago

0.3.20

9 months ago

0.3.28

8 months ago

0.3.27

8 months ago

0.3.26

8 months ago

0.3.25

8 months ago

0.3.24

8 months ago

0.3.23

8 months ago

0.3.22

8 months ago

0.3.21

8 months ago

0.3.19

9 months ago

0.3.18

9 months ago

0.3.9

9 months ago

0.3.17

9 months ago

0.3.16

9 months ago

0.3.15

9 months ago

0.3.14

9 months ago

0.3.13

9 months ago

0.3.12

9 months ago

0.3.11

9 months ago

0.3.10

9 months ago

0.2.4

10 months ago

0.2.3

10 months ago

0.2.2

11 months ago

0.1.56

11 months ago

0.1.57

11 months ago

0.1.58

11 months ago

0.1.59

11 months ago

0.1.63

11 months ago

0.1.64

11 months ago

0.1.65

11 months ago

0.1.66

11 months ago

0.1.60

11 months ago

0.1.61

11 months ago

0.1.62

11 months ago

0.2.1

11 months ago

0.2.0

11 months ago

0.1.52

11 months ago

0.1.53

11 months ago

0.1.54

11 months ago

0.1.55

11 months ago

0.1.50

11 months ago

0.1.51

11 months ago

0.1.49

11 months ago

0.1.41

12 months ago

0.1.42

12 months ago

0.1.43

11 months ago

0.1.44

11 months ago

0.1.45

11 months ago

0.1.46

11 months ago

0.1.47

11 months ago

0.1.48

11 months ago

0.1.40

12 months ago

0.1.38

12 months ago

0.1.39

12 months ago

0.1.35

1 year ago

0.1.37

12 months ago

0.1.30

1 year ago

0.1.31

1 year ago

0.1.32

1 year ago

0.1.33

1 year ago

0.1.34

1 year ago

0.1.27

1 year ago

0.1.28

1 year ago

0.1.29

1 year ago

0.1.11

1 year ago

0.1.12

1 year ago

0.1.13

1 year ago

0.1.14

1 year ago

0.1.15

1 year ago

0.1.20

1 year ago

0.1.21

1 year ago

0.1.22

1 year ago

0.1.23

1 year ago

0.1.24

1 year ago

0.1.25

1 year ago

0.1.26

1 year ago

0.1.16

1 year ago

0.1.18

1 year ago

0.1.19

1 year ago

0.1.10

1 year ago

0.1.8

1 year ago

0.1.9

1 year ago

0.1.2

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.0.14

1 year ago

0.1.0

1 year ago

0.1.1

1 year ago

0.0.15

1 year ago

0.0.10

2 years ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago