Not applying span.class: span vs embedded styles

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Not applying span.class: span vs embedded styles

Post by rmdavidson »

I'm having an issue with a document that uses an embedded stylesheet to bold certain text. When I look at the tags in the XML editor all it says is:

Code: Select all

<span> my text </span>
and doesn't show that it's actually these span & p styles (the text editor shows me this):

Code: Select all

span.hcp3
{
	font-weight: bold;
}
p.hcp4
{
	font-size: 12pt;
	font-weight: normal;
	font-family: Arial, sans-serif;
}
which is used like this:

Code: Select all

<p class="hcp4"><span style="font-weight: bold; text-decoration: none;">Kitchen VDU Settings</span></p>


OR THIS: 
 
<p class="hcp7">7. 
 In the <span class="hcp3">Slow Order Warnings</span> section, 
 choose the minutes to wait before flashing and beeping alerts about items 
 ordered.</p>
I'm trying to fix the whole thing by turning it into actual lists and adding the class span.instructions that does nothing but bold the text (in styles.css), but when I actually add the span class to the text, it does nothing in my preview. It still looks like normal text like it isn't applying the style. All the stuff that is still using the embedded style just shows the [ ] tags around the text in the editor, but is bold when you preview it.

Ideas? Or am I missing something being new to Flare?

Robin
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Not applying span.class: span vs embedded styles

Post by LTinker68 »

When you say you're looking at the tags in the XML Editor, do you mean you've opened the topic in the Internal Text Editor, or did you just click the <t> icon to turn on the XML tag view? If it's the latter, then that view shows the XML structure, not the full page code. You'd need to view the topic in the Internal Text Editor to be able to see the full page code, including all tag attributes and inline styles.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Re: Not applying span.class: span vs embedded styles

Post by rmdavidson »

LTinker68 wrote:When you say you're looking at the tags in the XML Editor, do you mean you've opened the topic in the Internal Text Editor, or did you just click the <t> icon to turn on the XML tag view? If it's the latter, then that view shows the XML structure, not the full page code. You'd need to view the topic in the Internal Text Editor to be able to see the full page code, including all tag attributes and inline styles.
I mean I'm looking in the < t > icon (toggle tags) and then when I go into the Text Editor it shows the code...I'm looking at it in both places.

Robin
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Not applying span.class: span vs embedded styles

Post by LTinker68 »

Ok, I'm confused then.

1. When you say embedded stylesheet, do you mean you're linking to a stylesheet stored in the Resources\Stylesheets folder, or do you mean you have style definitions defined in the topic itself in <style> blocks?

If it's the former, then the XML Editor, Preview window, and generated output should all show the styles you defined. If it's the latter, then they will be ignored because Flare will rebuild the topic when it's generated using the code blocks defined in the masterpage. Even though it appears you can modify the topic's page code from the <body> tag up, all that code is actually just temporary in the XML Editor to simulate the appearance of the generated topic. There is also code elsewhere that helps with that, as you'll notice that the stylesheet reference doesn't actually appear in the topic file until it's generated. Long story short, don't put style blocks in the topic's code -- add the styles to the topic stylesheet instead.

2. When you're looking at the topic code, how are you accessing it? Are you right-clicking on the topic in the Content Editor and selecting Open with > Internal Text Editor, or are you clicking on the "Send this topic to the Text Editor" icon in the toolbar? Or, are you just clicking the <t> icon in the toolbar? If it's either of the former options, then you'd see this in the Text Editor view:

Code: Select all

<p class="hcp4">7. In the <span class="hcp3">Slow Order Warnings</span> section, choose the minutes to wait before flashing and beeping alerts about items ordered.</p>
If it's the latter (clicking the <t> icon), then it would look like the following:

Code: Select all

<p+>7. In the <span+>Slow Order Warnings</span> section, choose the minutes to wait before flashing and beeping alerts about items ordered.</p>
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Re: Not applying span.class: span vs embedded styles

Post by rmdavidson »

As I said, I looked in the XML Editor and the Text Editor (Send to Text Editor). I don't right-click on the topic.

I inherited this documentation from the previous writer, another writer about a year before that, and the non-writer in between them. This doc has been "Frankensteined together" to quote my boss, having been imported from RoboHelp 8 and who knows what else was involved. Some topics have embedded stylesheets (or 2, at the top) and links to external stylesheets (sometimes 3, one of which is from RH8 & doesn't affect anything so I've been deleting the link). Then there are places with inline styles as well.

Some topics, like the one I'm working with, have an embedded stylesheet at the top and some inline styles. There are no real OL, but either embedded or inline paragraph styles where they typed in the numbers themselves. I took out these styles in a few spots and made them a proper OL and created my own span.instructions (in styles.css) which bolds the text instead of using an inline style to set the bold and no text-decoration (which it isn't a link so I'm not sure why that is even here). However, when I click the icon at the top to preview the output the text with the existing span classes show as bold, but my span.instructions stays normal.

