Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

Add Markdown formatting with Prettier to build process

David Turnbull3826c8f39219
diff --git a/package.json b/package.json
index 19d4de386..102a4a580 100644
--- a/package.json
+++ b/package.json
@@ -101,6 +101,7 @@
"mocha": "^5.2.0",
"nyc": "^14.0.0",
"portastic": "^1.0.1",
+ "prettier": "^1.18.2",
"proxy": "^0.2.4",
"semver": "^6.1.1",
"sinon": "^7.1.1",
diff --git a/website/tools/build_docs.js b/website/tools/build_docs.js
index 62169487e..bb91ce2ab 100644
--- a/website/tools/build_docs.js
+++ b/website/tools/build_docs.js
@@ -3,6 +3,7 @@ const readline = require('readline');
const fs = require('fs');
const path = require('path');
const { promisify } = require('util');
+const prettier = require('prettier');
const writeFile = promisify(fs.writeFile);
@@ -68,8 +69,8 @@ const generateFinalMarkdown = (title, text) => {
// Fix typedef links
const typeLinkRx = new RegExp(`([("])#(module_)?(${typedefs.join('|')})([)"])`, 'gi');
text = text.replace(typeLinkRx, (match, p1, p2, p3, p4) => `${p1}../typedefs/${p3.toLowerCase()}${p4}`);
-
- return header + text;
+ // Format Markdown with Prettier
+ return prettier.format(header + text, { parser: "markdown" });
};
const main = async () => {