Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] In browser markdown editor alternative #922

Open
frank-zsy opened this issue Nov 14, 2024 · 2 comments
Open

[Feature] In browser markdown editor alternative #922

frank-zsy opened this issue Nov 14, 2024 · 2 comments

Comments

@frank-zsy
Copy link
Contributor

frank-zsy commented Nov 14, 2024

Actually I think StackEdit may not be the best option we got. Because StackEdit requires a web server to host the service, so we need to use https://stackedit.io/app# as our editor and open it in an iframe. This makes it really hard to customize the editor in many ways, like auto scrolling or customize renderer.

This is an alternative called https://www.npmjs.com/package/@uiw/react-md-editor , which is local npm package without any web server dependency. As the open source component makes it possible to customize the editor as we need. I think we can investigate whether we can use this one instead of StackEdit.

Originally posted by @frank-zsy in #921 (comment)

@wangyantong2000 wangyantong2000 changed the title In browser markdown editor alternative [Feature]In browser markdown editor alternative Nov 14, 2024
@wangyantong2000 wangyantong2000 changed the title [Feature]In browser markdown editor alternative [Feature] In browser markdown editor alternative Nov 14, 2024
@frank-zsy
Copy link
Contributor Author

I looked into the react-md-editor package, it could be good replacement of StackEdit.

Because the component allows lots of customization by props. The most important one is modify the renderer of images.

Like for KaiwuDB docs, the images are ../../../images/xxx.png which is a relative path in the repository, but they will not show in markdown editor. And for Docusaurus sites like OpenDigger docs, the images are @site/static/xxx.png which will also not show in markdown editor.

So in this component, we can inject the renderer by customize the components/preview option.

@wangyantong2000 Could you try the component for experiment?

@wangyantong2000
Copy link
Collaborator

OK. I will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants