A powerful documentation generator that crawls and processes API documentation from various sources, with special support for HubSpot's API documentation.
- π Intelligent crawling with Firecrawl technology
- π Specialized support for HubSpot API documentation
- π― Extracts endpoints, parameters, examples, and descriptions
- π Generates clean, well-formatted Markdown output
- π Handles dynamic, JavaScript-rendered content
- β‘ Efficient parallel processing of multiple documentation pages
- Node.js 16.x or later
- npm 7.x or later
- Clone the repository:
git clone https://github.com/[username]/latest-documentation.git
cd latest-documentation
- Install dependencies:
npm install
- Start the development server:
npm run dev
-
Access the documentation generator at
http://localhost:3000
-
To generate documentation programmatically:
import { DocumentationProcessor } from './utils/documentationProcessor';
const processor = new DocumentationProcessor();
// Generate documentation for a specific URL
const markdown = await processor.processDocumentation('https://app.hubspot.com/developer-docs/...');
// Or generate documentation for all configured sources
const fullDocs = await processor.generateDocumentation();
The documentation processor can be configured with various options:
const options = {
waitForSelectors: ['[data-test-id="endpoint"]'], // Elements to wait for
waitForTimeout: 2000, // Timeout in milliseconds
headers: { // Custom headers for requests
'User-Agent': '...',
'Accept': '...'
},
extractors: { // Content extraction rules
endpoints: {
selector: '...',
multiple: true,
extract: {
// Nested extraction rules
}
}
}
};
The project uses a modular architecture with the following key components:
DocumentationProcessor
: Main class for processing documentationFirecrawlClient
: Handles browser automation and content extractionMarkdownGenerator
: Converts extracted content to markdown format
The system provides detailed error information through the DocumentationError
class:
FETCH_ERROR
: Failed to fetch the documentation pagePARSE_ERROR
: Failed to parse the contentNO_CONTENT
: No content could be extractedEXTRACTION_ERROR
: Failed to extract specific contentPROCESSING_ERROR
: General processing error
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.