MassiveMark is an API that converts Markdown into other document formats — HTML, Word (.docx), and PDF. This repository contains ready-to-run sample code in JavaScript and Python so you can get started quickly.
You send Markdown text to the MassiveMark API and it returns the converted document. Three endpoints are available:
| Endpoint | Converts to | Response type |
|---|---|---|
/api/massivemark/mtoh |
HTML | JSON ({ "htmlContent": "..." }) |
/api/massivemark/mtow |
Word (.docx) | Binary file |
/api/massivemark/mtop |
Binary file |
Base URL: https://api.bibcit.com
To call the MassiveMark API you will need an API key.
- Create an account at Bibcit.
- Go to your Profile.
- Under the API Key section you will find your key.
Keep your key secret. Do not commit it to public repositories. The key shown in the sample code is for demonstration only.
MassiveMark/
├── js/ # JavaScript examples (Node.js)
│ ├── input.md # Sample Markdown input
│ ├── m2h.js # Markdown → HTML
│ ├── m2w.js # Markdown → Word
│ ├── m2p.js # Markdown → PDF
│ └── output.html # Sample HTML output
├── py/ # Python examples
│ ├── m2h.py # Markdown → HTML
│ ├── m2w.py # Markdown → Word
│ └── m2p.py # Markdown → PDF
├── LICENSE
└── README.md
| Language | Requirement |
|---|---|
| JavaScript | Node.js v18 or later (for built-in fetch) |
| Python | Python 3.7 or later + the requests library |
git clone https://github.com/<your-username>/MassiveMark.git
cd MassiveMarkPlace the Markdown content you want to convert in input.md inside the js/ or py/ folder (or both). A sample file is already provided.
cd js
node m2h.js # Creates output.html
node m2w.js # Creates output.docx
node m2p.js # Creates output.pdfFirst install the required library (one-time):
pip install requestsThen run the scripts:
cd py
python m2h.py # Creates output.html
python m2w.py # Creates output.docx
python m2p.py # Creates output.pdfEvery script follows the same three steps:
# Python
with open("input.md", "r", encoding="utf-8") as f:
markdown_content = f.read()// JavaScript
const markdownContent = fs.readFileSync('input.md', 'utf-8');Send the raw Markdown text in the request body with two required headers:
| Header | Value |
|---|---|
Content-Type |
text/plain;charset=UTF-8 |
Bibcit-Key |
Your API key |
# Python (Markdown → HTML)
response = requests.post(
"https://api.bibcit.com/api/massivemark/mtoh",
headers={
"Content-Type": "text/plain;charset=UTF-8",
"Bibcit-Key": "YOUR_API_KEY",
},
data=markdown_content.encode("utf-8"),
)// JavaScript (Markdown → HTML)
const response = await fetch('https://api.bibcit.com/api/massivemark/mtoh', {
method: 'POST',
headers: {
'Content-Type': 'text/plain;charset=UTF-8',
'Bibcit-Key': 'YOUR_API_KEY',
},
body: markdownContent,
});- HTML — the response is JSON. Extract the
htmlContentfield and save as.html. - Word / PDF — the response is binary data. Save the raw bytes as
.docxor.pdf.
# Python — HTML
html_content = response.json()["htmlContent"]
with open("output.html", "w", encoding="utf-8") as f:
f.write(html_content)
# Python — Word / PDF (binary)
with open("output.docx", "wb") as f:
f.write(response.content)// JavaScript — HTML
const { htmlContent } = await response.json();
fs.writeFileSync('output.html', htmlContent);
// JavaScript — Word / PDF (binary)
const binaryContent = await response.arrayBuffer();
fs.writeFileSync('output.docx', Buffer.from(binaryContent));POST https://api.bibcit.com/api/massivemark/{endpoint}
| Parameter | Location | Description |
|---|---|---|
endpoint |
URL path | One of mtoh (HTML), mtow (Word), mtop (PDF) |
Bibcit-Key |
Header | Your API key |
Content-Type |
Header | Must be text/plain;charset=UTF-8 |
| body | Request body | Raw Markdown text |
| Endpoint | Content-Type | Body |
|---|---|---|
mtoh |
application/json |
{ "htmlContent": "<html>..." } |
mtow |
application/octet-stream |
Binary .docx file |
mtop |
application/octet-stream |
Binary .pdf file |
Here are some ideas to get you started:
- Blog engine — Convert Markdown posts to HTML and serve them on a website.
- Report generator — Let users write in Markdown and download PDF/Word reports.
- Documentation site — Bulk-convert a folder of
.mdfiles to HTML pages. - Note-taking app — Offer "Export to PDF / Word" using the API.
The sample scripts show the core pattern: read → call API → save. Wrap that pattern in your own application logic and you have a product.
| Problem | Solution |
|---|---|
ModuleNotFoundError: No module named 'requests' |
Run pip install requests |
fetch is not defined (Node.js) |
Use Node.js v18+ which includes fetch |
401 Unauthorized |
Check that your Bibcit-Key header is correct |
| Empty or corrupt output file | Ensure input.md contains valid Markdown |
See the LICENSE file for details.