Mobileread
How to change image location for html file converted from epub?
#1  vedri 12-18-2020, 03:16 PM
Hi,


when converting some epub books to html additional directory with images is extracted to /images subfolder.

pandoc -s --extract-media=ABC_files ABC.epub -o ABC.html

I would like to move all the images to root of ABC_files folder and change their location in html document to new location.

What is the easiest way to do that?
Reply 

#2  DNSB 12-18-2020, 03:36 PM
Quote vedri
Hi,


when converting some epub books to html additional directory with images is extracted to /images subfolder.

pandoc -s --extract-media=ABC_files ABC.epub -o ABC.html

I would like to move all the images to root of ABC_files folder and change their location in html document to new location.

What is the easiest way to do that?
Leave them where they are? Otherwise, you are going to have the edit the file location information in the html documents for every image.
Reply 

#3  Quoth 12-19-2020, 11:09 AM
^^^^ What DNSB says about leave as is.

Or on Windows use Notepad++ or on Linux, an editor of choice and make a backup.
Do then a scary search and replace in *.html of images/ with nothing on ALL files in directory in bulk. Maybe look in an HTML file with text editor to see how path is described first. Perhaps include more of the HTML and have it in the replace in case images/ is in the body text.

But, I only ever go the other way, HTML to ePub. Even if you are putting the stuff on a web server keeping the subdirectory makes sense.
Reply 

Today's Posts | Search this Thread | Login | Register