Book creation with scribus

Previous topic - Next topic

kroben

I have developed a toolkit, designed to be usable by everyone at a low cost, and therefore the target computer was chosen to be Raspberry Pi, used against an already existing TV. This means that the tool is currently only usable in a Linux environment.
I use it to write user manuals using scribus, for documentation of my projects, which are mainly in the "Home Automation" field. I use Raspberry pi as a control computer in various automation projects.

I have called the tool scibusbook, and it works well, but, it requires at least scribus version 1.6.x, for scribus scripts to work! The tool is built around scripts, and is therefore naturally open source, and works as a wrapper for scribus, to compile an e-book from the components of a book, produced in scribus. Some parts are completely automated, such as generating tables of contents for headings, images and tables, and also generating indexes from inserted index marks in the different chapters. There is also a function to generate a list of inserted TBD marks (To Be Determined), which, however, are not included in the final book.

The tool is a prototype, or "proof of design", to see if it is possible to imitate my previously used "Framemaker-bookfiles", which are far too expensive for private individuals. But before the final scribusbook a cleaning job is needed. For now, the design of templates is done in A4 page format, which requires some change of layout if another page format is chosen.

This all sounds great, but there is one ugly spot.
Generating tables only works partially from scribus scripts.
When the table is generated, from a text frame with inserted text in cvs format, generated from a spreadsheet, with ';' as a separator, all text gets the paragraph style "Default". There doesn't seem to be any way to access the text frame in a table cell from scripter. If the file is opened directly in scribus, after a little fiddling with a pointing device, you can select a cell and open it in "Story Editor", and there the style for the paragraph can be changed, so there is demonstrably a text frame in the cell. My current method is to run an OS command from a script, which, using the stream editor sed, changes the XML code of the sla file directly, which is not an acceptable solution.

If anyone has an idea for a solution to the problem, or just wants to try scribusbook, the manual and tar file for scribusbook can be downloaded from the website:

https://privat.bahnhof.se/wb187803/hygget251001/eng/scribusbook/scribusbook.html

/kroben

a.l.e

Interesting project!

First (a short one): In Scribus, the table are bad. Not sure you really want to support them in your framework.

Second (something slightly longer):

Currently, none of the actions typical for the text frames are available for the content of table cells.

As far as I can tell, the cells cannot be accessed by a name, and I'm not sure that it would be a good idea to implement that.

Also, I've tested setTextColor() and it refuses to apply when the selection is a table cell.

But there might be a simple way out:

  • Add a Scripter function to select a cell by it's "coordinates" (row and column).
  • Tweak all the text related to accept also table cells as targets.

I've created a ticket for this:
https://bugs.scribus.net/view.php?id=17655

No promise it will be added soon, but it might be an easy task.

Third:

I did not download the script, just had a look at the screenshots and documentation and it looks like an interesting work!

I will try to find some time for a deeper review and for trying it out...

Just one first thing: since you call it a prototype, you might rather target Scribus 1.7 instead of 1.6... 

kroben

I have updated scribusbook, and rewritten various bash scripts to python3. The GUI has been freed from scribus scripter code, as this combination caused instability problems. Each operation started from the GUI is now run separately, with startup scripts in bash, and scripter code started from scribus at startup. Each operation is described in the scribus document that is started.
A side effect of this is that each operation can be run directly from the command line in the terminal, or via a menu in a graphical file manager, which simplifies development and testing.

I have measured the performance in two of my Linux environments:
----------------------------------------------------------------
Testing scribusbook workflow for book scribusbook_eng (206 pages)
1) AMD Ryzen 5 3600 6-Core Processor (BogoMIPS: 7186.62) Linux Mint 22 Wilma
2) Raspberry Pi 5 16G Cortex-A76 (BogoMIPS: 108.00) Debian GNU/Linux 12 \n \l
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    AMD Ryzen 5 3600 6-Core Processor      |      Raspberry Pi 5 16G Cortex-A76
time ./book_masterpages_update_bash.sh     |
  ( real 8.323s  user 6.477s  sys 0.658s ) | ( real 24.060s  user 13.147s  sys 0.563s )
time ./book_TBD_update_bash.sh             |
  ( real 9.548s  user 7.350s  sys 0.580s ) | ( real 20.696s  user 14.671s  sys 0.415s )
time ./book_lists_update_bash.sh           |
  ( real 26.993s user 23.650s sys 0.725s ) | ( real 55.616s  user 48.519s  sys 0.643s )
time ./book_index_update_bash.sh           |
  ( real 11.624s user 9.901s  sys 0.508s ) | ( real 26.260s  user 21.492s  sys 0.352s )
time ./book_pdfs_update_bash.sh            |
  ( real 14.938s user 12.233s sys 1.000s ) | ( real 31.234s  user 24.033s  sys 0.820s )
time ./book_generate_ebook.sh              |
  ( real 4.108s  user 4.025s  sys 0.087s ) | ( real 74.004s  user 73.872s  sys 0.076s )
Time total                                 |
  ( real 75.534s user 63.636s sys 3.558s ) | ( real 231.87s  user 195.734s sys 2.869s )
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
It takes about twice as long on the Raspberry Pi compared to an AMD that is ten times more expensive.
The remarkable thing is that it takes 20 times more time to run ghostscript on the RPI.
One reason may be that some fonts were not installed, but had to be replaced during the process.

But now to the problems:
* I would like to import master pages and paragraph styles from a reference file in scribus format, but unfortunately this cannot be done via scripter.
* The scripter environment becomes unstable after a number of operations, if I mix tkinter and scripter, and I get no more information than a GUI message that scribus has crashed.

I think scribusbook is now good enough for my needs, but since there has been no major interest in the project, I am now taking a long and much-needed break, to document my projects instead. The response on the scribusbook forum reminds me of the well-listened music album of my youth, "The roaring Silence".

I would like to thank the people whose posts I was able to read on the scribus community forum. Without this help, I don't think I would have gotten over the threshold that always exists in a new environment. If you recognize some code in scribusbook, it's probably because it's your code. That's why I feel the need to return the loan, and hopefully with some interest.

Updated manual and project archive can be found at the link:
https://privat.bahnhof.se/wb187803/hygget251201/swe/scribusbook/

/kroben