Skip to content

Streamlit component that allows you to use Meta's Lexical rich text editor

License

Notifications You must be signed in to change notification settings

musubi-labs/streamlit_lexical

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

streamlit_lexical

Streamlit component that allows you to use Meta's Lexical as a rich text plugin.

Installation instructions

pip install streamlit-lexical

Usage instructions

import streamlit as st

from streamlit_lexical import streamlit_lexical

markdown = streamlit_lexical(value="initial value in **markdown**",
                             placeholder="Enter some rich text", 
                             height=800,
                             debounce=500,
                             key='1234', 
                             on_change=None
                            )


st.markdown(rich_text_dict)

Development instructions

After cloning the github repo...

In init.py, set:

RELEASE = False

And you can test out the example.py with your changes by doing the following:

cd streamlit_lexical/frontend
npm install (or yarn install)
npm run start # Start the Webpack dev server

Then, in a separate terminal, run:

pip install -e .
streamlit run example.py

Further, to build the package (after making changes/adding features), you can install it locally like:

cd streamlit_lexical/frontend
npm install (or yarn install)
npm run build
cd ../..
pip install -e ./

Make sure the init.py file RELEASE is set to True in this case.

About

Streamlit component that allows you to use Meta's Lexical rich text editor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published