Is replacing styles an option/possibility???

This forum is for all Flare issues related to styles, stylesheets and XML.

Is replacing styles an option/possibility???

Postby Tom on Tue May 27, 2008 6:52 am

I have imported a RoboHelp HTML-helpfile with a long (about 9 years) history. It has in its early days been converted from Robo-WinHelp to Robo HTML-help and consists now of about 1200 topics. Most of the adjustments over the past years have been made inline and we never cared about stylesheets in HTML, as long as the resulting helpfile looked fine on the screen (quite a hurdle during the conversion from WinHelp to HTML as the content is mostly numbered lists).
After the conversion to XML by Flair however, I was confronted with about 29000 ‘New Style Suggestions’, 1400 undefined styles, 125 ‘Duplicate Styles’, and a few ‘Replace Local Style Suggestions’, when analyzing the project in MadCap Analyzer. I did not convert inline styles from RoboHelp to styles in Flair.

So I want to get rid of this Gordian knot in order to keep life a bit structured and building a target (perhaps) a bit less time consuming in the coming years.
I think about making a .CSS with only a few styles. Then apply this .CSS to all the topics.
But taking the advise from MadCap Analyzer about making new styles, serious in this case won’t help because I can’t propose a existing style as a replacement. So I'll have indeed to make new styles. I could delete those new styles form the .CSS, but that also is no option, because the original ones are kept in the topic-code and after adding all the suggested styles in the .CSS, before printing I would have to refill the paper tray of the printer (ok, a bit exaggerated perhaps….., but nevertheless).
I tried to ‘Find and Replace’ style-tags in the source-code of the topics. But then the replacing code was entered in the topic itself as text (do I something wrong perhaps??).

I suppose you can see my doubts for the future developments in the next years, and I know Flair has a reputation of a slow compiler compared to RoboHelp, but building this helpfile takes more than two cups of coffee (more than 20 minutes). I suppose the Gordian knot in the styles attributes substantially to this.
And in short, I am looking for a convenient way to replace styles in order to reduce them, without having to re-edit all the topics one by one or worse, adding the appropriate style to about 29000 instances.

Anyone any idea how to proceed?
Thanks in advance,
Propeller Head
Posts: 46
Joined: Fri Aug 11, 2006 6:39 am

Re: Is replacing styles an option/possibility???

Postby LTinker68 on Tue May 27, 2008 8:28 am

My suggestions...

First, make a copy of the entire project, just in case things get screwed up.

Then open a topic in the Internal Text Editor. Look for an inline style that is probably representative of every topic. For instance, an <h1> tag that has inline styles to set its size, font family, color, etc. Go to the stylesheet and modify the <h1> tag to match what's in the inline styles. Then use find-and-replace (have "source code" enabled in the search) to search for the entire <h1> string, including its inline styles, and have it replace the entire string with <h1>. Or use wildcards in place of the inline styles, so that you replace all <h1> strings with the base <h1> tag, regardless of how many different sets of inline styles you have.

Continue doing that with all the other inline styles you find. At some point, you'll have most of the project set up with base tags (<h1>, <p>, <ol>, etc.) and some custom classes (notes, special numbering, etc.). At that point, run Analyzer again, and see how many inline styles you have.

I also recommend periodically copying the entire project so that if something catastrophic happens, you don't have to go all the way back to the original version and redo the modifications you've already done.

Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Master Propellus Maximus
Posts: 7245
Joined: Thu Feb 16, 2006 9:38 pm

Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: No registered users and 8 guests