Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
driver-deploy-2 committed May 20, 2024
1 parent 737fea3 commit 20d07a3
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# DOXC-PARSER

This package uses the [docx-rs](https://crates.io/crates/docx-rust) crate to parse docx files. It subsequently converts the parsed docx file into Markdown format. Alternatively, it can also be used to convert docx files into JSON format, where only the structure relevant for creating Markdown documents is kept.

```bash
$ docx-parser -h

Processes a DOCX file and outputs as Markdown or JSON

Usage: docx-parser [OPTIONS] <FILE>

Arguments:
<FILE> The input DOCX file

Options:
-o, --output <OUTPUT> Sets the output destination. Default is console
-f, --format <FORMAT> Sets the output format. Default is markdown. Options: md, json
-h, --help Print help
-V, --version Print version
```

## Example

```rust
use docx_parser::MarkdownDocument;

let markdown_doc = MarkdownDocument::from_file("./test/tables.docx");
let markdown = markdown_doc.to_markdown(true);
let json = markdown_doc.to_json(true);

println!("\n\n{}", markdown);
println!("\n\n{}", json);
```

## Development

```bash
cargo update
cargo test
cargo build --release
```

0 comments on commit 20d07a3

Please sign in to comment.