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

Is it possible to only support certain markdown (i.e. remove buttons from the text editor) #124

Closed
matt-dalton opened this issue Jul 15, 2020 · 2 comments

Comments

@matt-dalton
Copy link

matt-dalton commented Jul 15, 2020

I've tried changing the MARTOR_ENABLE_CONFIGS from the Readme, but this doesn't seem to actually remove the option from the editor. e.g. Even with emoji and imgur as false I can still press the buttons here:

Screenshot 2020-07-15 at 12 31 57

It would be good to be able to support certain types of markdown (e.g. h1, h1, p, bold, italics) and have the others removed from the options. This would make it much clearer to people using the widget what markdown they can expect to be rendered.

Does anything like this exist?

@agusmakmun
Copy link
Owner

agusmakmun commented Jul 16, 2020

thank you @matt-dalton for your great idea 👍
It already added on newest version v1.5.0, you can now install it by following:

pip install martor==1.5.0

then in your settings.py:

# To show the toolbar buttons
MARTOR_TOOLBAR_BUTTONS = [
    'bold', 'italic', 'horizontal', 'heading', 'pre-code',
    'blockquote', 'unordered-list', 'ordered-list',
    'link', 'image-link', 'image-upload', 'emoji',
    'direct-mention', 'toggle-maximize', 'help'
]

to remove all toolbar buttons, you can easily use the empty list:

MARTOR_TOOLBAR_BUTTONS = []

@matt-dalton
Copy link
Author

Wow....very fast work!

Thanks!

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

No branches or pull requests

2 participants