معاينة Markdown بتنسيق RTL أنيق لـ VS Code مع كشف العربية تلقائياً
Beautiful right-to-left Markdown preview for VS Code with automatic Arabic detection
- ✨ كشف تلقائي للغة العربية — يفعّل RTL لمّا يلقى نص عربي
- 🎨 تنسيق أنيق وحديث — ألوان مريحة للقراءة في الثيم الداكن والفاتح
- 📝 الأكواد LTR دائماً — الكود البرمجي يظل من اليسار لليمين كما يجب
- 🔤 خطوط احترافية — IBM Plex Sans Arabic للعربي و JetBrains Mono للكود
- 🎯 3 أوضاع تشغيل — تلقائي / دائماً / أبداً
- ⚙️ قابلة للتخصيص — تحكّم بنسبة الكشف وضوابط أخرى
- 🌓 تحترم ثيم VS Code — تتكيف مع الداكن والفاتح
- 📱 متجاوبة — تشتغل على شاشات بأحجام مختلفة
نزّل آخر إصدار من Releases، ثم:
code --install-extension md-rtl-preview-0.1.1.vsixأو من داخل VS Code:
- اضغط
Ctrl+Shift+P(أوCmd+Shift+Pعلى Mac) - اكتب
Extensions: Install from VSIX... - اختر الملف اللي نزّلته
- أعد تحميل النافذة (
Developer: Reload Window)
git clone https://github.com/ikhd/md-rtl-preview.git
cd md-rtl-preview
npm install -g @vscode/vsce
vsce package
code --install-extension md-rtl-preview-*.vsixافتح أي ملف .md واضغط:
Ctrl+Shift+V— معاينة في تبويب جديدCtrl+K V— معاينة جنب المحرر
الإضافة تشتغل تلقائياً — لو الملف فيه عربي بنسبة كافية، يصير RTL.
افتح إعدادات VS Code (Ctrl+,) وابحث عن mdRtlPreview:
| الإعداد | النوع | الافتراضي | الوصف |
|---|---|---|---|
mdRtlPreview.mode |
string |
auto |
وضع التفعيل: auto / always / never |
mdRtlPreview.arabicThreshold |
number |
0.15 |
نسبة الحروف العربية لتفعيل RTL تلقائياً (15%) |
{
"mdRtlPreview.mode": "auto",
"mdRtlPreview.arabicThreshold": 0.2
}- عند فتح معاينة Markdown، يُحقن
auto-rtl.jsفي الصفحة - السكربت يحسب نسبة الحروف العربية (
U+0600–U+06FF) مقابل اللاتينية - بلوكات الكود تُستثنى من الحساب
- لو النسبة تجاوزت الحد، يضيف
dir="rtl"على body مع classmd-rtl-active - ملف
rtl-preview.cssيطبّق التنسيقات على هذا الـ class
- ✨ Auto-detect Arabic content — RTL activates when Arabic text is found
- 🎨 Modern, elegant styling — eye-friendly colors for dark & light themes
- 📝 Code blocks stay LTR — code remains left-to-right as it should
- 🔤 Beautiful typography — IBM Plex Sans Arabic + JetBrains Mono
- 🎯 3 modes — auto / always / never
- ⚙️ Configurable — adjust detection threshold and behavior
- 🌓 Theme-aware — adapts to your VS Code theme
Download the latest release from Releases:
code --install-extension md-rtl-preview-0.1.1.vsixgit clone https://github.com/ikhd/md-rtl-preview.git
cd md-rtl-preview
npm install -g @vscode/vsce
vsce package
code --install-extension md-rtl-preview-*.vsixOpen any .md file and press Ctrl+Shift+V (or Cmd+Shift+V on Mac).
The extension automatically activates RTL when Arabic content is detected.
| Setting | Type | Default | Description |
|---|---|---|---|
mdRtlPreview.mode |
string |
auto |
Activation mode: auto / always / never |
mdRtlPreview.arabicThreshold |
number |
0.15 |
Min Arabic ratio to trigger auto-RTL |
- When Markdown preview opens,
auto-rtl.jsis injected into the page - The script counts Arabic characters (
U+0600–U+06FF) vs Latin - Code blocks are excluded from the calculation
- If ratio exceeds threshold,
dir="rtl"andmd-rtl-activeclass are added rtl-preview.cssapplies styling based on this class
git clone https://github.com/ikhd/md-rtl-preview.git
cd md-rtl-preview
# Open in VS Code
code .
# Press F5 to launch Extension Development Host
# Then open a .md file in the new window to testmd-rtl-preview/
├── .github/workflows/ # GitHub Actions (auto-release)
├── docs/ # Demo files
├── images/ # Icon and screenshots
├── scripts/
│ └── auto-rtl.js # Auto-detection script
├── styles/
│ └── rtl-preview.css # All styling
├── package.json # Extension manifest
├── CHANGELOG.md # Version history
├── LICENSE # MIT
└── README.md # This file
Pull requests are welcome! For major changes, please open an issue first to discuss.
- Fork the project
- Create your feature branch (
git checkout -b feature/cool-thing) - Commit your changes (
git commit -m 'Add cool thing') - Push to the branch (
git push origin feature/cool-thing) - Open a Pull Request
See CHANGELOG.md for the version history.
MIT © Khalid
If you like this extension, please consider giving it a star ⭐ — it helps a lot!
صُنع بـ ❤️ للمجتمع العربي
Made with ❤️ for the Arabic community