parent
9b8c8b6e97
commit
1137e291a1
|
@ -135,6 +135,11 @@ impl Style {
|
|||
self
|
||||
}
|
||||
|
||||
pub fn line_spacing(mut self, spacing: LineSpacing) -> Self {
|
||||
self.paragraph_property = self.paragraph_property.line_spacing(spacing);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn indent(
|
||||
mut self,
|
||||
left: Option<i32>,
|
||||
|
|
|
@ -2,9 +2,11 @@ use crate::documents::*;
|
|||
use crate::types::*;
|
||||
|
||||
pub fn toc(level: i32) -> Style {
|
||||
let spacing = LineSpacing::new().after(100);
|
||||
Style::new(format!("ToC{}", level), StyleType::Paragraph)
|
||||
.name(format!("toc {}", level))
|
||||
.align(AlignmentType::Both)
|
||||
.snap_to_grid(false)
|
||||
.indent(Some((level - 1) * 200), None, None, Some((level - 1) * 100))
|
||||
.line_spacing(spacing)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "docx-wasm",
|
||||
"version": "0.4.18-rc39",
|
||||
"version": "0.4.18-rc40",
|
||||
"main": "dist/node/index.js",
|
||||
"browser": "dist/web/index.js",
|
||||
"author": "bokuweb <bokuweb12@gmail.com>",
|
||||
|
|
Loading…
Reference in New Issue