-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
737fea3
commit 20d07a3
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |