How to identify snippets in output

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
ekaren
Jr. Propeller Head
Posts: 7
Joined: Wed May 04, 2011 11:28 am

How to identify snippets in output

Post by ekaren »

We're having an issue with our SharePoint/Contributor interface, so for now we need to export to Word for reviews. The reviewers would like to know which items in the text are snippets.

In the stylesheet, there are styles for MadCap|snippetText and MadCap|snippetBlock. I've made changes (small caps) and I can see the difference in the XML editors; however, the changes are not applied to the Word, PDF, or HTML5 output.

Should this work or does anyone have a workaround?
jjw
Sr. Propeller Head
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: How to identify snippets in output

Post by jjw »

As far as I can tell, the snippet no longer exists in the output. Everything inside the snippet body tags is just substituted for the snippet text or snippet block place holder. So the only thing I can think of is to put something into the body of every snippet that you could style in the output. For example, you could insert a div (say, <div class="red">) to wrap everything inside the snippet body tags and use that to style the output when you were publishing a draft.

You can use the Find and Replace in Files tool to target snippet files, so you could do that to a whole batch of snippets relatively easily.
Lydia
Sr. Propeller Head
Posts: 373
Joined: Tue Apr 23, 2013 3:19 am
Location: The Netherlands, Amsterdam Area

Re: How to identify snippets in output

Post by Lydia »

When you say that you have changed the style (small caps) - have you done that for the medium that you use for the Word etc output? If the change was made to the default this would work through on other mediums as well, unless changed (back) somewhere ...
As a test, in the xml editor, have you set the medium that you are using for the output to check wheter the small caps are seen then?
Using Flare 10.2 and Flare 11 on Win 7
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: How to identify snippets in output

Post by NorthEast »

As jjw says, snippet tags doesn't exist in the output (only the source), so setting styles for MadCap|snippet... won't apply to the output.

However, Word doesn't like div containers, so you can't use that solution for Word - only for Web or HTML-based outputs.

So, you might need a more rudimentary approach, like adding a paragraph at the start/end of the snippet. I'd suggest adding a condition to these, so you can easily switch it off in your production (non-review) outputs.
Lydia
Sr. Propeller Head
Posts: 373
Joined: Tue Apr 23, 2013 3:19 am
Location: The Netherlands, Amsterdam Area

Re: How to identify snippets in output

Post by Lydia »

I'm sorry, I missed the point here.
Dave, thanks for your explanation.
Using Flare 10.2 and Flare 11 on Win 7
jjw
Sr. Propeller Head
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: How to identify snippets in output

Post by jjw »

Actually, now I come to think of it, the div solution won't work for snippet texts in any output because Flare strips all block elements out of a snippet text as soon as you put it inline inside a topic (gave me an awful scare when I started using Flare). It will only work for snippet blocks (although in that case, I think it would work in Word too because the paragraph styles inside the block can inherit properties like font color from the div).

So Dave's solution is the way to go.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: How to identify snippets in output

Post by NorthEast »

jjw wrote:Actually, now I come to think of it, the div solution won't work for snippet texts in any output because Flare strips all block elements out of a snippet text as soon as you put it inline inside a topic (gave me an awful scare when I started using Flare). It will only work for snippet blocks (although in that case, I think it would work in Word too because the paragraph styles inside the block can inherit properties like font color from the div).

So Dave's solution is the way to go.
Yep, a text snippet (inline) doesn't include any tags whatsoever from the snippet, it's the raw text only.
I'd just assumed we were dealing with block snippets.

div tags definitely won't work in Word outputs at all, as the div is completely ignored in the output.
Also, inheritance doesn't really work in the Word output either.
jjw
Sr. Propeller Head
Posts: 133
Joined: Thu May 08, 2014 4:18 pm
Location: Melbourne

Re: How to identify snippets in output

Post by jjw »

Div tags seem to work to some extent in Word.

For example, here's a snippet:

Code: Select all

<body>
        <div class="red">
				This text is in a snippet wrapped in a red div and has no p tags.
                <p>This text is in the snippet but has p tags around it</p>
       </div>
    </body>
And here's what's in the stylesheet:

Code: Select all

div.red {
  color: red;
}
And here's my Word output:
divred.png
I don't know what the limits of this are. It seems a bit unpredictable, but Flare created a div_red style for the paragraphs in the snippet and in the topic where I had wrapped text in a div. I'm not suggesting this is a good solution, but it doesn't seem to have completely ignored my div styling.
You do not have the required permissions to view the files attached to this post.
Post Reply