From b76fd732de9a7e25711a98c543f3a139409802e5 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sun, 2 Apr 2023 13:39:31 +0200 Subject: Replace PDF extraction with manual pandoc conversion for story single pages --- src/works/stories.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/works/stories.rs') diff --git a/src/works/stories.rs b/src/works/stories.rs index 6f21aa4..943f079 100644 --- a/src/works/stories.rs +++ b/src/works/stories.rs @@ -74,6 +74,7 @@ impl Story { // TODO: // - 1-2 digit number with linebreak e.g. "Es ist 10\n geworden" not usable in texts // - currently only linebreaks before quotes, but not after paragraphs + /* let mut text = pdf_extract::extract_text(format!("docs/stories/{}", &self.path_to_document))?; @@ -92,6 +93,8 @@ impl Story { text = regex::Regex::new("\n\n")? .replace_all(&text, " ") .to_string(); + */ + let text = std::fs::read_to_string(format!("stories_html/{}.html", self.path_to_document.replace(".pdf", "")))?; anyhow::Ok(text).with_context(|| format!("Failed to extract text for {}", self.title)) } -- cgit v1.2.3