| DitaCraftThe best way to edit and publish your DITA files DitaCraft is a comprehensive Visual Studio Code extension for editing and publishing DITA (Darwin Information Typing Architecture) content. It provides syntax highlighting, validation, and seamless integration with DITA-OT for multi-format publishing. Features📝 DITA Editing
 🚀 One-Click Publishing
 👁️ Live Preview
 🎯 Quick File Creation
 ⚙️ Flexible Configuration
 InstallationFrom VS Code Marketplace
 From VSIX
 Local Installation for DevelopmentIf you want to install the plugin locally from source code for development or testing: Step 1: PrerequisitesEnsure you have the following installed: 
 Step 2: Get the Source CodeStep 3: Install DependenciesThis will install all required npm packages (~429 packages). Step 4: Compile TypeScriptThis compiles the TypeScript source code to JavaScript in the  Step 5: Package the ExtensionThis creates a  Note: If you don't have  Step 6: Install in VS CodeOption A: Install from VSIX 
 Option B: Run in Development Mode (Recommended for testing) 
 Step 7: Verify Installation
 Step 8: Configure DITA-OT (Optional, for publishing)
 Troubleshooting Local InstallationIssue:  | 
| Command | Shortcut | Description | 
|---|---|---|
| DITA: Validate Current File | Ctrl+Shift+V | Validate DITA syntax and structure | 
| DITA: Publish (Select Format) | Ctrl+Shift+B | Publish with format selection | 
| DITA: Publish to HTML5 | - | Quick publish to HTML5 | 
| DITA: Preview HTML5 | Ctrl+Shift+P | Show live HTML5 preview | 
| DITA: Create New Topic | - | Create new DITA topic | 
| DITA: Create New Map | - | Create new DITA map | 
| DITA: Create New Bookmap | - | Create new bookmap | 
| DITA: Configure DITA-OT Path | - | Set DITA-OT installation path | 
Configuration
Basic Settings
{
    "ditacraft.ditaOtPath": "C:\\DITA-OT-4.2.1",
    "ditacraft.defaultTranstype": "html5",
    "ditacraft.outputDirectory": "${workspaceFolder}/out"
}
All Settings
| Setting | Type | Default | Description | 
|---|---|---|---|
| ditacraft.ditaOtPath | string | "" | DITA-OT installation path | 
| ditacraft.defaultTranstype | string | "html5" | Default output format | 
| ditacraft.outputDirectory | string | "${workspaceFolder}/out" | Output directory | 
| ditacraft.autoValidate | boolean | true | Auto-validate on save | 
| ditacraft.previewAutoRefresh | boolean | true | Auto-refresh preview | 
| ditacraft.showProgressNotifications | boolean | true | Show progress notifications | 
| ditacraft.validationEngine | string | "xmllint" | Validation engine | 
| ditacraft.ditaOtArgs | array | [] | Custom DITA-OT arguments | 
| ditacraft.enableSnippets | boolean | true | Enable code snippets | 
Supported Output Formats
DitaCraft supports all DITA-OT transtypes:
- HTML5 - Modern responsive HTML
- PDF - PDF via Apache FOP
- XHTML - XHTML output
- EPUB - EPUB3 e-books
- HTML Help - Windows CHM files
- Markdown - Markdown conversion
Additional formats available through DITA-OT plugins.
Workflows
Publishing a Book
- Create bookmap: DITA: Create New Bookmap
- Create chapters: DITA: Create New Topic(multiple times)
- Edit bookmap to reference chapters
- Validate: Ctrl+Shift+V
- Publish: Ctrl+Shift+B→ Select format
- Open output folder
Previewing Changes
- Open .ditafile
- Make edits
- Press Ctrl+Shift+Pto preview
- Preview auto-refreshes on save
- Toggle between source and preview
Using Filters (DITAVAL)
{
    "ditacraft.ditaOtArgs": [
        "--filter=filters/product-a.ditaval"
    ]
}
Development
Building from Source
# Clone repository
git clone https://github.com/jyjeanne/ditacraft.git
cd ditacraft
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Run tests
npm test
# Package extension
npm run package
Project Structure
ditacraft/
├── src/
│   ├── extension.ts           # Entry point
│   ├── commands/              # Command handlers
│   │   ├── validateCommand.ts
│   │   ├── publishCommand.ts
│   │   ├── previewCommand.ts
│   │   └── fileCreationCommands.ts
│   ├── utils/
│   │   └── ditaOtWrapper.ts   # DITA-OT integration
│   └── preview/
│       └── previewPanel.ts    # WebView preview
├── syntaxes/
│   └── dita.tmLanguage.json   # Syntax highlighting
├── snippets/
│   └── dita.json              # Code snippets
├── package.json               # Extension manifest
└── README.md
Contributing
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (git checkout -b feature/amazing-feature)
- Commit your changes (git commit -m 'Add amazing feature')
- Push to the branch (git push origin feature/amazing-feature)
- Open a Pull Request
Troubleshooting
DITA-OT Not Found
Problem: Extension shows "DITA-OT not found"
Solution:
- Verify DITA-OT is installed
- Run "DITA: Configure DITA-OT Path" command
- Select DITA-OT installation directory
- Verify with "DITA: Validate Current File"
Validation Errors
Problem: Validation shows unexpected errors
Solution:
- Check XML syntax (closing tags, quotes, etc.)
- Verify DOCTYPE declaration
- Try switching validation engine: "ditacraft.validationEngine": "built-in"
Publishing Fails
Problem: Publishing fails with error
Solution:
- Check DITA-OT logs in Output panel
- Verify output directory is writable
- Check for syntax errors in DITA file
- Try publishing with --verboseflag:"ditacraft.ditaOtArgs": ["--verbose"]
Preview Not Showing
Problem: Preview panel is blank or shows error
Solution:
- Verify HTML5 output was generated
- Check output directory exists
- Look for JavaScript errors in Developer Tools
- Try republishing: Ctrl+Shift+B→ HTML5
Documentation
- Configuration Guide - Complete settings documentation
- Commands and Shortcuts - All commands and keybindings
- DITA-OT Integration - DITA-OT integration details
- Contributing Guide - Development and contribution guidelines
Resources
DITA Resources
VS Code Resources
Recent Updates
Version 0.1.0 Fixes
- ✅ Fixed preview and publishing with paths containing spaces - File paths with spaces (e.g., "Learn Rust/project") now work correctly
- ✅ Fixed DITA validation - Title element is now correctly validated as required (error, not warning) per DTD spec
- ✅ Enhanced DTD validation - Added proper DTD validation support with xmllint
- ✅ Improved error messages - Better, more descriptive validation and publishing error messages
- ✅ Fixed file path validation - Added comprehensive checks to ensure files (not directories) are being processed
- ✅ Added verbose logging - Detailed console logging for easier debugging
Changelog
See CHANGELOG.md for release history.
License
This project is licensed under the MIT License - see LICENSE file for details.
Support
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Issues
- 💬 Discussions: GitHub Discussions
- 📧 Email: jyjeanne@gmail.com
Acknowledgments
- DITA Open Toolkit team for the excellent DITA-OT
- OASIS DITA Technical Committee
- VS Code extension development community
- All contributors and users
Made with ❤️ for technical writers and documentation teams
