docx-rs 0.4.20

A .docx file writer with Rust/WebAssembly.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
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)
}