Term/definition list formatting

This forum is for all Flare issues related to styles, stylesheets and XML.

Term/definition list formatting

Postby bboursaw on Thu Sep 26, 2019 5:11 pm

Hi all,

My bouts with Flare are very sporadic, so I don't get as much focused time as I'd like to solidify my learnings.

Hoping someone can assist me with what I believe is likely a fairly simple task.

I want to have a quick / consistent way to format a list of terms and their associated definitions. My goal is as follows.

1. Style the first word of each sentence
2. Indent each sentence a set amount
3. Select all sentences (terms and their definitions) at once and then selecting the style option

Example: I will have a list like this.

Trees grow in the forest
Branches grow out from the trunk of the tree
Leaves can be found on branches of trees

Again, the goal here would be to select all three lines, then select my style and have the following occur.

A - All lines will indent by specified amount in style
B - The first word of each line will be styled with specific color / weight
C - The spacing between each line will be adjusted (a bit less than current p style spacing above/below)

Is this something that can be done?

Or am I way off base here and should approach this a different way?

Any direction would be greatly appreciated.

Thank you,
Propeller Head
Posts: 39
Joined: Thu Apr 02, 2015 4:20 pm

Re: Term/definition list formatting

Postby ajturnersurrey on Fri Sep 27, 2019 2:24 am

There are several different ways of doing this, but I don't know any way to get Flare to recognize the first word as such, and style it, without you identifying it as separate to the explanation, by using at least a span tag.

Here are two techniques I've used for similar things:

1. Easiest in my opinion - define these items glossary entries (term and definition pairs), follow the madcap help for styling your glossary list - by default the term is bold and the definition not, then you need to play around with the madcap glossary styles to line the items up how you want. Just because the feature is called a glossary, doesn't mean it actually has to be one. See https://help.madcapsoftware.com/flare2019/Content/Flare/Glossaries/More/Using-Styles-to-Change-Look-of-Glossary.htm

2. Alternatively use your own css, here's an example from an API document I wrote recently:
a. Wrap the whole list in a div, say div.indent - this will have position: relative; left: 50px; max-width: 200px; or a different amount of indent that suits you
b. Wrap the first word of each line in a p, say p.term - this will have font-weight: bold; and set margin/padding you want to compress the list to less than p spacing
c. Wrap the remainder of each line in another p, say p.explain - this will have display: in-line block; position: relative; left: 10px; and set margin/padding the same as p.term
Then your topic body will look like:
Code: Select all
           <div class="indent">
                    <p class="term">Trees</p>
                    <p class="explain">grow in the forest</p>
           <div class="indent">
                    <p class="term">Branches</p>
                    <p class="explain">grow out from the trunk of the tree</p>
           <div class="indent">
                    <p class="term">Leaves</p>
                    <p class="explain">can be found on branches of trees</p>
Sr. Propeller Head
Posts: 330
Joined: Fri Nov 05, 2010 3:30 am

Return to Styles, Stylesheets and XML

Who is online

Users browsing this forum: Google [Bot] and 3 guests