تبدیل Markdown به HTML با یک API REST ساده (رایگان در RapidAPI)

نمای کلی
Markdownmaster API یک سرویس تبدیل سند از Markdown به قالب های مختلف و برعکس است ، با ویژگی های یک ظاهر طراحی شده و سفارشی اضافی. این API به گونه ای ساده برای استفاده و در عین حال قدرتمند از نظر عملکردی طراحی شده است ، و به توسعه دهندگان خدمت می کند که نیاز به ادغام تبدیل اسناد در برنامه های خود دارند.
پیوند: https://rapidapi.com/gubarbosaj/api/markdownmaster
ویژگی های کلیدی
- تبدیل از Markdown به قالب های مختلف (HTML ، PDF ، DOCX ، متن ساده)
- تبدیل از قالب های دیگر به علامت گذاری (HTML ، استخراج محتوا از URL)
- سفارشی سازی پیشرفته با سبک ها ، الگوها و گزینه های قالب بندی
- برنامه های کاربردی برای اعتبار سنجی و تجزیه و تحلیل از اسناد Markdown
- فهرست محتویات از اسناد Markdown
- استخراج عناصر خاص مانند پیوندها ، تصاویر و هدرها
نقاط پایانی
تبدیل از علامت گذاری به قالب های دیگر
/convert/md-to-html
متن Markdown را با گزینه های یک ظاهر طراحی شده به HTML تبدیل می کند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\nThis is an example of **Markdown**.",
"style": "github",
"include_toc": true,
"include_metadata": false,
"seo_optimize": true
}
پاسخ:
{
"success": true,
"result": "<!DOCTYPE html>\n<html>\n<head>...",
"format": "html",
"metadata": {
"style": "github",
"include_toc": true
}
}
/convert/md-to-pdf
متن Markdown را به PDF با گزینه های قالب بندی تبدیل می کند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\nThis is an example of **Markdown**.",
"template": "academic",
"page_size": "A4",
"include_toc": true,
"include_cover": true,
"header_text": "Generated Document",
"footer_text": "Page {page}"
}
پاسخ: فایل PDF برای بارگیری
/convert/md-to-docx
متن Markdown را به Docx (Microsoft Word) تبدیل می کند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\nThis is an example of **Markdown**.",
"template": "business",
"include_toc": true,
"include_styles": true
}
پاسخ: فایل Docx برای بارگیری
/convert/md-to-plain
متن Markdown را به متن ساده تبدیل می کند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\nThis is an example of **Markdown**.\n\n[Link](https://example.com)",
"preserve_links": true,
"preserve_images": false
}
پاسخ:
{
"success": true,
"result": "Title\n\nThis is an example of Markdown.\n\nLink (https://example.com)",
"format": "text",
"metadata": {
"preserve_links": true,
"preserve_images": false
}
}
تبدیل از قالب های دیگر به علامت گذاری
/convert/html-to-md
HTML را به Markdown تبدیل می کند.
روش: پست
پارامترها:
{
"html_text": "This is an example of HTML.
",
"preserve_tables": true,
"github_flavored": false
}
پاسخ:
{
"success": true,
"result": "# Title\n\nThis is an example of **HTML**.",
"format": "markdown",
"metadata": {
"preserve_tables": true,
"github_flavored": false
}
}
/convert/url-to-md
محتوای یک URL را استخراج کرده و آن را به Markdown تبدیل می کند.
روش: پست
پارامترها:
{
"url": "https://example.com",
"include_images": true,
"include_links": true,
"clean_content": true
}
پاسخ:
{
"success": true,
"result": "# Page Title\n\nExtracted content...",
"format": "markdown",
"metadata": {
"source_url": "https://example.com",
"include_images": true,
"include_links": true
}
}
برنامه ها و ابزارها
/utils/md-validate
Syntax Markdown را تأیید می کند و خطاها یا هشدارها را برمی گرداند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\nThis is an example of **Markdown**.\n\n[Broken link]()",
"flavor": "commonmark"
}
پاسخ:
{
"valid": false,
"errors": [
{
"type": "broken_link",
"message": "Empty link: [Broken link]()",
"line": 5
}
],
"warnings": []
}
/utils/md-extract
عناصر خاص را از Markdown (پیوندها ، تصاویر ، هدرها) استخراج می کند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\n## Subtitle\n\n[Link](https://example.com)\n\n",
"elements": ["links", "images", "headings"]
}
پاسخ:
{
"success": true,
"elements": {
"links": [
{
"text": "Link",
"url": "https://example.com"
}
],
"images": [
{
"alt": "Image",
"src": "image.jpg"
}
],
"headings": [
{
"level": 1,
"text": "Title",
"id": ""
},
{
"level": 2,
"text": "Subtitle",
"id": ""
}
]
},
"count": {
"links": 1,
"images": 1,
"headings": 2
}
}
/utils/md-toc
فهرست مطالب را از Markdown تولید می کند.
روش: پست
پارامترها:
{
"markdown_text": "# Title\n\n## Subtitle 1\n\n### Subsection 1.1\n\n## Subtitle 2",
"max_depth": 3,
"format": "markdown"
}
پاسخ:
{
"success": true,
"toc": "- [Title](#title)\n - [Subtitle 1](#subtitle-1)\n - [Subsection 1.1](#subsection-11)\n - [Subtitle 2](#subtitle-2)",
"headings_count": 4
}
نمونه های استفاده
پیتون
import requests
import json
url = "https://api.rapidapi.com/markdownmaster/convert/md-to-html"
payload = {
"markdown_text": "# Title\n\nThis is an example of **Markdown**.",
"style": "github",
"include_toc": False,
"include_metadata": False,
"seo_optimize": True
}
headers = {
"content-type": "application/json",
"X-RapidAPI-Key": "YOUR_API_KEY_HERE",
"X-RapidAPI-Host": "markdownmaster.p.rapidapi.com"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
جاذب
const options = {
method: 'POST',
headers: {
'content-type': 'application/json',
'X-RapidAPI-Key': 'YOUR_API_KEY_HERE',
'X-RapidAPI-Host': 'markdownmaster.p.rapidapi.com'
},
body: JSON.stringify({
markdown_text: '# Title\n\nThis is an example of **Markdown**.',
style: 'github',
include_toc: false,
include_metadata: false,
seo_optimize: true
})
};
fetch('https://markdownmaster.p.rapidapi.com/convert/md-to-html', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
پشتیبانی و تماس
برای پشتیبانی فنی یا سؤالاتی درباره API ، لطفاً از طریق ایمیل با ما تماس بگیرید: streamsyncbot@gmail.com