Imported CHM

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
alforino
Jr. Propeller Head
Posts: 6
Joined: Tue Aug 19, 2014 3:25 am

Imported CHM

Post by alforino »

I've imported a legacy CHM (created using Help & Manual 6?) into Flare but each topic's body content has been placed into tables. Will this prove to be problematic further downstream?

There is also a lot of local formatting. I presume I'll have to go through and 'wash' the content before applying the new style sheet I'm going to have to build? (The few styles that were created and imported have all imported as a derivative of p.* - which I presume will also generate difficulties.

Thanks in advance for any insights,

Alforino
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Imported CHM

Post by Msquared »

Hi Alforino and welcome,

To take your points in order.

Tables - not sure why your content was imported into tables, but it's a one click operation in Flare to convert each table to text once you've selected it. Whether that leaves you with anything else to tidy up will be another matter. And of course, if you have hundreds of topics this may not be so wonderful.

The p.* styles won't cause a problem as such unless you want them to be other things, like h.* styles, in which case you can either change them manually or via global search and replace later - again, if you have hundreds, this probably isn't what you want to hear. But I found the default stylesheet that Flare created for my very first import of a well-structured and formatted Word document was a really good basis for my own stylesheet, since I could see what CSS properties I needed to use for the styles I really did want.

Unfortunately, all imports seem to need tidying up (Word imports certainly do), even when the source is well formatted and uses styles consistently. It is worth getting the source as good as you can before you do the import for real. But after the import, I always end up doing lots of global find and replace operations using Notepad++ (fine for some of them) or FAR HTML (copes better with content wrapped in XML tags), or of course you can use Flare's own find/replace in files facilities.

I've not done a CHM import. but I did take a quick look at the Help, and it doesn't seem that you can map CHM styles to Flare styles on import like you can with Word. Your options seem to be either to stick with inline styles (never the best idea if you want to update the content going forward) or let Flare make up some CSS styles, which looks to be the option you selected? So I guess whatever you do, you will be looking at doing some post-import tidying up. :-(

Is your CHM very big?
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
alforino
Jr. Propeller Head
Posts: 6
Joined: Tue Aug 19, 2014 3:25 am

Re: Imported CHM

Post by alforino »

Hi Msquared and thank you,

I'm a bit new to being a sole author and I've never really used Flare before 'in anger' (only Robocop a good while ago) so its a tad lonely :roll:

No - its only about 100 odd topics so its doable.

You're right - I don't think I can map styles from the CHM to Flare but I didn't choose to let flare generate styles from local format because it generates loads and loads of them.
It has however taken all the h.* styles and turned them into p.variants. Again not too many so I'll change them manually ... don't know how I'd do a search and replace on a style class. I have got Notepad++ though, so I'll tinker with that, thanks.

And sincerely thanks again - given there was no maintenance cover purchased with the licence I may yet become a forumPest. I'll do my best not to be!

Thanks again,
Alforino
Msquared
Propellus Maximus
Posts: 848
Joined: Mon Aug 06, 2012 10:19 am
Location: Southampton, UK

Re: Imported CHM

Post by Msquared »

You're exactly where I was a couple of years ago. Don't worry about being a forum Pest. There are lots of lovely and very knowledgeable people here who are very willing to help.

It sounds like you're reasonably confident working in the XML. That's good as you will need to dig in it a bit to tidy up.

if you use Notepad++ for global search and replace of XML, you will need to get a bit into regular expressions, and even then you may find some things that you won't be able to do with regular expressions as they're not really designed for processing XML. But FAR XML is, which is why lots of people here recommend it for its search and replace features. It's not that expensive, and it allows you to easily do things like replace begin and end tags with other tags while leaving the content between the tags intact. You can do this with regexes if you're not scared of them, but the expressions you need are more complicated, and in some cases (typically if you have two instances of the same tag on one line) you may find you replace more than you bargained for. Also, regexes are line-based searches - they don't handle content that may have carriage returns in random places very well. FAR HTML is designed to cope with this too.


A tip - before you get too carried away with global search and replace, take a backup copy. Also take a backup copy whenever you get your topics to a good place, before you make another batch of changes. It's quite easy to make a mistake with global search and replace, and screw it up totally.
Marjorie

My goal in life is to be as good a person as my dogs already think I am.
Post Reply