text-document-io 1.12.1

Import/export for text-document: plain text, Markdown, HTML, LaTeX, DOCX
Documentation
// Generated by Qleany v1.4.8 from feature_dtos.tera

use common::parser_tools::{
    DjotImportOptions, DocxExportOptions, EpubExportOptions, LatexExportOptions, OdtExportOptions,
    PdfExportOptions,
};
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportPlainTextDto {
    pub plain_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportPlainTextDto {
    pub plain_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportMarkdownDto {
    pub markdown_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportMarkdownResultDto {
    pub block_count: i64,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportMarkdownDto {
    pub markdown_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportDjotDto {
    pub djot_text: String,
    /// Per-feature selection for the optional block attributes (alignment, line
    /// height, direction, non-breakable lines, background color). Defaults to
    /// all enabled — the fully lossless import.
    pub options: DjotImportOptions,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportDjotResultDto {
    pub block_count: i64,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportDjotDto {
    pub djot_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportHtmlDto {
    pub html_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ImportHtmlResultDto {
    pub block_count: i64,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportHtmlDto {
    pub html_text: String,
}

// Hand-added (M-T3, mirrors `ExportDocxDto.options`/`ExportEpubDto.options`/
// `ExportOdtDto.options`): `document_class`/`include_preamble` were declared here as flat
// scalar fields (the qleany manifest cannot express a struct field — see the `replace_text`
// NOTE in qleany.yaml), and `omit_images` was hand-added later still flat. M-T3 folds all three
// into `LatexExportOptions`, the options struct every sibling export DTO already carries.
// `#[serde(default)]` so an older `{}` payload still loads. If this file is regenerated, the
// generator restores the flat `document_class`/`include_preamble` fields — drop those and
// re-add `options` instead (or declare the change in the manifest).
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportLatexDto {
    #[serde(default)]
    pub options: LatexExportOptions,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportLatexResultDto {
    pub latex_text: String,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportDocxDto {
    pub output_path: String,
    // Hand-added (mirrors `ImportDjotDto.options`): page geometry + base typography for a
    // manuscript-style export. `#[serde(default)]` so an older `{ output_path }` payload still
    // loads. If this file is regenerated, re-add this field (or declare it in the manifest).
    #[serde(default)]
    pub options: DocxExportOptions,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportDocxResultDto {
    pub file_path: String,
    pub paragraph_count: i64,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportEpubDto {
    pub output_path: String,
    // Hand-added (mirrors `ExportDocxDto.options`): book-level metadata (title, author,
    // language, reading direction) for the EPUB package. `#[serde(default)]` so an older
    // `{ output_path }` payload still loads. If this file is regenerated, re-add this field (or
    // declare it in the manifest).
    #[serde(default)]
    pub options: EpubExportOptions,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportEpubResultDto {
    pub file_path: String,
    pub chapter_count: i64,
}
// Hand-added (mirrors `ExportDocxDto`/`ExportEpubDto`): M-T2a, the ODT (OpenDocument Text)
// writer. `options` follows the same `#[serde(default)]` rule as its siblings so an older
// `{ output_path }` payload still loads. If this file is regenerated, re-add this struct pair
// (or declare them in the manifest).
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportOdtDto {
    pub output_path: String,
    #[serde(default)]
    pub options: OdtExportOptions,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportOdtResultDto {
    pub file_path: String,
    pub paragraph_count: i64,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportPdfDto {
    pub output_path: String,
    // Hand-added (mirrors `ExportDocxDto.options`/`ExportEpubDto.options`): page geometry +
    // typography + embedded font bytes for the PDF export. `#[serde(default)]` so an older
    // `{ output_path }` payload still loads. If this file is regenerated, re-add this field (or
    // declare it in the manifest).
    #[serde(default)]
    pub options: PdfExportOptions,
}
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
pub struct ExportPdfResultDto {
    pub file_path: String,
    pub page_count: i64,
}