Skip to content

About

RTL Support plugin for LearnHarness — makes Persian, Arabic and Hebrew lessons readable.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

RTL Support for LearnHarness

A community plugin for LearnHarness. It makes lessons readable in Persian, Arabic and Hebrew.

LearnHarness renders lesson prose left to right. A Persian, Arabic or Hebrew sentence mixed with English words, numbers or punctuation scrambles. This plugin is a temporary workaround until the fix lands in LearnHarness itself (upstream PRs #968 and #1051, issue #758).

Unofficial. Not affiliated with LearnHarness, and not endorsed by it.

What it does

Prose blocks that contain RTL script get dir="auto", so a Persian paragraph reads right to left and an English paragraph in the same chat stays left to right. Code fences, inline code, KaTeX math and numbers stay left to right.

The whole session pane gets dir="rtl" by default: the top bar, the transcript, the question and practice docks and the composer. The sidebar, settings dialogs, home and graph stay as they are.

If something looks broken, turn full-chat RTL off in the plugin settings. Prose-only mode stays on.

Install

Requires LearnHarness 0.6.0 or later. No build step.

  1. Download rtl-support.zip from the latest release: Download rtl-support.zip (latest release). The link always points to the newest release. The release page is at https://github.com/emadn87-dev/learnharness-rtl-plugin/releases/latest if you want to check it first.

  2. Unzip the file and copy the rtl-support folder into your LearnHarness plugins folder. The folder path is shown in LearnHarness under Settings, Community plugins. On Windows it is:

    C:\Users\<you>\AppData\Roaming\LearnHarness\data\plugins\
    

    When you are done, this file must exist:

    .../plugins/rtl-support/dist/manifest.json
    

    The folder name must be exactly rtl-support. It has to match the plugin id.

  3. In LearnHarness, go to Settings, Community plugins, press Refresh, and enable RTL Support. Then quit LearnHarness completely and open it again.

  4. Open a teaching session in Persian, Arabic or Hebrew. The chat, the questions and the writing box should now read right to left, while code and math stay left to right.

If a passage still renders wrong, use the Apply RTL Support action in the session top bar or sidebar.

Install from source

git clone https://github.com/emadn87-dev/learnharness-rtl-plugin.git "<plugins-directory>/rtl-support"

Then follow steps 3 and 4 above.

Uninstall

Disable the plugin in Settings, Community plugins, then delete the rtl-support folder from the plugins directory.

How it works

No build step, no model calls, no network calls, no file reads.

  • dist/manifest.json is the plugin manifest (API v1).
  • dist/main.js uses a MutationObserver. It sets dir="auto" on RTL prose blocks, forces code and math back to dir="ltr", and sets dir="rtl" on the session pane.
  • dist/styles.css sets unicode-bidi: plaintext for paragraphs, plus manual fixes for things dir alone does not flip: the user-message rail, the session title and the option rows.

One localStorage key, rtl-support:full-chat, remembers the full-chat toggle.

License

MIT. See LICENSE.

About

RTL Support plugin for LearnHarness — makes Persian, Arabic and Hebrew lessons readable.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors