Shiva

Shiva library: Implementation in Rust of a parser and generator for documents of any type
Features
- Common Document Model (CDM) for all document types
- Parsers produce CDM
- Generators consume CDM
Common Document Model

Supported document types
| Document type | Parse | Generate |
|---|---|---|
| Plain text | + | + |
| Markdown | + | + |
| HTML | + | + |
| + | + | |
| JSON | + | + |
| XML | + | + |
| CSV | + | + |
| RTF | + | + |
| DOCX | + | + |
| XLS | + | - |
| XLSX | + | + |
| ODS | + | + |
| Typst | - | + |
Parse document features
| Document type | Header | Paragraph | List | Table | Image | Hyperlink | PageHeader | PageFooter |
|---|---|---|---|---|---|---|---|---|
| Plain text | - | + | - | - | - | - | - | - |
| Markdown | + | + | + | + | + | + | - | - |
| HTML | + | + | + | + | + | + | - | - |
| - | + | + | - | - | - | - | - | |
| DOCX | + | + | + | + | - | + | - | - |
| RTF | + | + | + | + | - | + | + | + |
| JSON | + | + | + | + | - | + | + | + |
| XML | + | + | + | + | + | + | + | + |
| CSV | - | - | - | + | - | - | - | - |
| XLS | - | - | - | + | - | - | - | - |
| XLSX | - | - | - | + | - | - | - | - |
| ODS | - | - | - | + | - | - | - | - |
Generate document features
| Document type | Header | Paragraph | List | Table | Image | Hyperlink | PageHeader | PageFooter |
|---|---|---|---|---|---|---|---|---|
| Plain text | + | + | + | + | - | + | + | + |
| Markdown | + | + | + | + | + | + | + | + |
| HTML | + | + | + | + | + | + | - | - |
| + | + | + | + | + | + | + | + | |
| DOCX | + | + | + | + | + | + | - | - |
| RTF | + | + | + | + | + | + | - | - |
| JSON | + | + | + | + | - | + | + | + |
| XML | + | + | + | + | + | + | + | + |
| CSV | - | - | - | + | - | - | - | - |
| XLSX | - | - | - | + | - | - | - | - |
| ODS | - | - | - | + | - | - | - | - |
| Typst | + | + | + | + | + | + | + | + |
Usage Shiva library
Cargo.toml
[]
= { = "1.4.9", = ["html", "markdown", "text", "pdf", "json",
"csv", "rtf", "docx", "xml", "xls", "xlsx", "ods", "typst"] }
main.rs
Shiva CLI & Server
Build executable Shiva CLI and Shiva Server
Run executable Shiva CLI
Run Shiva Server
Who uses Shiva
Contributing
I would love to see contributions from the community. If you experience bugs, feel free to open an issue. If you would like to implement a new feature or bug fix, please follow the steps:
- Do fork
- Add comment to the issue that you are going to work on it
- Create pull request
If you would like add new document type, you need to implement the following traits:
Required: shiva::core::TransformerTrait
Optional: shiva::core::TransformerWithImageLoaderSaverTrait (If images store outside of document for example: HTML, Markdown)