Here's a sample of the p, embedded and inline style mix I'm trying to clear up. Anything with these hcp4/5/6 styles show up as bold when I click the preview button, but anything I put span.instructions around (from styles.css) doesn't show as bold.

Code: Select all

<p style="font-size: 12pt;font-family: Arial, sans-serif;font-weight: bold;margin-left: 40px;text-decoration: none;"> </p>
        <p class="hcp4">2. Click on <span class="hcp5">Settings</span></p>
        <p class="hcp4"> </p>
        <p class="hcp4">3. Select <span class="hcp5">System 
 Devices</span></p>
        <p class="hcp4"> </p>
        <p class="hcp4">4. Click on the <span class="hcp5">Order 
 Printers</span> tab.</p>
Robin
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Not applying span.class: span vs embedded styles

Post by LTinker68 »

Other than that first paragraph with all the inline styles for a blank space, the rest is formatted correctly. I think you need to clean your topic code and remove all embedded stylesheets and style blocks in between the <head> </head> tags. Check the body tag for inline styles, tool.

The real judge is if the output is ok. If it is, then you could leave things as they are, but you'll still have problems with the Preview window and WYSIWYG editor because there's a conflict between the in-topic style references, the main topic stylesheet that's simulated, and the MadCap.css stylesheet that's simulated (the main topic stylesheet and MadCap.css references are added to the topics at build-time; until then their effects are simulated in the XML Editor).

So if the output is ok (and ok across multiple browsers) then you don't need to clean up the topics at this point but can wait until you have the time to do so. On the other hand, you can probably get rid of a lot of the problems by using the find-and-search within Flare using wildcards or regular expressions to search on <head>*</head> and replace it with <head></head>, where * is the wildcard character or regular expression. That should strip out all of the in-topic embedded stylesheet references. You could do the same if you have inline styles on the body tag. Make sure you have the find set to find in source code. Oh, and make a backup of the project first, just to be safe.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Re: Not applying span.class: span vs embedded styles

Post by rmdavidson »

Yes, but that's what the last person who worked on the document did. It's driving me batty changing it all over to OL as I go. There are other variations of the inline styles in some of the other topics so I'm afraid I'll miss something and have varied looks with in the document. They are going to be hiring 2 more technical writers though so that should help.
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Not applying span.class: span vs embedded styles

Post by LTinker68 »

Based on your other post, I'm guessing this problem was also related to having the styles in the non-print instead of the default medium?
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
rmdavidson
Sr. Propeller Head
Posts: 127
Joined: Tue Jan 17, 2012 7:58 am
Location: Pittsburgh, PA

Re: Not applying span.class: span vs embedded styles

Post by rmdavidson »

Btw, I tried Find and Replace for the entire project in source code and in text, and it just freezes up (progress bar didn't move for over 30 minutes). Is this typical? I have to save everything and close and reopen Flare to get out of it then nothing seems to have changed.

Thanks,

Robin
Robin Davidson
Technical Writer & Documentation Specialist
STC Pittsburgh Chapter President http://www.stcpgh.org

Flare 7.2 / Windows 7 Pro 64 bit
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Not applying span.class: span vs embedded styles

Post by LTinker68 »

No, it's not typical. I wonder if some of it is the extraneous code that sounds like you inherited that's sticking around in the topics, which doesn't help to remove the offending code. Some other users have recommended other find-and-replace tools that you could try. I'm drawing a blank on their names at the moment.

To be honest, I wonder if it wouldn't save you time in the long run to abandon the project as it is and create a new project from scratch. Much more start up time since you have to recreate some things and copy-and-paste your content, but if you don't do it at some point then you might just be compounding issues until the whole project is cleaned up. Not an idea situation, but something you might want to think about. Hopefully you'll get a find-and-replace tool that might work.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Not applying span.class: span vs embedded styles

Post by crdmerge »

The Flare Find & Replace:

If you enter a Find what that is not all on one line, or is broken up by inconsistent applications of <span> inline styling, nothing will happen. You might have to reduce the search term to a single word, or even a portion of a word.

If you select the (whole project) option, you must initiate the search with the Start button in the Options panel, not the Find Next button in the Find panel.

When you reach the last (or none) instance in the active topic, Flare doesn't prompt you to continue, but the fact is, you must click the Find Next button again to continue from one topic to the next.

The external tool I've used is the most excellent FAR product from Helpware http://helpware.net/FAR/help/hh_start.htm. It even allows the use of variables, in the event you need to replace tags but retain the text contained within. I recommend it highly.


Good luck,
Leon
Post Reply