Flare deleted my style classes

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Pernice
Propeller Head
Posts: 21
Joined: Thu Dec 01, 2011 5:39 am

Flare deleted my style classes

Post by Pernice »

It seems Flare has deleted lots of my style classes from my stylesheet, and has removed those style classes from my topics, and consequently I have lost days of work. It looks like Flare has reverted to a much earlier version of my stylesheet. Unless there's a way to get those styles back, I'll have to re-create them then reapply them to my topics. I'm not happy.

I was trying to define a cross-reference for Default (online) medium: {paratext}; and one for print medium: '{paratext}' {pageref}. I could not get the print version of the xref format to work at all - every time I tried to define it, it reverted to the online definition. The Flare user documentation talked of using a language skin to customise the context sensitive {pageref}. So I tried this. I couldn't find instructions on how to do this so it was trial and error. No luck. After switching back and forth again and again between the two mediums trying to get those definitions to be saved, I noticed that I'd lost half of my styles. It looked like my stylesheet had been reverted to a much earlier one, with most of my span classes, many of my p classes, my TOC classes, etc. gone from the stylesheet and from my topics!

Before I report this as a major bug, I'm posting this in the hope that someone may know a solution to this - perhaps there's a way to reinstate the latest stylesheet. Where this old version came from? Weird and very annoying.
Pernice
Propeller Head
Posts: 21
Joined: Thu Dec 01, 2011 5:39 am

Re: Flare deleted my style classes

Post by Pernice »

On further examination, if I select some text that used to have a span class applied, the name of the span class is shown in the Text Format toolbar, but it's not in the drop-down list of style classes (even though, as I said in my original post it's gone from the stylesheet, and the formatting is shown neither in the XML Editor nor in the output).

A p.note style class that I had defined as having an autonumber piece of text in bold has been changed to Strong. For example, it looks like this:

Note: Flare can be unstable - make sure you back up your work regularly.

The word "Note: " used to be bold in a p.note class. Now it's inline Strong in a p tag.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Flare deleted my style classes

Post by LTinker68 »

Pernice wrote:On further examination, if I select some text that used to have a span class applied, the name of the span class is shown in the Text Format toolbar, but it's not in the drop-down list of style classes ...
I'm guessing the Text Toolbar is just showing you the topic code class name that it found in the topic. In other words, whether or not you see it in the toolbar isn't an indication that the style actually exists in the stylesheet file.

Does the output look ok? I couldn't really tell from your post (unless I missed it) whether the issue was in the output, too, or just in the authoring environment. Is it possible that you inadvertently disabled the styles in the Stylesheet Editor, but they still exist in the stylesheet file? Easiest way to check is to open the stylesheet file in the Internal Text Editor and look for the styles to see if they're there.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Pernice
Propeller Head
Posts: 21
Joined: Thu Dec 01, 2011 5:39 am

Re: Flare deleted my style classes

Post by Pernice »

The style class tags are still present in the XML source i.e. the names of the style classes are still applied to the content, but there are no definitions of these style classes in the stylesheet. The look is affected both in the XML Editor and in the outputs (print and non-print).

I've had some success though: in the stylesheet I have re-created some of the missing classes and saved it. The classes were automatically applied to the content (because the tags hadn't been removed) so that's good. Or rather, not as bad as I thought.
crdmerge
Sr. Propeller Head
Posts: 248
Joined: Tue Dec 16, 2008 5:37 am

Re: Flare deleted my style classes

Post by crdmerge »

You seem to have confused style classes (p, p.Note, etc.), which deal with blocks of text, with span classes (span.NoteLabel, span.CodeInline, etc.), which deal with text strings only (without a closing line break or </p>, in other words).

* If you have selected a block of text, Flare will display only the style classes.
* If you have selected a text string, Flare will display only the span classes.

Therefore, you would need a p.Note style class for the paragraph styling (borders, margins, padding, etc.), and a span.NoteLabel span class for the Note text string styling (color, font size, font-weight, etc.).


Good luck,
Leon
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Flare deleted my style classes

Post by NorthEast »

The Flare editor will only display styles that are available in the Medium that is selected on the editor toolbar.
So if you can't see certain styles, maybe they're only available in a different medium?

The stylesheet editor is the same; it will only display the styles for the medium that's selected on the toolbar.
I've not heard of Flare deleting styles, but it's pretty common for people to add or edit styles without noticing that the wrong medium is selected, and then wonder where they've gone. I would try selecting the different mediums in the stylesheet editor, and see if the styles are visible there. If you still can't find them, perhaps open the stylesheet in the text editor, and look for the missing style names.
Pernice
Propeller Head
Posts: 21
Joined: Thu Dec 01, 2011 5:39 am

Re: Flare deleted my style classes

Post by Pernice »

