📚 Turn // Comments into Beautiful Documentation
JSDoc, XML comments, docstrings are structured. AI converts comments to Markdown docs. Publish anywhere.
📝 The Prompt
Convert these code comments into API documentation:
[Paste code with JSDoc/XML comments here]
Requirements:
- Generate readable Markdown
- Include function signatures with types
- Add example usage for each function
- Group by class/module
- Add table of contents
- Highlight deprecated methods
- Show parameter details (name, type, description)
- Show return values and possible exceptions
Output format: GitHub Flavored Markdown
Language: English, technical but accessible
Example JSDoc:
/**
* Fetches user data by ID
* @param {number} userId - User identifier
* @param {boolean} [includeOrders=false] - Include user orders
* @returns {Promise<User>} User object
* @throws {NotFoundError} If user doesn't exist
*/
✅ Example Output
## UserAPI
### fetchUser(userId, includeOrders = false)
Fetches user data by ID from the database.
**Parameters:**
- `userId` (number, required) - User identifier (must be positive)
- `includeOrders` (boolean, optional) - Include user orders in response. Default: false
**Returns:** `Promise<User>` - User object with id, name, email
**Throws:** `NotFoundError` - When user doesn't exist
**Example:**
```javascript
import { fetchUser } from './api';
try {
const user = await fetchUser(123, true);
console.log(user.name, user.orders);
} catch (err) {
if (err instanceof NotFoundError) {
console.log('User not found');
}
}
```
💡 Use Cases
- Generate README from JSDoc comments
- Create wiki pages for internal APIs
- Document legacy code with minimal comments
- Generate Postman collections from OpenAPI comments
“Code had JSDoc but no external docs. AI converted to Markdown in 2 minutes. Published to GitHub wiki. Developers finally know how to use the API.”
