Quick Export
Export your current document with a single click:Export Implementation
Here’s how CodeInk exports documents:Filename Generation
CodeInk automatically generates smart filenames based on your document content:Title Extraction
The filename is extracted from the first H1 heading in your document:My-Project-Documentation.md
If your document doesn’t have an H1 heading, the file will be named
document.md.Sanitization Rules
Filenames are sanitized to ensure compatibility:-
Allowed Characters:
- Letters:
a-z,A-Z - Numbers:
0-9 - Accented characters:
á,é,í,ó,ú,ü,ñ - Hyphens:
-
- Letters:
-
Removed Characters:
- Special characters:
@,#,$,%, etc. - Punctuation:
:,;,?,!, etc. - Symbols:
&,*,+,=, etc.
- Special characters:
-
Space Conversion:
- All spaces become hyphens:
→- - Multiple spaces collapse to single hyphen:
→-
- All spaces become hyphens:
Example Transformations
| Document Title | Exported Filename |
|---|---|
Getting Started Guide | Getting-Started-Guide.md |
API: Documentation v2.0 | API-Documentation-v20.md |
How to use CodeInk? | How-to-use-CodeInk.md |
Feature #123: Export | Feature-123-Export.md |
| (no heading) | document.md |
Export Format
What’s Exported
The exported file contains the complete raw markdown from the editor, including:- All headings and text
- Code blocks with language tags
- Lists (ordered and unordered)
- Links and images
- Tables
- Blockquotes
- HTML comments
- Mermaid diagram code
- KaTeX math expressions
- Horizontal rules
- Task lists
What’s Not Exported
File Characteristics
- Format: Plain text markdown
- Encoding: UTF-8
- Line Endings: Preserved from editor (typically LF on Unix-like systems, CRLF on Windows)
- MIME Type:
text/markdown;charset=utf-8
Using Exported Files
Your exported markdown files work with any markdown-compatible application:Version Control
Commit to Git repositories (GitHub, GitLab, Bitbucket)
Static Site Generators
Use with Jekyll, Hugo, Gatsby, Next.js, etc.
Documentation Tools
Import into Docusaurus, MkDocs, GitBook, Mintlify
Note-Taking Apps
Open in Obsidian, Notion, Bear, Typora, or any markdown editor
Browser Download Behavior
When you click the export button, your browser handles the download:Chrome / Edge
- File downloads to your default Downloads folder
- Notification appears at bottom of browser
- Click notification to open file or folder
Firefox
- Dialog appears asking where to save
- Option to remember choice for
.mdfiles - Downloads to chosen location
Safari
- File downloads to Downloads folder
- Download icon appears in toolbar
- Click to view downloaded files
Export Button UI
The export button is styled consistently with other toolbar buttons:Button Features
- Icon: Download arrow pointing down
- Label: “MD” (visible on desktop)
- Tooltip: “Export as Markdown” on hover
- Responsive: Icon-only on mobile
Technical Details
Blob Creation
CodeInk uses the Blob API to create the file:Object URL
A temporary URL is created for the download:Download Trigger
The download is triggered by creating a temporary link element:Best Practices
Use Descriptive H1 Headings
Start your document with a clear H1 heading to generate a meaningful filename.
Export Before Major Edits
Create a backup by exporting before making significant changes to your document.
Organize Downloads
Create folders for exported documents to keep them organized by project or topic.
Use Version Control
For important documents, export to a Git repository to track changes over time.
Common Use Cases
1. Backup Important Work
Export documents regularly to create backups outside of your browser:2. Share with Collaborators
Send markdown files to team members who use different tools:- Export the document
- Share via email, Slack, or other messaging
- Recipients can open in their preferred markdown editor
3. Publish to GitHub
Export documents for use in GitHub repositories:4. Import to CMS
Many content management systems accept markdown:- Export from CodeInk
- Upload to your CMS or static site generator
- Publish to your website
Limitations
Future Export Options
While CodeInk currently only exports to markdown, here are some potential future export formats:- PDF: Export rendered preview as PDF
- HTML: Export as standalone HTML file
- DOCX: Export to Microsoft Word format
- Batch Export: Export all documents as a ZIP file
Want these features? Let the CodeInk team know what export formats would be most useful for your workflow!
Comparison with Auto-Save
| Feature | Auto-Save | Export |
|---|---|---|
| Location | Browser IndexedDB | File system |
| Trigger | Automatic (1s after typing) | Manual (button click) |
| Format | JSON (structured data) | Plain markdown text |
| Portability | Browser-specific | Universal |
| Backup | Limited to browser | Full control |
| Sharing | Not shareable | Easy to share |