docxdriver 0.2.7__tar.gz → 0.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {docxdriver-0.2.7 → docxdriver-0.3.1}/Cargo.lock +5 -5
- {docxdriver-0.2.7 → docxdriver-0.3.1}/Cargo.toml +1 -1
- {docxdriver-0.2.7 → docxdriver-0.3.1}/PKG-INFO +1 -1
- docxdriver-0.3.1/crates/docxdriver-core/assets/blank.docx +0 -0
- docxdriver-0.3.1/crates/docxdriver-core/examples/plan_scaling.rs +43 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/api.rs +512 -28
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/bin/generate_typed_schema.rs +25 -2
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/comments.rs +68 -20
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/headers.rs +38 -6
- docxdriver-0.3.1/crates/docxdriver-core/src/commands/layout.rs +395 -0
- docxdriver-0.3.1/crates/docxdriver-core/src/commands/lists.rs +141 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/mod.rs +193 -56
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/readonly.rs +9 -2
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/revisions.rs +35 -2
- docxdriver-0.3.1/crates/docxdriver-core/src/commands/table_structure.rs +100 -0
- docxdriver-0.3.1/crates/docxdriver-core/src/commands/tables.rs +128 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/typed.rs +552 -214
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/document.rs +97 -29
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/build.rs +48 -23
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/chrome.rs +3 -1
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/ctx.rs +44 -5
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/input.rs +66 -9
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/mod.rs +2 -8
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/parse.rs +11 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/render.rs +14 -4
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/styles.rs +92 -30
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/surface.rs +24 -1
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/segments.rs +1 -23
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/fixtures/projection-parity/parity.docx +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/fixtures/projection-parity/prior-projection.json +190 -190
- docxdriver-0.3.1/crates/docxdriver-core/tests/formatting_fidelity.rs +840 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/html_e2e.rs +13 -22
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/typed_api.rs +484 -17
- docxdriver-0.3.1/crates/docxdriver-python/python/docxdriver/repl/prelude.py +3 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1/crates/docxdriver-python}/python/docxdriver/repl/quotes.py +22 -15
- docxdriver-0.3.1/python/docxdriver/repl/prelude.py +3 -0
- {docxdriver-0.2.7/crates/docxdriver-python → docxdriver-0.3.1}/python/docxdriver/repl/quotes.py +22 -15
- docxdriver-0.2.7/crates/docxdriver-core/assets/blank.docx +0 -0
- docxdriver-0.2.7/crates/docxdriver-core/src/commands/layout.rs +0 -216
- docxdriver-0.2.7/crates/docxdriver-python/python/docxdriver/repl/prelude.py +0 -3
- docxdriver-0.2.7/python/docxdriver/repl/prelude.py +0 -3
- {docxdriver-0.2.7 → docxdriver-0.3.1}/README.md +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/Cargo.toml +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/README.md +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/equations.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/commands/reading.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/README.md +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/assets.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/compact.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/mathml_omml.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/omml_latex.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/html/omml_mathml.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/lib.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/media.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/outcome.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/src/package.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/README.md +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/fixtures/projection-parity/features.json +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/fixtures/ts-reference.docx +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/interop.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/package_layout.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/projection_parity.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-core/tests/spike.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/.gitignore +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/Cargo.toml +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/README.md +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/python/docxdriver/__init__.py +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/python/docxdriver/repl/__init__.py +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/python/docxdriver/repl/host.py +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/src/lib.rs +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/crates/docxdriver-python/tests/test_host.py +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/pyproject.toml +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/python/docxdriver/__init__.py +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/python/docxdriver/repl/__init__.py +0 -0
- {docxdriver-0.2.7 → docxdriver-0.3.1}/python/docxdriver/repl/host.py +0 -0
|
@@ -416,7 +416,7 @@ dependencies = [
|
|
|
416
416
|
|
|
417
417
|
[[package]]
|
|
418
418
|
name = "docxdriver-cli"
|
|
419
|
-
version = "0.
|
|
419
|
+
version = "0.3.1"
|
|
420
420
|
dependencies = [
|
|
421
421
|
"clap",
|
|
422
422
|
"docxdriver-core",
|
|
@@ -427,7 +427,7 @@ dependencies = [
|
|
|
427
427
|
|
|
428
428
|
[[package]]
|
|
429
429
|
name = "docxdriver-core"
|
|
430
|
-
version = "0.
|
|
430
|
+
version = "0.3.1"
|
|
431
431
|
dependencies = [
|
|
432
432
|
"hex",
|
|
433
433
|
"latex2mathml",
|
|
@@ -444,7 +444,7 @@ dependencies = [
|
|
|
444
444
|
|
|
445
445
|
[[package]]
|
|
446
446
|
name = "docxdriver-mcp"
|
|
447
|
-
version = "0.
|
|
447
|
+
version = "0.3.1"
|
|
448
448
|
dependencies = [
|
|
449
449
|
"axum",
|
|
450
450
|
"cap-std",
|
|
@@ -462,7 +462,7 @@ dependencies = [
|
|
|
462
462
|
|
|
463
463
|
[[package]]
|
|
464
464
|
name = "docxdriver-python"
|
|
465
|
-
version = "0.
|
|
465
|
+
version = "0.3.1"
|
|
466
466
|
dependencies = [
|
|
467
467
|
"docxdriver-core",
|
|
468
468
|
"pyo3",
|
|
@@ -471,7 +471,7 @@ dependencies = [
|
|
|
471
471
|
|
|
472
472
|
[[package]]
|
|
473
473
|
name = "docxdriver-wasm"
|
|
474
|
-
version = "0.
|
|
474
|
+
version = "0.3.1"
|
|
475
475
|
dependencies = [
|
|
476
476
|
"docxdriver-core",
|
|
477
477
|
"js-sys",
|
|
Binary file
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//! Plan review scaling probe: `cargo run --release -p docxdriver-core --example plan_scaling -- PARAS OPS`.
|
|
2
|
+
use std::io::Write;
|
|
3
|
+
use std::time::Instant;
|
|
4
|
+
|
|
5
|
+
use docxdriver_core::{execute_plan, ChangeMode, EditOp, ParagraphAddress, Plan, PlanRequest, PlanResult, SourceHash};
|
|
6
|
+
|
|
7
|
+
fn package(body: &str) -> Vec<u8> {
|
|
8
|
+
let mut w = zip::ZipWriter::new(std::io::Cursor::new(Vec::new()));
|
|
9
|
+
let o = zip::write::SimpleFileOptions::default();
|
|
10
|
+
let parts = [
|
|
11
|
+
("[Content_Types].xml", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Types xmlns=\"http://schemas.openxmlformats.org/package/2006/content-types\"><Default Extension=\"rels\" ContentType=\"application/vnd.openxmlformats-package.relationships+xml\"/><Default Extension=\"xml\" ContentType=\"application/xml\"/><Override PartName=\"/word/document.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\"/></Types>".to_string()),
|
|
12
|
+
("_rels/.rels", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"><Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument\" Target=\"word/document.xml\"/></Relationships>".to_string()),
|
|
13
|
+
("word/document.xml", body.to_string()),
|
|
14
|
+
("word/_rels/document.xml.rels", "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\"></Relationships>".to_string()),
|
|
15
|
+
];
|
|
16
|
+
for (n, c) in parts {
|
|
17
|
+
w.start_file(n, o).unwrap();
|
|
18
|
+
w.write_all(c.as_bytes()).unwrap();
|
|
19
|
+
}
|
|
20
|
+
w.finish().unwrap().into_inner()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
fn main() {
|
|
24
|
+
let args: Vec<usize> = std::env::args().skip(1).map(|a| a.parse().unwrap()).collect();
|
|
25
|
+
let (paras, ops) = (args.first().copied().unwrap_or(1500), args.get(1).copied().unwrap_or(300));
|
|
26
|
+
let body: String = (0..paras)
|
|
27
|
+
.map(|i| format!("<w:p w14:paraId=\"{:08X}\"><w:r><w:t>Paragraph {i} says the tenant shall pay rent within thirty days of notice.</w:t></w:r></w:p>", i + 1))
|
|
28
|
+
.collect();
|
|
29
|
+
let bytes = package(&format!("<?xml version=\"1.0\" encoding=\"UTF-8\"?><w:document xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\"><w:body>{body}</w:body></w:document>"));
|
|
30
|
+
let operations = (0..ops)
|
|
31
|
+
.map(|i| EditOp::ReplaceText {
|
|
32
|
+
at: ParagraphAddress::id(format!("{:08X}", (i * paras / ops) + 1)),
|
|
33
|
+
select: "thirty days".into(),
|
|
34
|
+
with: "sixty days".into(),
|
|
35
|
+
occurrence: None,
|
|
36
|
+
})
|
|
37
|
+
.collect();
|
|
38
|
+
let plan = Plan { base: SourceHash::from_bytes(&bytes), author: "bench".into(), change_mode: ChangeMode::Track, ops: operations };
|
|
39
|
+
let t = Instant::now();
|
|
40
|
+
let result = execute_plan(&bytes, &PlanRequest { plan, preview_key: None });
|
|
41
|
+
let ok = matches!(result, PlanResult::Previewed { .. });
|
|
42
|
+
println!("paras={paras} ops={ops} previewed={ok} elapsed={:?}", t.elapsed());
|
|
43
|
+
}
|