* rename

* fix: readme

* fix: README
main
bokuweb 2020-01-24 19:44:43 +09:00 committed by GitHub
parent e479506a49
commit 3d6f36ef88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 129 additions and 123 deletions

8
Cargo.lock generated
View File

@ -75,8 +75,8 @@ version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "docx-core" name = "docx-rs"
version = "0.1.0" version = "0.2.0"
dependencies = [ dependencies = [
"pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "pretty_assertions 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"thiserror 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "thiserror 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -86,10 +86,10 @@ dependencies = [
] ]
[[package]] [[package]]
name = "docx-rs" name = "docx-wasm"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"docx-core 0.1.0", "docx-rs 0.2.0",
"wasm-bindgen 0.2.53 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.53 (registry+https://github.com/rust-lang/crates.io-index)",
"wasm-bindgen-test 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen-test 0.2.50 (registry+https://github.com/rust-lang/crates.io-index)",
] ]

View File

@ -8,19 +8,26 @@
[![GitHub Actions Status](https://github.com/bokuweb/docx-rs/workflows/Continuous%20Integration/badge.svg)](https://github.com/bokuweb/docx-rs/actions) [![GitHub Actions Status](https://github.com/bokuweb/docx-rs/workflows/Continuous%20Integration/badge.svg)](https://github.com/bokuweb/docx-rs/actions)
## install
```
[dependencies]
docx-rs = "0.2.0"
```
## Example ## Example
```rust ```rust
use docx_core::*; use docx_rs::*;
pub fn hello() -> Result<(), DocxError> { pub fn hello() -> Result<(), DocxError> {
let path = std::path::Path::new("./hello.docx"); let path = std::path::Path::new("./hello.docx");
let file = std::fs::File::create(&path).unwrap(); let file = std::fs::File::create(&path).unwrap();
Docx::new() Docx::new()
.add_paragraph(Paragraph::new().add_run(Run::new().add_text("Hello"))) .add_paragraph(Paragraph::new().add_run(Run::new().add_text("Hello")))
.build() .build()
.pack(file)?; .pack(file)?;
Ok(()) Ok(())
} }
``` ```

View File

@ -1,8 +1,21 @@
[package] [package]
name = "docx-core" name = "docx-rs"
version = "0.1.0" version = "0.2.0"
authors = ["bokuweb <bokuweb12@gmail.com>"] authors = ["bokuweb <bokuweb12@gmail.com>"]
repository = "https://github.com/bokuweb/docx-rs"
edition = "2018" edition = "2018"
license = "MIT"
readme = "../README.md"
description = "A .docx file generater with Rust/WebAssembly."
keywords = [
"office",
"word",
"docx",
]
[lib]
name = "docx_rs"
path = "src/lib.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@ -13,4 +26,5 @@ thiserror = "1.0"
zip = { version = "0.5", default-features = false } zip = { version = "0.5", default-features = false }
[dev-dependencies] [dev-dependencies]
pretty_assertions = "*" pretty_assertions = "0.6.1"

View File

@ -1,4 +1,4 @@
use docx_core::*; use docx_rs::*;
pub fn main() -> Result<(), DocxError> { pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./alignment.docx"); let path = std::path::Path::new("./alignment.docx");

View File

@ -1,4 +1,4 @@
use docx_core::*; use docx_rs::*;
pub fn main() -> Result<(), DocxError> { pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./comment.docx"); let path = std::path::Path::new("./comment.docx");

View File

@ -1,4 +1,4 @@
use docx_core::*; use docx_rs::*;
pub fn main() -> Result<(), DocxError> { pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./output/hello.docx"); let path = std::path::Path::new("./output/hello.docx");

View File

@ -1,4 +1,4 @@
use docx_core::*; use docx_rs::*;
pub fn main() -> Result<(), DocxError> { pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./history.docx"); let path = std::path::Path::new("./history.docx");

View File

@ -1,4 +1,4 @@
use docx_core::*; use docx_rs::*;
pub const DUMMY: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; pub const DUMMY: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";

View File

@ -1,4 +1,5 @@
use docx_core::*; use docx_rs::*;
pub fn main() -> Result<(), DocxError> { pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./numbering.docx"); let path = std::path::Path::new("./numbering.docx");

View File

@ -1,4 +1,4 @@
use docx_core::*; use docx_rs::*;
pub fn main() -> Result<(), DocxError> { pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./table.docx"); let path = std::path::Path::new("./table.docx");

View File

@ -1,6 +1,6 @@
extern crate docx_core; extern crate docx_rs;
use docx_core::*; use docx_rs::*;
pub const DUMMY: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; pub const DUMMY: &str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";

View File

@ -1,5 +1,5 @@
[package] [package]
name = "docx-rs" name = "docx-wasm"
version = "0.1.0" version = "0.1.0"
authors = ["bokuweb <bokuweb12@gmail.com>"] authors = ["bokuweb <bokuweb12@gmail.com>"]
edition = "2018" edition = "2018"
@ -11,7 +11,7 @@ crate-type = ["cdylib"]
[dependencies] [dependencies]
wasm-bindgen = "0.2.50" wasm-bindgen = "0.2.50"
docx-core = { path = "../docx-core" } docx-rs= { path = "../docx-core" }
[dev-dependencies] [dev-dependencies]
wasm-bindgen-test = "0.2" wasm-bindgen-test = "0.2"

View File

@ -1,18 +1,14 @@
use docx_core; use docx_rs;
pub fn create_special_indent( pub fn create_special_indent(
special_indent_kind: Option<docx_core::SpecialIndentKind>, special_indent_kind: Option<docx_rs::SpecialIndentKind>,
special_indent_size: Option<usize>, special_indent_size: Option<usize>,
) -> Option<docx_core::SpecialIndentType> { ) -> Option<docx_rs::SpecialIndentType> {
if let Some(kind) = special_indent_kind { if let Some(kind) = special_indent_kind {
let size = special_indent_size.unwrap_or_else(|| 0); let size = special_indent_size.unwrap_or_else(|| 0);
match kind { match kind {
docx_core::SpecialIndentKind::FirstLine => { docx_rs::SpecialIndentKind::FirstLine => Some(docx_rs::SpecialIndentType::FirstLine(size)),
Some(docx_core::SpecialIndentType::FirstLine(size)) docx_rs::SpecialIndentKind::Hanging => Some(docx_rs::SpecialIndentType::Hanging(size)),
}
docx_core::SpecialIndentKind::Hanging => {
Some(docx_core::SpecialIndentType::Hanging(size))
}
} }
} else { } else {
None None

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Comment(docx_core::Comment); pub struct Comment(docx_rs::Comment);
#[wasm_bindgen(js_name = createComment)] #[wasm_bindgen(js_name = createComment)]
pub fn create_comment(id: usize) -> Comment { pub fn create_comment(id: usize) -> Comment {
Comment(docx_core::Comment::new(id)) Comment(docx_rs::Comment::new(id))
} }
impl Comment { impl Comment {
pub fn take(self) -> docx_core::Comment { pub fn take(self) -> docx_rs::Comment {
self.0 self.0
} }
} }

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Delete(docx_core::Delete); pub struct Delete(docx_rs::Delete);
#[wasm_bindgen(js_name = createDelete)] #[wasm_bindgen(js_name = createDelete)]
pub fn create_delete(run: Run) -> Delete { pub fn create_delete(run: Run) -> Delete {
Delete(docx_core::Delete::new(run.take())) Delete(docx_rs::Delete::new(run.take()))
} }
impl Delete { impl Delete {
pub fn take(self) -> docx_core::Delete { pub fn take(self) -> docx_rs::Delete {
self.0 self.0
} }
} }

View File

@ -1,15 +1,15 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Docx(docx_core::Docx); pub struct Docx(docx_rs::Docx);
#[wasm_bindgen] #[wasm_bindgen]
#[allow(non_snake_case)] #[allow(non_snake_case)]
pub fn createDocx() -> Docx { pub fn createDocx() -> Docx {
Docx(docx_core::Docx::new()) Docx(docx_rs::Docx::new())
} }
#[wasm_bindgen] #[wasm_bindgen]

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Insert(docx_core::Insert); pub struct Insert(docx_rs::Insert);
#[wasm_bindgen(js_name = createInsert)] #[wasm_bindgen(js_name = createInsert)]
pub fn create_insert(run: Run) -> Insert { pub fn create_insert(run: Run) -> Insert {
Insert(docx_core::Insert::new(run.take())) Insert(docx_rs::Insert::new(run.take()))
} }
impl Insert { impl Insert {
pub fn take(self) -> docx_core::Insert { pub fn take(self) -> docx_rs::Insert {
self.0 self.0
} }
} }

View File

@ -1,22 +1,22 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Level(docx_core::Level); pub struct Level(docx_rs::Level);
#[wasm_bindgen(js_name = createLevel)] #[wasm_bindgen(js_name = createLevel)]
pub fn create_level(id: usize, start: usize, format: &str, text: &str, jc: &str) -> Level { pub fn create_level(id: usize, start: usize, format: &str, text: &str, jc: &str) -> Level {
let start = docx_core::Start::new(start); let start = docx_rs::Start::new(start);
let format = docx_core::NumberFormat::new(format); let format = docx_rs::NumberFormat::new(format);
let text = docx_core::LevelText::new(text); let text = docx_rs::LevelText::new(text);
let jc = docx_core::LevelJc::new(jc); let jc = docx_rs::LevelJc::new(jc);
Level(docx_core::Level::new(id, start, format, text, jc)) Level(docx_rs::Level::new(id, start, format, text, jc))
} }
impl Level { impl Level {
pub fn take(self) -> docx_core::Level { pub fn take(self) -> docx_rs::Level {
self.0 self.0
} }
} }
@ -26,7 +26,7 @@ impl Level {
pub fn indent( pub fn indent(
mut self, mut self,
left: usize, left: usize,
special_indent_kind: Option<docx_core::SpecialIndentKind>, special_indent_kind: Option<docx_rs::SpecialIndentKind>,
special_indent_size: Option<usize>, special_indent_size: Option<usize>,
) -> Self { ) -> Self {
let special_indent = create_special_indent(special_indent_kind, special_indent_size); let special_indent = create_special_indent(special_indent_kind, special_indent_size);

View File

@ -1,7 +1,7 @@
mod adaptors; mod adaptors;
mod comment; mod comment;
mod delete; mod delete;
mod docx; mod doc;
mod insert; mod insert;
mod level; mod level;
mod numbering; mod numbering;
@ -14,8 +14,7 @@ mod table_row;
pub use adaptors::*; pub use adaptors::*;
pub use comment::*; pub use comment::*;
pub use delete::*; pub use delete::*;
pub use docx::*; pub use doc::*;
pub use docx_core;
pub use insert::*; pub use insert::*;
pub use level::*; pub use level::*;
pub use numbering::*; pub use numbering::*;

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Numbering(docx_core::Numbering); pub struct Numbering(docx_rs::Numbering);
#[wasm_bindgen(js_name = createNumbering)] #[wasm_bindgen(js_name = createNumbering)]
pub fn create_numbering(id: usize) -> Numbering { pub fn create_numbering(id: usize) -> Numbering {
Numbering(docx_core::Numbering::new(id)) Numbering(docx_rs::Numbering::new(id))
} }
impl Numbering { impl Numbering {
pub fn take(self) -> docx_core::Numbering { pub fn take(self) -> docx_rs::Numbering {
self.0 self.0
} }
} }

View File

@ -1,14 +1,14 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Paragraph(docx_core::Paragraph); pub struct Paragraph(docx_rs::Paragraph);
#[wasm_bindgen(js_name = createParagraph)] #[wasm_bindgen(js_name = createParagraph)]
pub fn create_paragraph() -> Paragraph { pub fn create_paragraph() -> Paragraph {
Paragraph(docx_core::Paragraph::new()) Paragraph(docx_rs::Paragraph::new())
} }
#[wasm_bindgen] #[wasm_bindgen]
@ -19,52 +19,48 @@ impl Paragraph {
} }
pub fn add_insert(mut self, i: Insert) -> Paragraph { pub fn add_insert(mut self, i: Insert) -> Paragraph {
self.0 self.0.children.push(docx_rs::ParagraphChild::Insert(i.take()));
.children
.push(docx_core::ParagraphChild::Insert(i.take()));
self self
} }
pub fn add_delete(mut self, d: Delete) -> Paragraph { pub fn add_delete(mut self, d: Delete) -> Paragraph {
self.0 self.0.children.push(docx_rs::ParagraphChild::Delete(d.take()));
.children
.push(docx_core::ParagraphChild::Delete(d.take()));
self self
} }
pub fn add_bookmark_start(mut self, id: &str, name: &str) -> Paragraph { pub fn add_bookmark_start(mut self, id: &str, name: &str) -> Paragraph {
self.0 self.0.children.push(docx_rs::ParagraphChild::BookmarkStart(
.children docx_rs::BookmarkStart::new(id, name),
.push(docx_core::ParagraphChild::BookmarkStart( ));
docx_core::BookmarkStart::new(id, name),
));
self self
} }
pub fn add_bookmark_end(mut self, id: &str) -> Paragraph { pub fn add_bookmark_end(mut self, id: &str) -> Paragraph {
self.0.children.push(docx_core::ParagraphChild::BookmarkEnd( self.0
docx_core::BookmarkEnd::new(id), .children
)); .push(docx_rs::ParagraphChild::BookmarkEnd(docx_rs::BookmarkEnd::new(
id,
)));
self self
} }
pub fn add_comment_start(mut self, comment: Comment) -> Paragraph { pub fn add_comment_start(mut self, comment: Comment) -> Paragraph {
self.0 self.0
.children .children
.push(docx_core::ParagraphChild::CommentStart(Box::new( .push(docx_rs::ParagraphChild::CommentStart(Box::new(
docx_core::CommentRangeStart::new(comment.take()), docx_rs::CommentRangeStart::new(comment.take()),
))); )));
self self
} }
pub fn add_comment_end(mut self, id: usize) -> Paragraph { pub fn add_comment_end(mut self, id: usize) -> Paragraph {
self.0.children.push(docx_core::ParagraphChild::CommentEnd( self.0.children.push(docx_rs::ParagraphChild::CommentEnd(
docx_core::CommentRangeEnd::new(id), docx_rs::CommentRangeEnd::new(id),
)); ));
self self
} }
pub fn align(mut self, alignment_type: docx_core::AlignmentType) -> Paragraph { pub fn align(mut self, alignment_type: docx_rs::AlignmentType) -> Paragraph {
self.0.property = self.0.property.align(alignment_type); self.0.property = self.0.property.align(alignment_type);
self self
} }
@ -77,7 +73,7 @@ impl Paragraph {
pub fn indent( pub fn indent(
mut self, mut self,
left: usize, left: usize,
special_indent_kind: Option<docx_core::SpecialIndentKind>, special_indent_kind: Option<docx_rs::SpecialIndentKind>,
special_indent_size: Option<usize>, special_indent_size: Option<usize>,
) -> Paragraph { ) -> Paragraph {
let special_indent = create_special_indent(special_indent_kind, special_indent_size); let special_indent = create_special_indent(special_indent_kind, special_indent_size);
@ -86,15 +82,15 @@ impl Paragraph {
} }
pub fn numbering(mut self, id: usize, level: usize) -> Self { pub fn numbering(mut self, id: usize, level: usize) -> Self {
let id = docx_core::NumberingId::new(id); let id = docx_rs::NumberingId::new(id);
let level = docx_core::IndentLevel::new(level); let level = docx_rs::IndentLevel::new(level);
self.0.property = self.0.property.numbering(id, level); self.0.property = self.0.property.numbering(id, level);
self self
} }
} }
impl Paragraph { impl Paragraph {
pub fn take(self) -> docx_core::Paragraph { pub fn take(self) -> docx_rs::Paragraph {
self.0 self.0
} }
} }

View File

@ -1,14 +1,13 @@
use super::*; use docx_rs;
use docx_core;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Run(docx_core::Run); pub struct Run(docx_rs::Run);
#[wasm_bindgen(js_name = createRun)] #[wasm_bindgen(js_name = createRun)]
pub fn create_run() -> Run { pub fn create_run() -> Run {
Run(docx_core::Run::new()) Run(docx_rs::Run::new())
} }
#[wasm_bindgen] #[wasm_bindgen]
@ -21,25 +20,19 @@ impl Run {
pub fn add_delete_text(mut self, text: &str) -> Run { pub fn add_delete_text(mut self, text: &str) -> Run {
self.0 self.0
.children .children
.push(docx_core::RunChild::DeleteText(docx_core::DeleteText::new( .push(docx_rs::RunChild::DeleteText(docx_rs::DeleteText::new(text)));
text,
)));
self self
} }
pub fn add_tab(mut self) -> Run { pub fn add_tab(mut self) -> Run {
self.0 self.0.children.push(docx_rs::RunChild::Tab(docx_rs::Tab::new()));
.children
.push(docx_core::RunChild::Tab(docx_core::Tab::new()));
self self
} }
pub fn add_break(mut self, break_type: docx_core::BreakType) -> Run { pub fn add_break(mut self, break_type: docx_rs::BreakType) -> Run {
self.0 self.0
.children .children
.push(docx_core::RunChild::Break(docx_core::Break::new( .push(docx_rs::RunChild::Break(docx_rs::Break::new(break_type)));
break_type,
)));
self self
} }
@ -80,7 +73,7 @@ impl Run {
} }
impl Run { impl Run {
pub fn take(self) -> docx_core::Run { pub fn take(self) -> docx_rs::Run {
self.0 self.0
} }
} }

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct Table(docx_core::Table); pub struct Table(docx_rs::Table);
#[wasm_bindgen(js_name = createTable)] #[wasm_bindgen(js_name = createTable)]
pub fn create_table() -> Table { pub fn create_table() -> Table {
Table(docx_core::Table::new(vec![])) Table(docx_rs::Table::new(vec![]))
} }
impl Table { impl Table {
pub fn take(self) -> docx_core::Table { pub fn take(self) -> docx_rs::Table {
self.0 self.0
} }
} }
@ -34,7 +34,7 @@ impl Table {
self self
} }
pub fn align(mut self, v: docx_core::TableAlignmentType) -> Table { pub fn align(mut self, v: docx_rs::TableAlignmentType) -> Table {
self.0 = self.0.align(v); self.0 = self.0.align(v);
self self
} }

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct TableCell(docx_core::TableCell); pub struct TableCell(docx_rs::TableCell);
#[wasm_bindgen(js_name = createTableCell)] #[wasm_bindgen(js_name = createTableCell)]
pub fn create_table_cell() -> TableCell { pub fn create_table_cell() -> TableCell {
TableCell(docx_core::TableCell::new()) TableCell(docx_rs::TableCell::new())
} }
impl TableCell { impl TableCell {
pub fn take(self) -> docx_core::TableCell { pub fn take(self) -> docx_rs::TableCell {
self.0 self.0
} }
} }
@ -22,11 +22,11 @@ impl TableCell {
pub fn add_paragraph(mut self, p: Paragraph) -> TableCell { pub fn add_paragraph(mut self, p: Paragraph) -> TableCell {
self.0 self.0
.contents .contents
.push(docx_core::TableCellContent::Paragraph(p.take())); .push(docx_rs::TableCellContent::Paragraph(p.take()));
self self
} }
pub fn vertical_merge(mut self, t: docx_core::VMergeType) -> TableCell { pub fn vertical_merge(mut self, t: docx_rs::VMergeType) -> TableCell {
self.0.property = self.0.property.vertical_merge(t); self.0.property = self.0.property.vertical_merge(t);
self self
} }
@ -37,7 +37,7 @@ impl TableCell {
} }
pub fn width(mut self, v: usize) -> TableCell { pub fn width(mut self, v: usize) -> TableCell {
self.0.property = self.0.property.width(v, docx_core::WidthType::DXA); self.0.property = self.0.property.width(v, docx_rs::WidthType::DXA);
self self
} }
} }

View File

@ -1,18 +1,18 @@
use super::*; use super::*;
use docx_core; use docx_rs;
use wasm_bindgen::prelude::*; use wasm_bindgen::prelude::*;
#[wasm_bindgen] #[wasm_bindgen]
#[derive(Debug)] #[derive(Debug)]
pub struct TableRow(docx_core::TableRow); pub struct TableRow(docx_rs::TableRow);
#[wasm_bindgen(js_name = createTableRow)] #[wasm_bindgen(js_name = createTableRow)]
pub fn create_table_row() -> TableRow { pub fn create_table_row() -> TableRow {
TableRow(docx_core::TableRow::new(vec![])) TableRow(docx_rs::TableRow::new(vec![]))
} }
impl TableRow { impl TableRow {
pub fn take(self) -> docx_core::TableRow { pub fn take(self) -> docx_rs::TableRow {
self.0 self.0
} }
} }