View Single Post
Old 10-10-2010, 03:42 PM   #12
sergio blum
Member
sergio blum began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Aug 2009
Device: SONY READER
@jackie_w,

With trepidation, unrared what you sent me.
I cannot express how happy I am.

You have been preempted by only a few minutes. Don't be sad, though!

You see, I managed to get someone on the phone here in São Paulo city in Brazil and after much explaining (again) this person sent me an even more barebones template equivalent to what you sent. Thanks so much to you, it goes WITH saying. Your template, being more rich and varied, will enchance my understanding.

Below I am showing the page and the css I got here in SP and then WOW I am sure I have the workflow worked out. See if you agree.

the page:
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="../Styles/styles.css" />

<title></title>
</head>

<body>
<h1 id="heading_id_2">I am tagged as h1. Hallelujah!</h1>

<h2 id="heading_id_3">I am tagged as h2. Hallelujah!"</h2>
</body>
</html>

and the css:
body{
font-family: "Courier";
}

h1{
font-family: "Courier";
}

h2{
font-family: "Verdana";
}

...and now, here comes the sun.

Like I said, a Word macro can recognize text by font, size, color, whatever -- and wrap such text within the required tags
In this case immediately above the tags would be h1 and h2.

But there more.
Previously (approx forty five minutes ago) I knew that even with this Word macro solution I would have to painstakingly (1) open each html file in Word (2) run the macro (3) Paste the resulting tagged text in the Code Window of Sigil.
In my current case -- an actionscript cookbook -- this would envolve about a hundred files.

BUT BUT I tested an idea.. and it works!

A- Open EPUB in the winrar program
B- Shift select the relevant html files -- leaving untouched jpgs and subdirectories
C- Drag (unrar) the files selected to an empty folder
D- Write a macro that in turn opens each file in the folder, identify the fonts and apply the tags, and save back the file.

E- Once this is completed it is just a matter of reincluding the modified set of html files in the EPUB.

That's all, isn't it? Dosn't it make sense?
Then just Add File in Calibre and download it to the Reader.
If you're not satisfied with font sizes, just fine tune them and do the rocess again.

Again, first convert CHM into EPUB in Calibre
Open in Sigil to fine tune fonts as desired
Then proceed with the Word batch workflow listed above
Finally AddBook in Calibre and download to reader device.

I think this is it.
I am soooo tired. Its 04>20 PM here and I still have not eaten today.

I reckon I can write this macro in two hours (it will therefore take me about five).
I intend to do it tonight. As soon as I implement the whole workflow I will post it inthis thread so we can come up with more ideas on this. If it may be useful to more users, great. That's the whole point of the community, isn't it.

As a last comment: Once the macro is written, its behaviour could be extended so as not to be limited to two tags. It could deal with any number of desired styles.

I must also thank you for lettng me know about the Save HTML-filtered option in Word. I was in the dark as to which of the htm, html Save options would be appropriate for my needs.

I dont know how to express my gratitude for your patience and attention. I only hope once this workflow -- or variations around the theme -- is all done and tested I may also be useful to you.

Blum

(I am an English-Portuguese translator with a daily business newspaper in SP. That's why I am an "expert" with Word macros).
I expect I will be posting again tomorrow - Monday.
sergio blum is offline   Reply With Quote