esm7 / obsidian-rtl

RTL support for Obsidian.md
MIT License
137 stars 11 forks source link
obsidian-plugin

Obsidian RTL Plugin

"Buy Me A Coffee"

This plugin extends the built-in RTL support of Obsidian by adding some extra features.

Starting version 1.6.x Obsidian offers pretty good RTL support, and this plugin adds the following features to it:

Usage

Install the plugin via Obsidian's "Third Party Plugins" pane.

When enabled, you will have a "Switch Text Direction" command (accessible via Ctrl/Cmd+P if you have the Command Palette plugin enabled). You can map this command to a hotkey: go to Obsidian's settings, click Hotkeys, search for "RTL" and set your preferred key combination.

Alternatively, you should see a text direction status bar item that will toggle the document direction when clicked.

Canvas Support

The plugin provides full direction support in the Canvas core plugin, with the following caveats:

Support the Development

If you want to support the development of this plugin, please consider to buy me a coffee.

Settings

Default text direction

This is the direction to use for files on which you have not set an explicit text direction.

'Auto' is Obsidian's default behavior, which decides on a per-line text direction according to its content.

Remember Text Direction Per File

When enabled (which is the default), when you change the text direction of a file it will be saved. Every time you open that note it will use the same text direction regardless of the default. This is useful, for example, if most of your notes are in English (so you want to keep the default LTR) but you have some notes in Arabic/Hebrew/Persian (Farsi) and you'd like to always edit them in RTL.

If you disable this setting, all notes will load in the default text direction.

If you want to forget the text direction of a file and go back to using the default, remove it from the map in VAULT_DIR/.obsidian/plugins/obsidian-rtl/data.json.

Front Matter Direction

It's also possible to specify the note direction using a front matter:

---
direction: rtl
---

The front matter direction overrides any other setting. It is possible to temporarily override a note's direction regardless of the front matter (e.g. to edit or view it differently), but the next time the note is loaded, the front matter direction will always be used.

Changelog

2.0.0

An overhaul of the plugin to build on top of Obsidian's new (1.6.x) RTL support, not interfere with it, and only add a few features on top.

Known issues:

1.2.2

Thanks @zoli for everything in this release!

Important note: as Obsidian is adding native auto direction support in version 1.6.0, the next major version of Obsidian RTL will remove a lot of plugin code and focus on improving some edges in Obsidian's native functionality. Therefore, this will be the last version to provide fixes/improvement that will soon be addressed natively in Obsidian.

1.2.1

1.2.0

1.1.2

Bug fixes:

1.1.1

Bug fixes:

1.1.0

Added full support for RTL, LTR and Auto direction in Canvas. See here for more details.

This required major changes to how the plugin works, and although I tried to test it extensively, I won't be surprised if some bugs crept in. Please report any issues!

Bug fixes:

1.0.0

With a lot of great help from @zoli, and following the support for this feature that was added in CodeMirror a few months ago, this version introduces dynamic & auto RTL-LTR!

AFAIK this mode works really well without any artifacts, no cursor problems or other issues, but there could definitely be some edge cases we didn't test.

Each note can now be set to LTR, RTL or Auto, and a default can be set in the plugin settings. And as always, the plugin remembers the setting per file.

Other improvements:

0.3.0

IMPORTANT: this version drops support for the legacy (CM5) Obsidian editor. If you are sticking to the legacy editor until Obsidian removes it, you cannot upgrade to this version of the plugin.

This release marks a major overhaul of the way this plugin works, fixing most known bugs in the process.

0.2.2

0.2.1

0.2.0

0.1.0

0.0.9

0.0.8

0.0.7

0.0.6

0.0.5

Export/print support for RTL: https://github.com/esm7/obsidian-rtl/issues/8

0.0.4

0.0.3

0.0.2