Formatting variables

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
sarabigail
Propeller Head
Posts: 10
Joined: Fri Feb 03, 2017 4:47 am

Formatting variables

Post by sarabigail »

Hello all,

Is there a way that I can set up variables to identify a few terms and set them to say, italics. So every time these terms appear in the content, Flare converts them into the set style (italics)?

Thanks,
Sara
Rene Severens
Sr. Propeller Head
Posts: 210
Joined: Mon Sep 19, 2011 2:06 am
Location: Netherlands - Zoetermeer
Contact:

Re: Formatting variables

Post by Rene Severens »

Hi,

I once tried this to identify variables and discovered it did not work for font styles.
So I tried a background-color and that worked.
I now use a stylesheet with a section like this:

span.WebsiteVariableSetProductAndVersion
{
background-color: aqua;
}
span.WebsiteVariableSetProductName
{
background-color: aqua;
}

Generic:
span.<variableSetNam><VariableNme>
{
style;
}
...
etc.

If you look in the output webpage's source that is generated you will see <variableSetNam><VariableNme> used, is the same as the name of the variableset and the name of the variable, just glued together, without a "." in between.

After identifying the spots where I missed to insert a variable, (using a search in the output topics), I turn the section into a comment again.

Hope this helps.

Greetings,
René Severens
"The numbers are strange today; they somehow do not seem to add up."
Dee Vincent-Day
Propeller Head
Posts: 62
Joined: Mon Jan 04, 2016 7:39 am
Location: York, North Yorkshire, England

Re: Formatting variables

Post by Dee Vincent-Day »

I tackle this by setting up my variables and using them in Snippets.

Create the Variable

Then create a snippet file by right clicking on the Snippet folder and selecting Add New Snippet.

I give the snippet file a name and, once set up, I can add the variables and style them to include whatever styling I want. I also use conditions with variables in my documentation and this works nicely within a snippet.

I have not managed to get this to work by selecting content and clicking create snippet. I always have to start with an empty snippet file.

The bonus is that you can easily edit the snippet if things change.
Dee Vincent-Day
Technical Author
Piksel

liberating viewing | Piksel.com

http://www.piksel.com
sarabigail
Propeller Head
Posts: 10
Joined: Fri Feb 03, 2017 4:47 am

Re: Formatting variables

Post by sarabigail »

Thank you Dee Vincent Day and Rene Severens for your responses. I am new to Flare and have not worked with snippets yet. But that looks like an option. Will explore and report back if I am able to get the result I want.

Cheers,
Sara
Paulie
Sr. Propeller Head
Posts: 140
Joined: Sun Mar 01, 2015 3:01 pm

Re: Formatting variables

Post by Paulie »

There are a few things you can do in CSS to automatically style variables.

For Word outputs, you can do something like the below. Note: This is a confirmed bug in Flare, as the below styles are only supposed to style Flare variables in the Flare UI, not in output content. If MadCap ever fix this 'bug' then it will stop working.

Code: Select all

MadCap|variable
{
	font-weight: bold;
}

MadCap|variable.Normal
{
	font-weight: normal;
}

MadCap|variable.Code
{
	font-family: Consolas, 'Courier New', monospace;
	font-weight: normal;
}
For HTML outputs (including CHMs), variables are surrounded by a span tag. The span class name is in the form of class="[variableset][variablename]" so you can create rules in your CSS to style either specific variables, or all variables in a variable set.

Code: Select all

span.DocumentInformationProductName,
	span[class^="ApplicationName"],
	span[class*="UI Text"]
	{
		font-weight: bold;
	}
Tip: The following link explains some of the selectors used in the above example.
https://www.w3schools.com/cssref/css_selectors.asp
"In an ideal world, software should be simple, well designed, and completely intuitive to end users. In the real world, good documentation is king."
Post Reply