English | 中文 Project Introduction WordZero is a Golang-based Word document manipulation library that provides basic document creation and m…
English | 中文 Project Introduction WordZero is a Golang-based Word document manipulation library that provides basic document creation and m…
English | 中文
WordZero is a Golang-based Word document manipulation library that provides basic document creation and modification operations. This library follows the latest Office Open XML (OOXML) specifications and focuses on supporting modern Word document format (.docx).
If you need to work with Excel documents, we highly recommend Excelize —— the most popular Go library for Excel operations:
Perfect Combination: WordZero handles Word documents, Excelize handles Excel documents, together providing comprehensive Office document manipulation capabilities for your Go projects.
// WordZero + Excelize combination example
import (
"github.com/zerx-lab/wordZero/pkg/document"
"github.com/qax-os/excelize/v2"
)
// Create Word report
doc := document.New()
doc.AddParagraph("Data Analysis Report").SetStyle(style.StyleHeading1)
// Create Excel data sheet
xlsx := excelize.NewFile()
xlsx.SetCellValue("Sheet1", "A1", "Data Item")
xlsx.SetCellValue("Sheet1", "B1", "Value")go get github.com/zerx-lab/wordZeroWe recommend using versioned installation:
# Install latest version
go get github.com/zerx-lab/wordZero@latest
# Install specific version
go get github.com/zerx-lab/[email protected]…………" + go // Code block example func main() { fmt.Println("Hello, WordZero!") } + "```" + `
Conversion complete!`
// Convert to Word document
doc, err := converter.ConvertString(markdownText, nil)
if err != nil {
log.Fatal(err)
}
// Save Word document
err = doc.Save("markdown_example.docx")
if err != nil {
log.Fatal(err)
}
// File conversion
err = converter.ConvertFile("input.md", "output.docx", nil)
if err != nil {
log.Fatal(err)
}
}
### Document Pagination and Paragraph Deletion Example ✨ **New**
…
## Documentation and Examples
### Complete Documentation
**Available in multiple languages**:
- **English**: [ Wiki Documentation](https://github.com/zerx-lab/wordZero/wiki/en-Home)
- **中文**: [ 中文文档](https://github.com/zerx-lab/wordZero/wiki)
**Key Documentation**:
- [** Quick Start**](https://github.com/zerx-lab/wordZero/wiki/en-Quick-Start) - Beginner's guide
- [**⚡ Feature Overview**](https://github.com/zerx-lab/wordZero/wiki/en-Feature-Overview) - Detailed description of all features
- [** Performance Benchmarks**](https://github.com/zerx-lab/wordZero/wiki/en-Performance-Benchmarks) - Cross-language performance comparison analysis
- [**️ Project Structure**](https://github.com/zerx-lab/wordZero/wiki/en-Project-Structure) - Project architecture and code organization
### Usage Examples
See example code in the `examples/` directory:
- `examples/basic/` - Basic functionality demo
- `examples/style_demo/` - Style system demo
- `examples/table/` - Table functionality demo
- `examples/formatting/` - Formatting demo
- `examples/page_settings/` - Page settings demo
- `examples/advanced_features/` - Advanced features comprehensive demo
- `examples/template_demo/` - Template functionality demo
- `examples/template_inheritance_demo/` - Template inheritance feature demo ✨ **New**
- `examples/template_image_demo/` - Image placeholder template demo ✨ **New**
- `examples/markdown_conversion/` - Markdown to Word feature demo ✨ **New**
- `examples/pagination_deletion_demo/` - Pagination and paragraph deletion demo ✨ **New**
Run examples:
```bash
# Run basic functionality demo
go run ./examples/basic/
# Run style demo
go run ./examples/style_demo/
# Run table demo
go run ./examples/table/
# Run template inheritance demo
go run ./examples/template_inheritance_demo/
# Run image placeholder template demo
go run ./examples/template_image_demo/
# Run Markdown to Word demo
go run ./examples/markdown_conversion/View complete feature list: Feature Overview
WordZero excels in performance, verified through comprehensive benchmarks:
| Language | Average Execution Time | Relative Performance |
|---|---|---|
| Golang | 2.62ms | 1.00× |
| JavaScript | 9.63ms | 3.67× |
| Python | 55.98ms | 21.37× |
View detailed performance analysis: Performance Benchmarks
…View detailed structure description: Project Structure
The project includes multiple logo variations for different use cases:
Issues and Pull Requests are welcome! Please ensure before submitting code:
This project is licensed under the MIT License. See the LICENSE file for details.
More Resources:
No open issues yet, or sync has not completed.