payanlintپایان‌لینت
GitHub

a linter for Persian .docx thesesلینتر برای پایان‌نامهٔ فارسی .docx · v0.1.0

Lint your thesis like code.پایان‌نامه را مثل کد لینت کنید.

payanlint reads a Persian .docx the way Word does. Layer one: the typing, such as half-space in «می‌شود» and «کتاب‌ها», Arabic ي ك hiding among ی ک, three digit sets, punctuation. Layer two: the formatting Word keeps in separate complex-script slots (font, size and bold of Persian text), margins per section, lettered front-matter pages, captions. Every finding shows the line as typed, as fixed, why, and where to click.پایان‌لینت فایل .docx فارسی را همان‌طور می‌خواند که ورد می‌خواند. لایهٔ اول: تایپ، یعنی نیم‌فاصله در «می‌شود» و «کتاب‌ها»، ي و ك عربیِ پنهان میان ی و ک فارسی، سه دستهٔ رقم، نقطه‌گذاری. لایهٔ دوم: قالب‌بندی‌ای که ورد در جایگاه‌های جدای «اسکریپت پیچیده» نگه می‌دارد (فونت، اندازه و بولد متن فارسی)، حاشیه به‌ازای هر بخش، صفحه‌های حرفی پیش‌گفتار، شمارهٔ شکل‌ها. هر یافته خط تایپ‌شده، خط اصلاح‌شده، دلیل و جای کلیک در ورد را نشان می‌دهد.

  • Python 3.9+
  • MIT
  • 0 deps
  • offline
  • 62 tests

Live · the real typing rulesزنده · قواعد تایپ واقعی

Type a Persian paragraph. The squiggles are P101 to P126.یک بند فارسی بنویسید. خط‌های موجی همان P101 تا P126 هستند.

The page runs a JavaScript port of payanlint's typing rules on whatever is in the box, offline in your browser. The formatting layer (fonts, margins, captions) needs a .docx and the command line.این صفحه نسخهٔ جاوااسکریپتی قواعد تایپ پایان‌لینت را روی متن داخل کادر اجرا می‌کند، آفلاین در مرورگر شما. لایهٔ قالب (فونت، حاشیه، عنوان‌ها) فایل .docx و خط فرمان می‌خواهد.

--digits

    Click a problem to jump to it; click the fix button to apply just that one. Vocalised Arabic text and non-Persian paragraphs are left alone, as in the real tool.روی یک مشکل کلیک کنید تا به آن بروید؛ روی دکمهٔ اصلاح بزنید تا فقط همان اعمال شود. متن اعرابی عربی و بندهای غیرفارسی مثل ابزار اصلی دست نمی‌خورند.

    Layer 2 · x-rayلایهٔ ۲ · اشعهٔ ایکس

    What you see is not what Word stored.آنچه می‌بینید همان نیست که ورد ذخیره کرده.

    نتایج نشان می‌دهد که روش پیشنهادی کارآمد است.

    14 pt · B Nazanin
    <w:rPr>
      <w:rFonts w:ascii="B Nazanin" w:cs=""/>
      <w:b/> <w:bCs/>
      <w:sz w:val="28"/> <w:szCs w:val="20"/>
    </w:rPr>

    Word keeps Persian font, size and bold in separate complex-script slots: w:cs, w:szCs, w:bCs. The page above looks perfect. Underneath, the Persian side has no font, a 10 pt size and no bold, so it renders in a fallback. python-docx's font.size only touches the Latin side, so scripts miss it too.ورد فونت، اندازه و بولد متن فارسی را در جایگاه‌های جدای اسکریپت پیچیده نگه می‌دارد: w:cs، w:szCs، w:bCs. صفحهٔ بالا بی‌نقص دیده می‌شود. زیرش سمت فارسی فونت ندارد، اندازه‌اش ۱۰ است و بولد نیست، پس با فونت جایگزین رندر می‌شود. font.size در python-docx فقط سمت لاتین را دست می‌زند، پس اسکریپت‌ها هم از آن می‌گذرند.

    what you seeآنچه می‌بینیدwhat Word storedآنچه ورد ذخیره کرده

    Rule indexفهرست قواعد

    Two layers, one report.دو لایه، یک گزارش.

    1. P101–P126

      Typing rulesقواعد تایپ

      Arabic ي ك ى, Arabic-Indic digits, می and نمی with a space, plural ها, tatweel, spaces around punctuation, straight quotes around Persian text (P101 to P126).ي ك ى عربی، رقم‌های عربی-هندی، «می» و «نمی» با فاصله، «ها»ی جمع، کشیده، فاصله‌های اطراف نشانه‌گذاری، گیومهٔ مستقیم دور متن فارسی (P101 تا P126).

    2. F201–F209

      Complex-script formattingقالب اسکریپت پیچیده

      Reads w:cs, w:szCs, w:bCs and w:lang bidi: Persian text without a Persian font, several fonts in the body, bold set for Latin only (F201 to F209).w:cs، w:szCs، w:bCs و w:lang bidi را می‌خواند: متن فارسی بی‌فونت فارسی، چند فونت در متن اصلی، بولدی که فقط برای لاتین است (F201 تا F209).

    3. F2xx · F3xx

      Layout against your numbersصفحه‌آرایی در برابر اعداد شما

      Line spacing, alignment, margins per section. You pass --body-font, --body-size, --line and --margins; no university table is shipped because none could be verified.فاصلهٔ خطوط، تراز، حاشیه به‌ازای هر بخش. --body-font و --body-size و --line و --margins را شما می‌دهید؛ جدول دانشگاهی همراهش نیست چون نتوانستم هیچ‌کدام را راستی‌آزمایی کنم.

    4. F303–F404

      Page numbers and headingsشمارهٔ صفحه و سرفصل‌ها

      PAGE field in footers, lettered front matter (arabicAbjad), body restarting at 1, skipped heading levels, empty headings (F303 to F404).فیلد PAGE در پانویس، پیش‌گفتار با شمارهٔ حرفی (arabicAbjad)، شروع دوبارهٔ متن از ۱، پرش سطح سرفصل و سرفصل خالی (F303 تا F404).

    5. F501–F505

      Captionsعنوان شکل و جدول

      Separators that differ (۲-۱ vs ۲.۱), typed digits against SEQ results, mixed label words, hand-typed captions (F501 to F505).جداکننده‌های ناهماهنگ (۲-۱ در برابر ۲.۱)، رقم تایپی در برابر نتیجهٔ SEQ، برچسب‌های ناهماهنگ، عنوان دست‌تایپ (F501 تا F505).

    6. --fix

      A fix that is a copyاصلاحی که یک نسخه است

      --fix edits characters inside w:t only, across run boundaries, never touches SEQ or PAGE results, keeps every other part byte-identical, then re-lints the copy.--fix فقط نویسه‌های داخل w:t را عوض می‌کند، از مرز run هم می‌گذرد، به نتیجهٔ SEQ و PAGE دست نمی‌زند، بقیهٔ فایل را بایت‌به‌بایت نگه می‌دارد و نسخه را دوباره لینت می‌کند.

    7. --json

      Scriptableقابل اسکریپت

      --json for machines, --strict to fail on warnings, --skip to leave categories alone. .txt and .md files get the typing rules only.--json برای ماشین، --strict برای شکست روی هشدار، --skip برای کنار گذاشتن دسته‌ها. فایل‌های .txt و .md فقط قواعد تایپ را می‌گیرند.

    Install & quick startنصب و شروع سریع

    Up and running in a minute.در یک دقیقه راه بیندازید.

    1. Install (Python 3.9+, no dependencies)نصب (پایتون ۳٫۹ به بالا، بدون وابستگی)

      pipx install git+https://github.com/mrzroot/payanlint
      # or run without installing:
      uvx --from git+https://github.com/mrzroot/payanlint payanlint --demo
    2. Lint with your university's numbersلینت با اعداد دانشگاه خودتان

      payanlint thesis.docx
      payanlint thesis.docx --body-font "B Nazanin" --body-size 14 --line 1.5 \
          --margins top=3.5,bottom=3,right=3.5,left=2.5
      payanlint thesis.docx --json     # or --strict for scripts
    3. Write a corrected copyنوشتن نسخهٔ اصلاح‌شده

      payanlint thesis.docx --fix --digits fa     # thesis.payanlint.docx
      payanlint thesis.docx --fix --skip zwnj,quotes

    Honest limitsمحدودیت‌های صادقانه

    What it does not do. Please read.چه کارهایی نمی‌کند. لطفاً بخوانید.

    • Heuristics, not an official validator. The typing rules follow common Persian orthography and are deliberately conservative, but can be wrong on proper nouns, quotations and technical terms (--skip exists for that). They do not check spelling or grammar. Your university's guide decides; payanlint does not ship a list of university rules.ابتکاری است، نه اعتبارسنج رسمی. قواعد تایپ از رسم‌الخط رایج فارسی پیروی می‌کنند و عمداً محتاط‌اند، اما روی اسم خاص، نقل‌قول و اصطلاح فنی ممکن است غلط باشند (--skip برای همین است). املا و دستور را نمی‌سنجد. راهنمای دانشگاه شما تصمیم می‌گیرد؛ پایان‌لینت فهرست قوانین دانشگاه‌ها را همراه ندارد.
    • I have not opened any output in Microsoft Word. I ran generated fixtures and rendered them in LibreOffice 25.2 on Linux. Behaviour in Word and Word for Mac is reasoned from the OOXML structure, not observed. Tested on Linux only.هیچ خروجی را در Microsoft Word باز نکرده‌ام. روی فایل‌های ساختگی اجرا و در LibreOffice 25.2 روی لینوکس رندر کرده‌ام. رفتار در Word و Word مک از ساختار OOXML استنباط شده، نه مشاهده. فقط روی لینوکس آزموده شده.
    • Fonts through themes, some style inheritance and unusual w:rFonts attributes are only partly handled. Text boxes, footnotes, endnotes, headers, comments, equations, content controls and tracked changes are not analysed; the report says what was skipped. A .doc must be saved as .docx first.فونتی که از تم می‌آید، بخشی از وراثت استایل و ویژگی‌های غیرمعمول w:rFonts فقط تا حدی پوشش داده شده‌اند. جعبه‌متن، پاورقی و پی‌نوشت، سرصفحه، نظرها، معادله، content control و تغییرات ردیابی‌شده بررسی نمی‌شوند؛ گزارش می‌گوید چه چیزی رد شده. فایل .doc را باید اول به .docx ذخیره کنید.
    • Caption rules assume the usual «شکل ۲-۱ : …» shape and Word's SEQ captions; captions in text boxes or hand-built lists of figures are out of scope. Whether Word shows the lettered page-number format depends on its language settings.قواعد عنوان‌ها شکل رایج «شکل ۲-۱ : …» و عنوان‌های SEQ ورد را فرض می‌کنند؛ عنوان داخل جعبه‌متن یا فهرست شکل دست‌ساز بیرون از دامنه است. اینکه ورد قالب حرفی شمارهٔ صفحه را نشان بدهد به تنظیمات زبان آن بستگی دارد.
    • Digit policy is a choice: by default only Arabic-Indic digits are fixed; Persian against Latin digits is reported (P103) and changed only with --digits. Fonts, sizes, margins and captions are never changed automatically.سیاست رقم یک انتخاب است: به‌طور پیش‌فرض فقط ارقام عربی-هندی اصلاح می‌شوند؛ رقم فارسی در برابر لاتین گزارش می‌شود (P103) و فقط با --digits عوض می‌شود. فونت، اندازه، حاشیه و عنوان هرگز خودکار تغییر نمی‌کنند.

    Novelty checkبررسی پیشینه

    Closest things, and the difference.نزدیک‌ترین‌ها و تفاوت‌شان.

    No existing tool found as of Oct 2026تا مهر ۱۴۰۵ (اکتبر ۲۰۲۶) ابزار مشابهی پیدا نشد that combines Persian typing rules with Word's real formatting properties (including the complex-script slots), caption and page-number checks, exit codes for scripts, and a --fix that edits only characters in text. The typing rules themselves are not new: Virastyar and others have had them for years. This is not a claim that none exists anywhere.که قواعد تایپ فارسی را با ویژگی‌های واقعی قالب ورد (از جمله جایگاه‌های اسکریپت پیچیده)، بررسی عنوان‌ها و شمارهٔ صفحه، کد خروج برای اسکریپت و یک --fix که فقط نویسه‌های متن را عوض می‌کند ترکیب کند. خود قواعد تایپ تازه نیستند: ویراستیار و دیگران سال‌هاست دارندشان. ادعا نمی‌کنم در هیچ جای دنیا وجود ندارد.

    This is the result of searching GitHub, PyPI, npm and the web on 24 Oct 2026, not a guarantee: search is incomplete, private tools are invisible to it, and this space changes weekly. If you know one, please open an issue and it will be linked here. Queries and results: NOVELTY.md in the repository.این نتیجهٔ جست‌وجو در گیت‌هاب، PyPI، npm و وب در ۲ آبان ۱۴۰۵ است، نه تضمین: جست‌وجو ناقص است، ابزارهای خصوصی دیده نمی‌شوند و این حوزه هر هفته عوض می‌شود. اگر ابزاری می‌شناسید یک issue باز کنید تا اینجا بیاید. عبارت‌های جست‌وجو و نتایج: فایل NOVELTY.md در مخزن.

    ToolابزارWhat it doesچه می‌کندHow it differsتفاوت
    VirastyarFree open-source Word add-in: spell checking, ک/ی, Arabic digits, half-space, punctuationافزونهٔ رایگان و متن‌باز ورد: غلط‌یاب، ک/ی، رقم عربی، نیم‌فاصله، نقطه‌گذاریOverlaps the typing rules. Interactive, needs Word on Windows; its own FAQ says development stopped. No fonts, margins, captions or page numbers.با قواعد تایپ هم‌پوشانی دارد. تعاملی است و ورد ویندوز می‌خواهد؛ پرسش‌های متداول خودش می‌گوید توسعه متوقف شده. فونت، حاشیه، عنوان و شمارهٔ صفحه ندارد.
    virastar-tanbelClosest: a .docx fixer for Persian (RTL, fa-IR, punctuation, ي/ك, LRM)نزدیک‌ترین: ترمیم‌گر .docx فارسی (راست‌به‌چپ، fa-IR، نقطه‌گذاری، ي/ك، LRM)Rewrites the file. I found no report-first mode, formatting rules or half-space rules in its README.فایل را بازنویسی می‌کند. در README آن حالت گزارش‌محور، قواعد قالب یا نیم‌فاصله ندیدم.
    Virastar · persian-normalize · hazmPersian text and NLP librariesکتابخانه‌های متن و پردازش زبان فارسیString in, string out; they do not read a .docx.رشته می‌گیرند و رشته می‌دهند؛ .docx نمی‌خوانند.
    Auctory thesis checkerBrowser .docx checker: margins, spacing, font, headings, page number; university presetsبررسی‌گر .docx در مرورگر: حاشیه، فاصله، فونت، سرفصل، شمارهٔ صفحه؛ پیش‌تنظیم دانشگاهGeneric, not Persian orthography; I found no mention of the complex-script slots. Reports only.عمومی است و رسم‌الخط فارسی ندارد؛ از جایگاه‌های اسکریپت پیچیده نشانه‌ای ندیدم. فقط گزارش می‌دهد.
    sasanvhn/Word-Document-Formatting-Checkerpython-docx script comparing fonts and spacing of Persian and English paragraphsاسکریپت python-docx که فونت و فاصلهٔ پاراگراف‌های فارسی و انگلیسی را مقایسه می‌کندReads python-docx font.size, which is the Latin slot, so Persian size and bold are not what it sees. No typing rules.font.size در python-docx را می‌خواند که جایگاه لاتین است، پس اندازه و بولد فارسی را نمی‌بیند. قواعد تایپ ندارد.
    sadeghr64/persian-docxAgent skill for producing Persian DOCX; documents the szCs and RTL pitfallsمهارت ایجنت برای تولید DOCX فارسی؛ تله‌های szCs و RTL را مستند کردهGeneration guidance, not a linter of an existing thesis.راهنمای تولید است، نه لینتر پایان‌نامهٔ موجود.

    FAQپرسش‌های متداول

    Questions people ask.پرسش‌هایی که می‌پرسند.

    Does it change my thesis file?آیا فایل پایان‌نامه‌ام را عوض می‌کند؟

    No. It reads the file and writes only the copy you request with --fix (thesis.payanlint.docx). Everything except text inside w:t is byte-identical.نه. فایل را می‌خواند و فقط با --fix نسخه‌ای می‌نویسد که خودتان خواسته‌اید (thesis.payanlint.docx). هر چیز جز متن داخل w:t بایت‌به‌بایت یکسان است.

    Which university's rules does it use?قوانین کدام دانشگاه را به کار می‌برد؟

    None. I could not verify any official table, so you supply font, size, spacing and margins. Without them it only checks that the document is consistent with itself.هیچ‌کدام. نتوانستم جدول رسمی‌ای را راستی‌آزمایی کنم؛ پس فونت، اندازه، فاصله و حاشیه را شما می‌دهید. بدون آن‌ها فقط می‌سنجد سند با خودش سازگار باشد.

    Why not just use Word's own checks?چرا از خود ورد استفاده نکنم؟

    As far as I know, the checks built into Word do not flag that Persian text has no complex-script font, that bold is set for Latin only, or that Arabic ي is hiding in your text. payanlint lists them in one report.تا آنجا که می‌دانم، بررسی‌های خود ورد نشان نمی‌دهند که متن فارسی فونت اسکریپت پیچیده ندارد، بولد فقط برای لاتین است یا ي عربی میان متن‌تان پنهان است. پایان‌لینت همه را در یک گزارش می‌آورد.