Cursor Chat and Composer produce structured markdown — architecture docs, code explanations, READMEs, API reference — with properly tagged code blocks that highlight beautifully in PDF. MarkdownTools converts them in 30 seconds.
Cursor Chat for explanations and answers. Composer for generating full documents and files.
Ask Cursor to explain a function, generate a PR description, summarize a codebase, or draft an architecture explanation. Responses appear as markdown messages with code blocks. Use the copy icon on the message to get the raw markdown.
Example prompts
Composer generates complete markdown files — READMEs, architecture docs, API reference, technical specs. The output is written to a file in your repo. Open the file, copy all, paste into MarkdownTools. Cleanest output Cursor produces.
Example prompts
Works for Chat output, Composer-generated files, and any markdown Cursor produces.
From the Chat panel: click the copy icon on the message, or select all and copy. From Composer: if the output was written to a file, open the file and copy its contents. If you prompted Cursor to generate markdown in-chat, use the message copy button. The raw markdown — including fenced code blocks with language tags — is what you want. About 5 seconds.
Open MarkdownTools and paste into the editor. The preview panel renders the output immediately — code blocks appear with syntax highlighting, headings build the document hierarchy, and any tables render with proper alignment. Cursor's code explanations typically include well-tagged code blocks that highlight correctly on the first paste. 5 seconds.
Choose Clean for technical documentation — it is the most compact theme and renders code blocks clearly. Classic works well for architecture docs and reports. Elegant is the right choice for technical proposals and client-facing materials. The live preview updates instantly. 10 seconds.
Click the PDF button. A professionally formatted PDF is generated server-side using Chromium and downloads to your device in under a second. Code blocks render with full syntax highlighting. Your content is never stored. 5 seconds.
MarkdownTools uses Shiki for syntax highlighting — the same engine that powers VS Code. Every language Cursor uses when generating code explanations renders with correct color highlighting in the PDF.
Cursor tags code blocks with the correct language identifier automatically. You rarely need to add or fix language tags before exporting. TypeScript, Python, SQL, Bash, Go, Rust, YAML, JSON — all highlight correctly out of the box.
TypeScript / JS
Full type annotation highlighting
Python / SQL
Keywords, strings, operators
Bash / YAML / JSON
Config and shell scripts
Typical Cursor Chat output
## Authentication Middleware
The `authMiddleware` function validates the JWT
and attaches the decoded user to the request:
```typescript
export async function authMiddleware(
req: NextRequest
): Promise<NextResponse | void> {
const token = req.headers.get('Authorization')
?.replace('Bearer ', '')
if (!token) {
return NextResponse.json(
{ error: 'Unauthorized' },
{ status: 401 }
)
}
const user = await verifyJWT(token)
req.headers.set('x-user-id', user.id)
}
```Different Cursor outputs behave differently. Here is what to expect.
Code explanations
Typically conversational in structure — prose paragraph, then code block, then analysis. May start with a brief intro sentence. Trim the intro if needed, then the rest converts cleanly.
Architecture decision records
Cursor generates these with consistent structure: Context, Decision, Consequences. The structure maps directly to headings and converts to a clean, standardized PDF. No editing needed.
README files
Composer-generated READMEs follow standard conventions — badges (exported as text), installation, usage, API reference. Remove badge markdown if you want a clean PDF without badge syntax showing.
PR descriptions
PR descriptions from Cursor Chat are well-structured with sections for summary, changes, and test plan. Convert directly using Classic theme for a shareable review document.
API reference docs
Function-level documentation with parameters, return values, and examples. Consistent structure across all functions makes the PDF look cohesive. Clean theme is the best choice.
Mermaid diagrams
Cursor sometimes generates Mermaid diagrams. These render as raw code blocks in MarkdownTools, not as visual diagrams. Delete the diagram block or replace with a text description before exporting.
Technical content that was born in an IDE and needs to live outside it — in a review, a handoff, or a stakeholder update.
Ask Cursor to generate an architecture decision record, system design overview, or component breakdown. Cursor produces structured markdown with clear heading hierarchy and code examples showing interfaces, data models, and configuration. Convert to PDF using the Clean theme for a shareable technical document that does not require the recipient to open an IDE.
Use Cursor Chat to generate a detailed PR description for a complex change — ask it to explain what changed, why, and what to test. The output is structured markdown with code snippets showing the before and after. Convert to PDF for async code review packages or for documenting significant changes in your project history.
Cursor Composer can generate a full README.md for a project or module. The output follows standard README conventions — installation, usage, API reference, examples — all in clean markdown with properly tagged code blocks. Convert to PDF for sharing with stakeholders who want project documentation without cloning the repo.
Ask Cursor to explain a complex piece of code — an algorithm, a database query, a set of middleware functions. Cursor produces prose explanations interleaved with annotated code blocks. This output is exactly what technical documentation should look like, and it converts to a clean PDF that can be shared with reviewers, included in handoff packages, or archived alongside the code.
Generate API endpoint documentation, function signatures, or SDK usage guides in Cursor. The structured markdown with code examples for each endpoint or function converts to a well-organized PDF reference document. Useful for internal API docs, client integration guides, or anything that needs to live outside the codebase as a standalone document.
Use Cursor to draft a technical proposal — a migration plan, a refactoring strategy, a library selection rationale. Cursor can structure the argument with sections for context, proposal, alternatives, and trade-offs, with code examples illustrating the proposed approach. Convert using the Elegant theme for a document that reads as a professional technical recommendation rather than a chat log.
Cursor has two main AI interaction surfaces that produce markdown output. The Chat panel is a conversation interface where you ask questions, request explanations, or prompt for documentation. Responses appear as markdown messages with code blocks, bullet lists, and headings. The copy icon on each message copies the raw markdown — use that, not a text selection from the rendered output.
Composer is a more powerful surface that generates or edits files directly. When you use Composer to generate a README, an architecture document, or a technical spec, it writes the content to a file as raw markdown. Open that file, copy the contents, and paste into MarkdownTools. Composer-generated files are typically the cleanest markdown Cursor produces — they are written to be read as documents, not as conversational responses.
Both surfaces produce code blocks tagged with the correct language identifier. Cursor infers the language from context and is accurate for common languages — TypeScript, Python, SQL, Bash, YAML, JSON, Go, Rust. This means code in your PDF will have syntax highlighting without any manual tagging on your part.
The most important thing about converting Cursor output to PDF is that code blocks render correctly. MarkdownTools uses Shiki for syntax highlighting — the same engine that powers VS Code. Every language that VS Code highlights, MarkdownTools highlights in the PDF. TypeScript, Python, SQL, Bash, Rust, Go, YAML, JSON, and dozens of others all render with full color highlighting.
Code blocks in the PDF use a monospace font and a slightly different background color to visually distinguish them from prose text. Long lines wrap rather than overflow, so wide code examples do not bleed off the page. For very long code blocks, the Clean theme is the most space-efficient choice — its compact line spacing fits more code on a page before a break.
The one scenario that does not work well is extremely long code blocks — more than 40 or 50 lines in a single block. These hit page breaks in the middle, which is visually awkward. If you are converting a file with long code blocks, break them into smaller examples with explanatory text between each block. This is also better technical writing practice — short, annotated examples are easier to follow than large monolithic ones.
Cursor generates several types of content that are particularly well-suited to PDF export. Architecture decision records (ADRs) are short, structured documents with a predictable format — context, decision, consequences. Cursor can generate a complete ADR from a brief description of a technical choice. The structured format converts directly to a clean PDF without any editing.
Function and module documentation follows a similar pattern: a description, parameters, return values, and one or two usage examples. Cursor generates this accurately for code it can see in your editor. The resulting markdown has a consistent structure across all documented functions, which means the PDF looks cohesive even for large API reference documents.
Inline code comments and explanation threads — the kind generated when you ask Cursor to explain a specific function or algorithm — produce more conversational markdown with less predictable structure. These are good candidates for a quick edit in the MarkdownTools editor before export: trim any conversational framing at the start, ensure the first line is a heading, and the rest converts cleanly.
You can prompt Cursor to generate output that is already optimized for PDF conversion. The most effective pattern: tell Cursor the output is a document. "Write this as a technical design document" or "generate a PDF-ready architecture overview for this codebase" causes Cursor to use heading structure, avoid conversational asides, and include explicit section breaks.
For reference documentation, ask Cursor to "document each function with a consistent format: description, parameters, return value, example." The consistent format means each function section looks identical in the PDF, which is exactly what reference documentation should look like.
For architecture documents that include diagrams, note that Mermaid or other diagram syntax does not render in MarkdownTools PDFs — only the raw code block will appear. If Cursor generates a Mermaid diagram as part of an architecture doc, either delete the diagram block or replace it with a text description of the same content before exporting.
Everything you need to know.
Click the copy icon on the Cursor Chat message — it appears when you hover over the message. Do not select the text and copy it, as that copies the rendered output which may have some formatting differences. The copy icon gives you the raw markdown string that Cursor generated, including fenced code blocks with language tags. Paste that directly into MarkdownTools.
Copy the output, paste, pick a theme, download. Syntax highlighting included. No signup, no cost.