View Single Post
Old 06-10-2022, 01:58 AM   #1
wishingstar
Enthusiast
wishingstar can extract oil from cheesewishingstar can extract oil from cheesewishingstar can extract oil from cheesewishingstar can extract oil from cheesewishingstar can extract oil from cheesewishingstar can extract oil from cheesewishingstar can extract oil from cheesewishingstar can extract oil from cheese
 
Posts: 33
Karma: 1032
Join Date: Nov 2016
Device: Kobo Aura Edition 2, Lenovo Android 10
Question Randomizing text files in a book

As I'm organizing my library, I'm combining a bunch of articles by topic into collections. I have these articles downloaded as html files, and placed in folders by topic. So basically what I do is:
  1. Create an empty epub
  2. Import all html files from a given folder into it
  3. Perform any necessary html cleaning
  4. Create a ToC from files (in the cleaning step, each file starts with the title of the article in <h> tags)
  5. Save the book, fill in metadata, and add a cover

Now my question is about ordering the articles.

The way outlined here means the articles will be added in alphabetical order, which is okay in principle, but I'm wondering if I can add some 'variety' into the collection by somehow randomizing the order of the html files in the book.

I know I can drag the individual html files around, but that's impractical with 100+ articles. Is there a way to randomize the files automatically, or to write a script to randomize the files on import somehow?

Last edited by wishingstar; 06-10-2022 at 02:01 AM.
wishingstar is offline   Reply With Quote