lute-v3 icon indicating copy to clipboard operation
lute-v3 copied to clipboard

A way to change a book's number of words per page

Open Inquisitor-Ignotorum opened this issue 9 months ago • 1 comments

A way to change a book's number of words per page

Hello. For a long time I was completely satisfied with the default 250 words per page, but at some point I felt like changing that number. Now I always use my new choice when creating a new Lute book but would like to also make the existing books have the same number of words per page. Re-importing a sizable book collection and carefully setting each book's information will be complicated and time-consuming, and there may be cases where we no longer have the original ebook file or do not remember the text's source website. It would be very convenient to be able to change a book's number of words per page to fit a new preference, perhaps via each book's Edit Book screen.

======================================================================

Simple exporting of books from within Lute

I often find that I need to export and then use sizable parts (many pages) of a Lute book or even the entire book. It is not always possible to retrieve the source material because we may no longer have the original ebook file or may not remember the text's source website. It would be very useful to be able to export a Lute book as a .txt file to the user's folder of choice.

Each book's options menu in the Home screen and in the Book Archive screen could include an Export option. The exporting capability could also be expanded by letting the user choose between exporting the entire book or a range of pages (e.g. from page 5 to page 152), for cases where the user does not need the entire book. This feature would let the user retrieve a book's content if they no longer have access to the original text and could help the user process a book's text in mass if they want to correct/change many things. It can also be a way of changing a book's number of words per page by exporting and then re-importing the book.

I merged this with the above topic because I did not know where to put it. Similar things are mentioned in issues #56 and #87, so I did not want to create a separate GitHub issue. It would be very convenient to be able to export Lute books from within Lute. However, I understand that it may be easier to implement book exporting as a command-line job, just like with the term exporting, and that would also be perfectly fine.

Thank you for your work.

Inquisitor-Ignotorum avatar Mar 29 '25 01:03 Inquisitor-Ignotorum

Hi @Inquisitor-Ignotorum , thank you again for the great input. Apologies for the late response. And thanks for all the thought you put into creating issues, the extra detail is certainly helpful.

This seems like a reasonable idea. My only current challenge with it is that users might put in "hard page breaks" in their input text files, that is, three dashes (like ---), which Lute uses to hard split pages. Currently Lute doesn't save that "hard page break" info anywhere, so recreating a book would lose that. e.g., I might add --- to the end of a chapter in a text file, so the next chapter starts on a new page.

One possible workaround for this would be to have the parser simply save the "---" as part of the underlying text object in the database (the text record corresponds to a page), and then that "---" wouldn't be rendered. That way, the page resizing would respect the page breaks. It should work, at least in my head it does, though I'd need to look at the code to work with it.

As a workaround, I guess the best thing would be to export the text of the book, and re-import it ... unfortunately, there's no current way to easily export the full book text either!!! What a hassle for you.

So, there are a few things needed for this, in various degrees of need, all of which contribute to the issue:

  • when hard-splitting book input text on ---, save the --- in the text db record, and don't render it on the page
  • export full text of book (should be possible as an action in the book listing
  • allow changing of number of words per page on the book edit screen, and re-create the book pages. Note: if Lute ever gets around to more advanced sentence handling (e.g. issue 545 - Change sentence storage, map sentences to Text entries via join table ), this could become extremely tricky.

jzohrab avatar Jun 14 '25 01:06 jzohrab