A Zed editor extension for EPUB validation, powered by epub-lsp.
- Diagnostics: Real-time validation errors for EPUB package documents, content documents, and stylesheets
- OPF validation: Metadata, manifest, spine, and guide element checking
- XHTML validation: EPUB content document structure and compliance
- CSS validation: Stylesheet diagnostics within EPUB projects
- NCX validation: EPUB 2 navigation control document checking
| Extension | Type |
|---|---|
.opf |
OPF Package Document |
.xhtml |
EPUB XHTML Content Document |
.ncx |
NCX Navigation (EPUB 2) |
.html |
HTML |
.css |
CSS |
- Open Zed
- Go to Extensions (Cmd+Shift+X)
- Search for "Gubby"
- Click Install
The extension automatically downloads the appropriate LSP binary for your platform.
As a Dev Extension (for local development):
- Clone this repository
- In Zed, open the command palette (Cmd+Shift+P)
- Run "zed: install dev extension"
- Select this directory
See Zed's extension development docs for more details.
The extension automatically handles .opf, .xhtml, and .ncx files. For .html and .css files, which already have built-in language servers in Zed, add gubby explicitly in your Zed settings (~/.config/zed/settings.json or project .zed/settings.json):
{
"languages": {
"HTML": {
"language_servers": ["gubby", "..."]
},
"CSS": {
"language_servers": ["gubby", "..."]
}
}
}The "..." preserves Zed's default language servers for those languages.
To force specific file extensions to use a particular language, use file_types:
{
"file_types": {
"EPUB XHTML": ["xhtml"],
"OPF Package": ["opf"]
}
}cargo build --target wasm32-wasip1toba/epub-lsp - The EPUB LSP server that powers this extension.
MIT License - see LICENSE for details.