Picking the ideal text importer

Previous topic - Next topic

Lynn

My current process in Scribus is this:
  • I download the base text of the book as a html file
  • I use a script to apply html header styles to components of the text (chapter titles, chapter numbers, first paragraph of chapter, first paragraph of scene, scene break ornaments)
  • I set the substitution fonts for bold, italic and bold italic to my body text style
  • I import using the html importer & reassign all those header styles to the component styles for the book

There are downsides of working directly from html are as follows:
  • I have to keep a cheatsheet reminding me which header style maps to which document style
  • Headers are all set to the bold substitution font. The only way to avoid this is to lie to Scribus and tell it to substitute bold fonts with the regular body text font. If course, then you have to manually add any bold text back in. I swear when I started this workflow in 1.4.8 it didn't bold the headers, but now it does.
  • There are a maximum of 6 html header types. This is plenty for an html document but I've started to run out - work title, author name, chapter title, chapter number, chapter title decoration, paragraph start, scene start and scene break gets me to eight. In a work with epistolary sections like letters or text messages I might have even more sections I need to flag. I've had to drop off the work and author names.

I've considered the libreoffice importer, but that would bring in far more information than I want. I don't want to retain any formatting from the original except bold, italics and the marking where the paragraph styles are.

Markdown automatically imports the bold and italic text as character styles, but retains all my other issues with HTML and adds a pandoc conversion step.

Theoretically, the text filter importer would work perfectly to map my "header" styles to paragraph styles without adding excess bolds. But unfortunately there's no way to set character styles in the text filter importer. I suppose I could regex the XML after importing with another script.

Any suggestions on whether I'm missing the perfect importer for my purposes, or should I keep on with html for now?

a.l.e

Personally, the HTML workflow looks very sensible to me.

Sadly, it probably does not work as well as it should.

Would you mind creating a few sample HTML that are ready to be imported into Scribus and a .sla document with the state before starting importing them and one .sla showing how they should ideally be once the HTML files have been imported?

Lynn

#2
I did a little test on my lunch break and made you some sample documents using the book templates I have shared on github & the first four chapters of The Great Gatsby. I tested importing both the html and a markdown version run through https://pandoc.org/app/. I didn't customize the samples much, since this is just a demo.

HTML Notes:
  • Removing the bold from the headers is tedious
  • Because all headers have the bold substitution font applied, even if I lie to Scribus and tell it to use my regular body text font for the substitute, it still presents a problem for the ornamented breaks, which should be in a different font. I was able to use find/replace to override the manual font applied to the ornaments, but you always have to run it multiple times to catch all of them. It was easier to strip them in the XML file.
  • Other than that, the HTML import is very smooth

Markdown Notes:
  • No bold text was assigned to the headers so there were no issues on import on that front
  • Unfortunately, all paragraphs that weren't a header weren't assigned any paragraph style (not even the default one). I don't remember noticing this issue in my tests last week, but I tried it twice in different versions of Scribus (see attached markdown example). This led to the body paragraphs not using the right line spacing.

GreatGatsbyTemplate is the file with no text imported; GreatGatsbyFinal is a cleaned up version with styles applied. Markdown shows the way the default paragraph style wasn't applied to the body text using the markdown importer. I couldn't upload the HTML file as .html, so I renamed it into a .txt file.

(oh, almost forgot - the list of substitutions I use is on page 21 of this PDF: https://github.com/notwhelmedyet/ScribusTypesetting/blob/main/ReferenceDocs/AbridgedTutorial.pdf)