humhub-prosemirror icon indicating copy to clipboard operation
humhub-prosemirror copied to clipboard

RTL support

Open rezaervani opened this issue 4 years ago • 5 comments

I read here : https://github.com/humhub/humhub-prosemirror/issues/12 that humhub add some features to prosemirror like plugin system. Is there any documentation of it ? Or if I have to refer to prosemirror documentation, on which part ?

I found that every single function of button in humhub-prosemirror-richeditor is separated into single plugin humhub/protected/vendor/npm-asset/humhub-prosemirror-richtext/src/editor/core/plugins

And at least there are two files in every plugin : index.js and schema.js - in some plugins I also found input-rules.js and menu.js

Let said, that I want to add RTL plugin to my humhub-prosemirror, what should I do ? I've tried compare this to the most simple example at prosemirror git, that is prosemirror-menu-master. But I still can't get the idea how humhub-prosemirror-richtext work

I am really interested to learn much more about this. Where should I start ?

Thank you,

rezaervani avatar Nov 18 '20 12:11 rezaervani

See https://discuss.prosemirror.net/t/does-prosemirror-support-rtl-languages-editing/1318 which suggests you probably just have to change your theme (or just add a simple css rule) for this. Can you test the direction style mentioned in this issue and let me know if this works. Maybe we could change the direction by language in v1.8.

buddh4 avatar Dec 03 '20 00:12 buddh4

Oh, just saw that you already answered in the mentioned issue, if you need help with applying the style let me know.

buddh4 avatar Dec 03 '20 00:12 buddh4

I leave this here just for me in order to implement rtl detection in the core:

  • https://www.php.net/manual/en/intlchar.chardirection.php
  • https://stackoverflow.com/questions/47118326/how-to-get-direction-of-a-language-by-its-local-code-rtl-or-ltr
  • https://rtlcss.com/learn/usage-guide/install/

buddh4 avatar Dec 03 '20 00:12 buddh4

Duplicate https://github.com/humhub/humhub-prosemirror/issues/22

buddh4 avatar Dec 03 '20 00:12 buddh4

Thank you, I've tried this for 2 weeks, and get some progress. But I have to split file humhub-editor.js into some files to make my learning more simple.

I'll inform if finally I can make it done

Thank you

rezaervani avatar Dec 03 '20 01:12 rezaervani