crdmerge wrote:You seem to have confused style classes (p, p.Note, etc.), which deal with blocks of text, with span classes
No, no confusion here. Some of my style classes - of both types p.xxx and span.xxx were deleted.
Dave Lee wrote:The Flare editor will only display styles that are available in the Medium that is selected on the editor toolbar.
So if you can't see certain styles, maybe they're only available in a different medium?
I know this. No, the missing style classes were in both mediums (because they were defined in the Default medium. Switching between the two, they were missing. Looking in the internal stylesheet editor, they were missing. In Notepad, missing. Gone, solid gone. As I said, the only thing that remained of these style classes was that the content of my topics was still marked up with those style class, so I only had to redefine the classes. I didn't have to reapply those classes to my content.
I'm pretty sure this is related to a bug with cross-references. As I said in original post, I was trying to define an xref format in the non-Default medium ("print") like this:

Code: Select all

'{paratext}' {pageref}
But, using the Stylesheet Editor under mc-format or Insert > Cross-Reference, it was not possible to create this format with the single quote marks (double quotes works though). You type it, press Return, and it changes to this:

Code: Select all

{paratext}
As I tried and tried to get this to work, and after attempting to create a language skin (which the Flare doc says can be used to control context sensitive xrefs (the {pageref}), eventually I saw my styles gone.
I have reported this as two bugs (1. Can't specify single quotes in xref; 2. Style classes deleted.)
Since reporting these I've noticed that it looks like Flare is trying to support the use of single quotes because occasionally you can get it to work (but can't remember how I got it to) and when it worked I've seen the format in Flare as this:
{quote}{paratext}{quote}
which in output looks right:
'My heading'
But if you try and type this format it comes out as double quotes!
Sometimes I've seen:

Code: Select all

\'{paratext}\'
which looks like it's trying to do it like Framemaker, but this doesn't work.
There seems to be no consistency in the syntax for how formats are constructed in Flare. I'm fairly sure I've seen all three representations ({quote}, \', and ') at the same time in the various places you can see the formats (Stylesheet Editor, Cross-Reference window, Notepad, etc.)
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Flare deleted my style classes

Post by NorthEast »

Regarding the xref format; can you reproduce the bug?

The xref format works ok for me using single quotes; I can enter single quotes (in either simple or advanced mode), and they work fine.
When you view the CSS in text mode, the quotes are prefixed by a backslash (as you also mentioned); e.g.

Code: Select all

mc-format: 'See \'{paratext}\'';
Language skins aren't relevant to what you want to do. To set a xref format for the print medium, just change the medium in the stylesheet, then edit the MadCap|xref style properties for that medium as appropriate.

Note that the xref text displayed in the Flare editor and preview is fixed text (showing the xref when you first inserted it), and it does not change if you switch mediums or edit the xref style. You need to build the target to see how the xref will look in the output.

If you want to update the xref text in a topic (just for appearance in the editor), use Tools > Update cross-references.
Pernice
Propeller Head
Posts: 21
Joined: Thu Dec 01, 2011 5:39 am

Re: Flare deleted my style classes

Post by Pernice »

I can reproduce the bug whereby I can't specify single quotes in the Stylesheet Editor window. However, I've just tried using the format you suggested, Dave, in the internal stylesheet text editor and this works. This must have been the only combination of format representation/place I didn't try before. (I had tried this format in the Stylesheet Editor, for example, and it doesn't work.)

I find the Stylesheet Editor frequently difficult to use. Sometimes it's great, but other times you just can't get it to do what you want. (For example, try deleting the text "You are here: " from the default mc-breadcrumbs-prefix class. You can't. Often the only way you can achieve the desired result is to edit/specify the settings in a stylesheet text editor (the internal one or Notepad, etc.).

I knew language skins weren't relevant (because I wasn't trying to modify the default words used for context senstive xrefs). The reason I was messing around here was because I couldn't get the single quotes to work. And seeing as this was another place in Flare where xref formats can be defined, I tried here too. I still think this may have had something to do with Flare getting confused with stylesheets and xref formats, which led to Flare deleting my style classes.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Flare deleted my style classes

Post by LTinker68 »

Pernice wrote:I find the Stylesheet Editor frequently difficult to use. Sometimes it's great, but other times you just can't get it to do what you want.
I agree. What I'd love is if MadCap added some extensibility to the Stylesheet Editor and the XML Editor, something similar to what you can do in SharePoint Designer 2010. As you're editing content in SPD, the tag you're in is displayed in the status bar, along with its parent, grandparent, etc., all the way up until it runs out of room in the status bar. From that status bar, you can click on the tag and have an option to edit the tag without exiting the content editor view you're in. It pops up a small window with the tag and you can type in a class name, for example. It would be nice in the Stylesheet Editor if you could do that to have more fine-grain control over a style's attribute definition than you currently get, and it wouldn't be bad to have in the XML Editor, too, as an option to give you more control without having to open the topic in the Internal Text Editor.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply