diff --git a/.processed/html/net/convert-html-to-pdf-with-bold-italic-font-using-aspose-html.txt b/.processed/html/net/convert-html-to-pdf-with-bold-italic-font-using-aspose-html.txt new file mode 100644 index 0000000000..5f6afb9d36 --- /dev/null +++ b/.processed/html/net/convert-html-to-pdf-with-bold-italic-font-using-aspose-html.txt @@ -0,0 +1,7 @@ +Title: Convert HTML to PDF with bold‑italic font using Aspose.HTML +Slug: convert-html-to-pdf-with-bold-italic-font-using-aspose-html +Category: html-extensions-and-conversions +ProcessedDate: 2026-10-06T06:21:38.919275 +SourceRepo: AI Search API +Keywords: convert html to pdf, save html as pdf, add font style pdf, set bold italic font, aspose html pdf conversion +PRNumber: 290 diff --git a/.processed/html/net/how-to-convert-html-to-stream-with-a-custom-handler-in-c.txt b/.processed/html/net/how-to-convert-html-to-stream-with-a-custom-handler-in-c.txt new file mode 100644 index 0000000000..6fb05da7d8 --- /dev/null +++ b/.processed/html/net/how-to-convert-html-to-stream-with-a-custom-handler-in-c.txt @@ -0,0 +1,7 @@ +Title: How to convert HTML to stream with a custom handler in C# +Slug: how-to-convert-html-to-stream-with-a-custom-handler-in-c +Category: html-extensions-and-conversions +ProcessedDate: 2026-10-06T06:21:37.143168 +SourceRepo: AI Search API +Keywords: convert html to stream +PRNumber: 290 diff --git a/html/arabic/python/general/convert-html-to-markdown-using-gitlab-flavor-in-python/_index.md b/html/arabic/python/general/convert-html-to-markdown-using-gitlab-flavor-in-python/_index.md new file mode 100644 index 0000000000..d78b34b78b --- /dev/null +++ b/html/arabic/python/general/convert-html-to-markdown-using-gitlab-flavor-in-python/_index.md @@ -0,0 +1,201 @@ +--- +category: general +date: 2026-10-05 +description: تحويل HTML إلى Markdown بنكهة GitLab باستخدام Python. تعلّم كيفية حفظ + HTML كـ Markdown وتصدير HTML إلى Markdown في ثلاث خطوات واضحة. +draft: false +images: +- PLACEHOLDER_URL/og-image.png +keywords: +- convert html to markdown +- gitlab markdown flavor +- save html as markdown +- export html to markdown +- how to convert html +language: ar +lastmod: 2026-10-05 +og_description: حوّل HTML إلى Markdown بنكهة GitLab باستخدام بايثون. اتبع هذا الدليل + خطوة بخطوة لحفظ HTML كـ Markdown وتصدير HTML إلى Markdown بكفاءة. +og_image_alt: Diagram showing the flow from HTML document to Markdown file using GitLab + flavor +og_title: تحويل HTML إلى Markdown باستخدام نكهة GitLab – دليل بايثون +schemas: +- author: Aspose + dateModified: '2026-10-05' + description: Convert HTML to Markdown with GitLab markdown flavor using Python. + Learn how to save HTML as Markdown and export HTML to Markdown in three clear + steps. + headline: Convert HTML to Markdown using GitLab flavor in Python + type: TechArticle +- description: Convert HTML to Markdown with GitLab markdown flavor using Python. + Learn how to save HTML as Markdown and export HTML to Markdown in three clear + steps. + name: Convert HTML to Markdown using GitLab flavor in Python + steps: + - name: Why choose the GitLab flavor? + text: '* **Consistency with GitLab repositories** – When the generated file lands + in a GitLab repo, the markdown renders exactly as it would if you wrote it by + hand. * **Extended syntax support** – Features like task lists (`- [ ]`) and + tables (`|`) are interpreted correctly. * **Future‑proofing** – GitLab' + - name: Expected output + text: 'If `sample.html` contains:' + - name: Common pitfalls + text: '| Issue | Cause | Fix | |-------|-------|-----| | Empty output file | `HTMLDocument` + path is wrong or file is unreadable | Double‑check the path and file permissions + | | Missing links | `features` list does not include `LINK` | Add `MarkdownSaveOptions.Feature.LINK` + to the list | | Unexpected HTML t' + - name: Extending the script + text: '* **Export HTML to Markdown with images** – Add `MarkdownSaveOptions.Feature.IMAGE` + to the `features` list. * **Batch conversion** – Wrap the conversion call in + a loop that iterates over all `.html` files in a directory. * **Custom post‑processing** + – Read the generated `.md` file, apply regex repla' + type: HowTo +tags: +- HTML +- Markdown +- Python +- Conversion +title: تحويل HTML إلى Markdown باستخدام صيغة GitLab في بايثون +url: /ar/python/general/convert-html-to-markdown-using-gitlab-flavor-in-python/ +--- + +{{< blocks/products/pf/main-wrap-class >}} +{{< blocks/products/pf/main-container >}} +{{< blocks/products/pf/tutorial-page-section >}} + +# تحويل HTML إلى Markdown باستخدام نكهة GitLab في بايثون + +إذا كنت بحاجة إلى **تحويل HTML إلى Markdown**، فإن هذا الدرس يوضح لك حلاً كاملاً وجاهزًا للتنفيذ. بنهاية الدليل ستكون قادرًا على **حفظ HTML كـ Markdown** و**تصدير HTML إلى Markdown** باستخدام نكهة Markdown الخاصة بـ GitLab، كل ذلك من خلال سكريبت بايثون قصير. + +سترى لماذا نكهة GitLab مهمة، وكيفية تكوين خيارات التحويل، وما شكل Markdown النهائي. لا تحتاج إلى أدوات خارجية—فقط المكتبة المستخدمة في مثال الشيفرة وبعض أسطر بايثون. + +## تحويل HTML إلى Markdown – نظرة عامة + +عملية التحويل تتكون من ثلاث خطوات منطقية: + +1. تحميل ملف HTML المصدر. +2. تعريف خيارات Markdown (نكهة GitLab، الميزات المختارة). +3. تشغيل التحويل وكتابة ملف الإخراج. + +كل خطوة تتطابق مباشرةً مع سطر أو كتلة في الشيفرة النموذجية، مما يجعل التدفق سهل المتابعة والتعديل. + +## إعداد البيئة + +قبل كتابة أي كود، تأكد من تثبيت الحزمة المطلوبة. المثال يستخدم مكتبة `html2md` الافتراضية التي توفر الفئات `HTMLDocument`، `MarkdownSaveOptions`، و `Converter`. + +```bash +pip install html2md +``` + +> **نصيحة احترافية:** تحقق من التثبيت عن طريق تشغيل `python -c "import html2md; print(html2md.__version__)"`. المكتبة تعمل مع Python 3.8 +. + +## تكوين نكهة Markdown الخاصة بـ GitLab + +نكة Markdown الخاصة بـ GitLab (تُسمى أحيانًا *GFM* لـ GitHub Flavored Markdown) تضيف دعمًا لقوائم المهام، الجداول، وامتدادات أخرى لا تتوفر في Markdown العادي. لتفعيلها، تقوم بتعيين خاصية `formatter` في `MarkdownSaveOptions` إلى `GIT`. يمكنك أيضًا حصر التحويل على ميزات محددة—هنا نحتفظ فقط بالروابط والفقرات. + +```python +from html2md import HTMLDocument, MarkdownSaveOptions, Converter + +# Step 1: Load the HTML document +html_doc = HTMLDocument("YOUR_DIRECTORY/sample.html") + +# Step 2: Set up Markdown conversion options +md_options = MarkdownSaveOptions() +md_options.formatter = MarkdownSaveOptions.Formatter.GIT # GitLab markdown flavor +md_options.features = [ + MarkdownSaveOptions.Feature.LINK, # Preserve hyperlinks + MarkdownSaveOptions.Feature.PARAGRAPH # Keep paragraph breaks +] +``` + +### لماذا تختار نكهة GitLab؟ + +* **الاتساق مع مستودعات GitLab** – عندما يتم وضع الملف المُولد في مستودع GitLab، يتم عرض الـ markdown تمامًا كما لو أنك كتبته يدويًا. +* **دعم موسع للتركيب** – ميزات مثل قوائم المهام (`- [ ]`) والجداول (`|`) يتم تفسيرها بشكل صحيح. +* **التحضير للمستقبل** – محلل GitLab يتم صيانته بنشاط، مما يقلل من خطر الأخطاء في العرض. + +إذا كنت تفضل نكهة مختلفة (مثال: CommonMark)، استبدل `Formatter.GIT` بالقيمة المناسبة من الـ enum. + +## تنفيذ التحويل + +مع الوثيقة والخيارات جاهزة، استدعِ الطريقة الساكنة `convert`. هذه الدعوة تقرأ HTML، تطبق الميزات المختارة، وتكتب النتيجة إلى ملف `.md`. + +```python +# Step 3: Convert the HTML to a Markdown file +Converter.convert(html_doc, "YOUR_DIRECTORY/sample.md", md_options) +``` + +بعد انتهاء السكريبت، يحتوي `sample.md` على المحتوى المحول. الملف يحترم نكهة Markdown الخاصة بـ GitLab، لذا أي واجهة GitLab ستعرضه بشكل صحيح. + +## التحقق من الناتج ومعالجة الحالات الخاصة + +### الناتج المتوقع + +إذا كان `sample.html` يحتوي على: + +```html +
This is a sample link inside a paragraph.
+``` + +سيظهر `sample.md` الناتج هكذا: + +```markdown +# Welcome + +This is a [sample link](https://example.com) inside a paragraph. +``` + +لاحظ أن: + +* العنوان تم تحويله إلى رأس Markdown `#`. +* الرابط يتبع صياغة GitLab القياسية. +* فقط الفقرة والرابط يبقيان لأننا قصرنا `features` على `LINK` و `PARAGRAPH`. + +### المشكلات الشائعة + +| المشكلة | السبب | الحل | +|-------|-------|-----| +| ملف ناتج فارغ | مسار `HTMLDocument` غير صحيح أو الملف غير قابل للقراءة | تحقق مرة أخرى من المسار وأذونات الملف | +| روابط مفقودة | قائمة `features` لا تشمل `LINK` | أضف `MarkdownSaveOptions.Feature.LINK` إلى القائمة | +| ظهور وسوم HTML غير متوقعة | قائمة الميزات تشمل `ALL` أو مجموعة أوسع | قصر `features` على ما تحتاجه فقط (مثال: `PARAGRAPH`, `LINK`) | +| عدم عرض الصياغة الخاصة بـ GitLab | `formatter` مضبوط على قيمة غير GitLab | عيّن `md_options.formatter = MarkdownSaveOptions.Formatter.GIT` | + +### توسيع السكريبت + +* **تصدير HTML إلى Markdown مع الصور** – أضف `MarkdownSaveOptions.Feature.IMAGE` إلى قائمة `features`. +* **تحويل دفعي** – غلف استدعاء التحويل داخل حلقة تتكرر على جميع ملفات `.html` في دليل. +* **معالجة ما بعد التحويل مخصصة** – اقرأ ملف `.md` المُولد، طبّق استبدالات regex، واكتب النسخة النهائية. + +## حفظ HTML كـ Markdown – ملخص سريع + +1. **تحميل** ملف HTML باستخدام `HTMLDocument`. +2. **تكوين** `MarkdownSaveOptions` لاستخدام نكهة Markdown الخاصة بـ GitLab واختيار الميزات المطلوبة فقط. +3. **تحويل** باستخدام `Converter.convert`، مع تحديد مسار الإخراج. + +هذه الخطوات الثلاث تشكل كامل سير عمل **كيفية تحويل html** لهذه المكتبة. + +## الخلاصة + +أنت الآن تعرف كيف **تحويل HTML إلى Markdown** باستخدام نكهة Markdown الخاصة بـ GitLab في بايثون. غطى الدليل كل شيء من إعداد البيئة إلى التحقق من الناتج، وأظهر لك كيف **حفظ HTML كـ Markdown** و**تصدير HTML إلى Markdown** مع تحكم دقيق في الميزات. + +بعد ذلك، قد تستكشف: + +* **إضافة جداول وكتل شفرة** – استخدم `MarkdownSaveOptions.Feature.TABLE` و `FEATURE.CODE`. +* **دمج السكريبت في خطوط CI/CD** – أتمتة توليد الوثائق عند كل دمج. +* **مقارنة النكهات الأخرى** – جرّب `Formatter.COMMONMARK` لترى الاختلافات. + +لا تتردد في تجربة الخيارات، تعديل السكريبت للمعالجة الدفعة، أو دمجه مع مولدات المواقع الثابتة. تحويل سعيد! + +## ماذا يجب أن تتعلم بعد ذلك؟ + +الدروس التالية تغطي مواضيع ذات صلة وثيقة تبني على التقنيات التي تم توضيحها في هذا الدليل. كل مصدر يتضمن أمثلة شفرة كاملة مع شروحات خطوة بخطوة لمساعدتك على إتقان ميزات API إضافية واستكشاف نهج تنفيذ بديلة في مشاريعك الخاصة. + +- [تحويل HTML إلى Markdown في Aspose.HTML للـ Java](/html/english/java/saving-html-documents/convert-html-to-markdown/) +- [تحويل HTML إلى Markdown في .NET باستخدام Aspose.HTML](/html/english/net/html-extensions-and-conversions/convert-html-to-markdown/) +- [Markdown إلى HTML Java - التحويل باستخدام Aspose.HTML](/html/english/java/conversion-html-to-other-formats/convert-markdown-to-html/) + +{{< /blocks/products/pf/tutorial-page-section >}} +{{< /blocks/products/pf/main-container >}} +{{< /blocks/products/pf/main-wrap-class >}} +{{< blocks/products/products-backtop-button >}} \ No newline at end of file diff --git a/html/arabic/python/general/how-to-convert-html-to-markdown-and-handle-large-html-pages/_index.md b/html/arabic/python/general/how-to-convert-html-to-markdown-and-handle-large-html-pages/_index.md new file mode 100644 index 0000000000..95b6756785 --- /dev/null +++ b/html/arabic/python/general/how-to-convert-html-to-markdown-and-handle-large-html-pages/_index.md @@ -0,0 +1,257 @@ +--- +category: general +date: 2026-10-05 +description: تعلم كيفية تحويل HTML إلى Markdown وتحويل صفحة HTML الكبيرة بكفاءة باستخدام + Aspose.HTML للبايثون. +draft: false +images: +- PLACEHOLDER_URL/og-image.png +keywords: +- convert html to markdown +- convert large html page +- Aspose.HTML Python +- HTML to Markdown conversion +- large HTML processing +language: ar +lastmod: 2026-10-05 +og_description: حوّل HTML إلى Markdown وحوّل صفحة HTML كبيرة باستخدام Aspose.HTML + للبايثون. اتبع هذا الدليل خطوة بخطوة للحصول على نتائج موثوقة. +og_image_alt: Diagram illustrating convert HTML to Markdown workflow +og_title: تحويل HTML إلى Markdown ومعالجة صفحات HTML الكبيرة باستخدام Aspose.HTML +schemas: +- author: Aspose + dateModified: '2026-10-05' + description: Learn how to convert HTML to Markdown and convert large HTML page efficiently + with Aspose.HTML Python. + headline: How to convert HTML to Markdown and handle large HTML pages + type: TechArticle +- description: Learn how to convert HTML to Markdown and convert large HTML page efficiently + with Aspose.HTML Python. + name: How to convert HTML to Markdown and handle large HTML pages + steps: + - name: '**License activation** – Without a license the library runs in evaluation + mode, which may insert a notice into the output. Activating the license early + guarantees that the conversion runs with full features.' + text: '**License activation** – Without a license the library runs in evaluation + mode, which may insert a notice into the output. Activating the license early + guarantees that the conversion runs with full features.' + - name: '**Resource handling depth** – Large HTML pages often contain deeply nested + elements (e.g., complex tables or SVGs). Setting `max_handling_depth` to a modest + value (4) stops the parser from recursing indefinitely, which protects your + process from out‑of‑memory crashes.' + text: '**Resource handling depth** – Large HTML pages often contain deeply nested + elements (e.g., complex tables or SVGs). Setting `max_handling_depth` to a modest + value (4) stops the parser from recursing indefinitely, which protects your + process from out‑of‑memory crashes.' + - name: '**Loading with limits** – By passing `resource_handling_options` to `HTMLDocument`, + you ensure the parser respects the depth limit from the moment the document + is read.' + text: '**Loading with limits** – By passing `resource_handling_options` to `HTMLDocument`, + you ensure the parser respects the depth limit from the moment the document + is read.' + - name: '**Markdown options** – The `Formatter.GIT` setting produces Git‑flavored + Markdown, which is widely supported by platforms like GitLab and GitHub. Selecting + only `LINK` and `TABLE` features removes unnecessary formatting (e.g., images, + headings) and keeps the output focused on the data you need.' + text: '**Markdown options** – The `Formatter.GIT` setting produces Git‑flavored + Markdown, which is widely supported by platforms like GitLab and GitHub. Selecting + only `LINK` and `TABLE` features removes unnecessary formatting (e.g., images, + headings) and keeps the output focused on the data you need.' + - name: '**Single‑call conversion** – `Converter.convert` handles parsing, transformation, + and file writing internally. This reduces boilerplate and guarantees that the + source and target are processed in a consistent state.' + text: '**Single‑call conversion** – `Converter.convert` handles parsing, transformation, + and file writing internally. This reduces boilerplate and guarantees that the + source and target are processed in a consistent state.' + type: HowTo +tags: +- Python +- Aspose.HTML +- Markdown +- HTML conversion +title: كيفية تحويل HTML إلى Markdown ومعالجة صفحات HTML الكبيرة +url: /ar/python/general/how-to-convert-html-to-markdown-and-handle-large-html-pages/ +--- + +{{< blocks/products/pf/main-wrap-class >}} +{{< blocks/products/pf/main-container >}} +{{< blocks/products/pf/tutorial-page-section >}} + +# كيفية تحويل HTML إلى Markdown ومعالجة صفحات HTML الكبيرة + +إذا كنت بحاجة إلى **تحويل HTML إلى Markdown**، يوضح لك هذا الدليل طريقة موثوقة للقيام بذلك باستخدام Aspose.HTML للغة Python. عندما يكون ملف المصدر **صفحة HTML كبيرة**، فإن النهج نفسه يحافظ على انخفاض استهلاك الذاكرة ويتجنب عنق الزجاجة في الأداء. + +ستتعلم كيف تقوم بـ: + +* تطبيق ترخيص Aspose.HTML (اختياري لكن يُنصح به) +* تحديد عمق معالجة الموارد للصفحات الكبيرة جدًا +* تحميل مستند HTML مع تلك الحدود +* تكوين إخراج Markdown بنكهة Git يحتفظ فقط بالروابط والجداول +* إجراء التحويل في استدعاء واحد + +يفترض هذا الدرس أنك قد قمت بتثبيت Python 3.8+ وتملك معرفة أساسية بـ pip. + +## المتطلبات المسبقة + +| المتطلب | لماذا يهم | +|-------------|----------------| +| حزمة `aspose.html` | توفر `HTMLDocument` و `Converter` وخيارات التحويل | +| ملف ترخيص Aspose.HTML صالح (اختياري) | يفتح جميع الوظائف ويزيل علامات التقييم | +| مساحة قرص كافية لملف الإخراج | ملفات Markdown صغيرة، لكن صفحات HTML الكبيرة قد تحتاج إلى مخازن مؤقتة | + +ثبت المكتبة باستخدام: + +```bash +pip install aspose-html +``` + +## تحويل HTML إلى Markdown باستخدام Aspose.HTML + +الكود التالي يقوم بالتحويل الكامل. يتم شرح كل خطوة بالتفصيل حتى تفهم **لماذا** كُتب الكود بهذه الطريقة، وليس فقط **ماذا** يفعل. + +```python +from aspose.html import ( + License, HTMLDocument, Converter, + MarkdownSaveOptions, ResourceHandlingOptions +) + +# Step 1: Apply your Aspose.HTML license (optional but recommended) +License().set_license(r"YOUR_DIRECTORY/Aspose.HTML.Python.via.NET.lic") + +# Step 2: Limit resource handling depth for very large HTML pages +resource_options = ResourceHandlingOptions() +resource_options.max_handling_depth = 4 # prevents deep recursion on huge DOM trees + +# Step 3: Load the source HTML document using the defined resource limits +source_doc = HTMLDocument( + r"YOUR_DIRECTORY/large_page.html", + resource_handling_options=resource_options +) + +# Step 4: Configure Markdown conversion – GitLab flavour, keep only links and tables +markdown_options = MarkdownSaveOptions() +markdown_options.formatter = MarkdownSaveOptions.Formatter.GIT +markdown_options.features = [ + MarkdownSaveOptions.Feature.LINK, + MarkdownSaveOptions.Feature.TABLE +] + +# Step 5: Convert the HTML document to Markdown in a single operation +Converter.convert(source_doc, r"YOUR_DIRECTORY/large_page.md", markdown_options) +``` + +### لماذا كل خطوة مهمة + +1. **تفعيل الترخيص** – بدون ترخيص تعمل المكتبة في وضع التقييم، مما قد يضيف إشعارًا إلى الإخراج. تفعيل الترخيص مبكرًا يضمن أن التحويل يتم بكامل الميزات. + +2. **عمق معالجة الموارد** – صفحات HTML الكبيرة غالبًا ما تحتوي على عناصر متداخلة بعمق (مثل الجداول المعقدة أو SVG). ضبط `max_handling_depth` على قيمة معتدلة (4) يمنع المحلل من التكرار إلى ما لا نهاية، مما يحمي عمليتك من تعطل الذاكرة. + +3. **التحميل مع الحدود** – بتمرير `resource_handling_options` إلى `HTMLDocument`، تضمن أن المحلل يحترم حد العمق منذ لحظة قراءة المستند. + +4. **خيارات Markdown** – إعداد `Formatter.GIT` ينتج Markdown بنكهة Git، وهو مدعوم على نطاق واسع من قبل منصات مثل GitLab وGitHub. اختيار الميزتين فقط `LINK` و `TABLE` يزيل التنسيقات غير الضرورية (مثل الصور والعناوين) ويجعل الإخراج يركز على البيانات التي تحتاجها. + +5. **تحويل بنقرة واحدة** – `Converter.convert` يتعامل مع التحليل والتحويل وكتابة الملف داخليًا. هذا يقلل من الشيفرة المتكررة ويضمن أن المصدر والهدف يُعالجان بحالة متسقة. + +## كيفية تحويل صفحة HTML كبيرة بكفاءة + +عند التعامل مع **صفحة HTML كبيرة**، ضع في اعتبارك النصائح الإضافية التالية: + +* **زيادة عمق المعالجة فقط عند الضرورة** – قد تتطلب الصفحات ذات التداخل العميق قيمة أعلى، لكن ذلك يزيد من استهلاك الذاكرة. +* **تدفق الإدخال إذا تجاوز حجم الملف الذاكرة المتاحة** – يدعم Aspose.HTML التحميل من تدفق؛ استبدل مسار الملف بكائن `io.BytesIO` يقرأ القطع. +* **تشغيل التحويل في خيط خلفي** – إذا كان لتطبيقك واجهة مستخدم، انقل عملية التحويل إلى خلفية لتجنب حظر الخيط الرئيسي. +* **تحقق من صحة الإخراج** – بعد التحويل، افتح ملف `.md` الناتج للتأكد من أن الجداول والروابط تم الاحتفاظ بها كما هو متوقع. يمكن كتابة فحص سريع كالتالي: + +```python +with open(r"YOUR_DIRECTORY/large_page.md", "r", encoding="utf-8") as f: + content = f.read() + assert "| " in content, "No table detected in Markdown output" + assert "[" in content and "](" in content, "No links detected in Markdown output" +``` + +## مثال عملي كامل + +فيما يلي سكربت مستقل يمكنك نسخه، تعديل المسارات، وتشغيله. يتضمن معالجة الأخطاء ويطبع رسالة حالة قصيرة. + +```python +import sys +from aspose.html import ( + License, HTMLDocument, Converter, + MarkdownSaveOptions, ResourceHandlingOptions +) + +def main(html_path: str, md_path: str, license_path: str = None): + try: + # Apply license if provided + if license_path: + License().set_license(license_path) + + # Configure resource handling for large pages + res_opts = ResourceHandlingOptions() + res_opts.max_handling_depth = 4 + + # Load HTML with the resource limits + doc = HTMLDocument(html_path, resource_handling_options=res_opts) + + # Set up Git‑flavored Markdown, keep links & tables only + md_opts = MarkdownSaveOptions() + md_opts.formatter = MarkdownSaveOptions.Formatter.GIT + md_opts.features = [ + MarkdownSaveOptions.Feature.LINK, + MarkdownSaveOptions.Feature.TABLE + ] + + # Perform conversion + Converter.convert(doc, md_path, md_opts) + print(f"Conversion succeeded: '{html_path}' → '{md_path}'") + except Exception as e: + print(f"Error during conversion: {e}", file=sys.stderr) + sys.exit(1) + +if __name__ == "__main__": + # Example usage: + # python convert_html_to_md.py large_page.html large_page.md Aspose.HTML.Python.via.NET.lic + if len(sys.argv) < 3: + print("Usage: python convert_html_to_md.py