Generating Documentation with DocCraft AI

Last updated: February 2025 · 7 minute read

DocCraft's core capability is transforming source material — API specs, code, or plain-text descriptions — into structured, professional-quality documentation. This guide covers all supported input types, document output types, and advanced generation settings.

Supported Input Types

BEST RESULTS
OpenAPI / Swagger Specification

Upload a .yaml or .json spec file. DocCraft fully parses endpoint definitions, request/response schemas, authentication methods, and inline descriptions. Supports OpenAPI 2.0 and 3.0.

GOOD RESULTS
Postman Collection

Export a Postman collection as .json and upload directly. DocCraft reads request structure, example responses saved in the collection, and any folder descriptions you've added in Postman.

CONTEXT-DEPENDENT
GitHub Repository URL

Paste a public GitHub URL. DocCraft reads README, source comments, and directory structure. Quality depends heavily on comment coverage in the codebase.

FLEXIBLE
Plain Text / Markdown

Paste product descriptions, feature briefs, or rough drafts. DocCraft restructures and expands the content. Ideal for generating first-draft user guides or knowledge base articles.

Document Output Types

📘
API Reference

Complete endpoint reference with authentication guide, endpoint table, parameter descriptions, request/response schemas, and code examples. Best with OpenAPI or Postman input. Output follows industry-standard API doc structure (overview → auth → endpoints → error codes).

📗
README

GitHub-standard README with badges, introduction, installation steps, usage examples, API overview table, configuration reference, and contributing guide. Best with GitHub URL or code file input.

📙
User Guide

Step-by-step product documentation for end users. Includes getting started, feature walkthroughs, screenshots guidance (placeholder annotations), FAQs, and troubleshooting section. Best with plain text product descriptions.

📕
Admin Guide

System administration documentation covering installation, system requirements, configuration options, environment variables, security hardening, backup/recovery procedures, and maintenance schedules.

📋
Release Notes

Formatted release changelog with version entries organized by New Features, Improvements, and Bug Fixes. Input a list of changes or a git commit log and DocCraft reformats into clean, user-readable release notes.

Advanced Generation Settings

These settings appear in the Advanced Settings panel before you click Generate. Expanding it is recommended for production documentation.

Tone
Technical, Approachable, or Concise. Technical uses industry terminology without explanation. Approachable adds context for less experienced readers. Concise minimizes prose and focuses on structured content.
Code Languages
Select 1-3 languages for code examples in API References. Options: Node.js, Python, cURL, Go, Ruby, PHP, Java. The source language is always included.
Custom Instructions
Free-text field for style, audience, or content instructions. Example: "Target audience is fintech developers. Use imperative mood. Add rate limit warnings to every endpoint."
Section Include/Exclude
Toggle which sections to include in the generated output. For example, exclude the "Contributing" section if generating external-facing API docs.
Best practice

For highest-quality output: combine well-structured source material + context documents (style guides, glossaries) + Custom Instructions specifying audience and tone. This combination consistently produces the best results.


🔴 Real-Time Streaming Generation

DocCraft generates documents using server-sent events (SSE) streaming so you can watch the draft materialise token-by-token in a Live Draft pane during generation.

Cancel Early
Click Cancel during streaming to stop generation. The partial draft is preserved and opens in the editor, so you never lose what the AI has already written.
Timeout Handling
If the server hits the 55-second timeout, the partial document is still saved. A clear error message tells you exactly what happened and lets you continue editing the partial draft.

📊 Version Diffing (Side-by-Side Comparison)

Compare your current draft against the original baseline or any saved snapshot. The Version Diff panel displays a line-by-line comparison with color-coded change indicators.

How to open
In the Document Editor toolbar, click the Version Diff button (GitCompare icon). A side-by-side panel appears below the editor.
Compare against
Use the dropdown to select any saved version — the initial generation baseline, or any snapshot you've saved using the Save Snapshot button. The changed-line count updates in real time.
Change types
Added (green) · Removed (red) · Changed (amber) — only lines that differ are highlighted. Same lines are dimmed.

🛡️ Custom Compliance Rules

DocCraft ships with built-in MSTP (Microsoft Style Guide) compliance checks. With Custom Compliance Rules, you can layer your own governance policies on top.

Create a rule
Click Custom Rules (ShieldPlus icon) in the toolbar. Fill in: Rule name, Instruction (what the rule enforces), Severity (error / warning / suggestion), Trigger terms (comma-separated), and optional Replacement text.
Persistence
Rules are saved in your browser's local storage so they persist across sessions. They're automatically included when you run a compliance check.
Example rules
"Forbidden term" — flag any use of internal codenames. "Required phrase" — ensure every document includes a legal disclaimer. "Tone enforcement" — warn when passive voice exceeds a threshold.

🔗 CI/CD Webhook Automation

Trigger automatic documentation generation when code is pushed to your repository. DocCraft exposes a webhook endpoint that integrates with GitHub Actions, GitLab CI, Jenkins, or any HTTP-capable CI pipeline.

Endpoint
POST /api/webhooks/ci — include your DOCCRAFT_WEBHOOK_SECRET in the x-doccraft-secret header or as a Bearer token.
Payload
Send a JSON body with: repositoryUrl (required), branch, changedFiles (array), docType, audience, tone, and optional customRules. Native GitHub push payloads are also accepted.
Response
Returns a JSON object with the generated document, repo metadata, and source file list. Optionally set publishToGithub: true with a githubToken to auto-commit the result.
GitHub Actions
Example step: curl -X POST https://doccraft-ten.vercel.app/api/webhooks/ci -H "x-doccraft-secret: $SECRET" -d '{"repositoryUrl":"...", "docType":"release-notes"}'

✨ AI-Powered Refinement

Select any text in the editor and apply one-click AI actions to transform it:

Simplify

Rewrite in simpler language

Expand

Add more detail and depth

Add Example

Insert a practical example

Troubleshoot

Add troubleshooting steps

Make Concise

Remove fluff, keep substance

Diagrams

Generate Mermaid diagrams


🐙 GitHub Publishing

Publish your generated document directly to a GitHub repository. From the editor toolbar, click Publish, enter your GitHub repository URL and personal access token, then commit the document. DocCraft creates a clean commit with the generated Markdown.