Removing Periods from ol | li

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
Bonnie Kern
Propeller Head
Posts: 29
Joined: Mon Mar 16, 2009 3:54 pm

Removing Periods from ol | li

Post by Bonnie Kern »

Our current documentation contains li ordered lists, which have a period after each number. To match our new corporate standard, the periods must be removed. However, it does not appear possible to remove the period from the default li style in the mc-auto-number-format in Flare 6.

A paragraph style without the period works (p.NumberedList), but we do not want to retag every list in our current documentation.

Can the period be removed from the default li style? If not, what is the correct way to apply an automatically generated numbered list without the period?

What we want versus what we have:
You do not have the required permissions to view the files attached to this post.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Removing Periods from ol | li

Post by LTinker68 »

First, just to clarify, the mc-auto-number-format field is not for use with HTML lists, which are ones that are contained in <ol> or <ul> tags and that use the <li> for each line item. The auto-number attributes in the stylesheet are a MadCap feature, not a standard HTML feature.

Second, I don't believe there is a way to not have the period show up in HTML lists. There might be a CSS attribute to turn it off, but a quick Google search didn't return anything relevant, and even if it did, there's no guarantee it would be supported by all browsers or print outputs.

What you can do, however, is create a custom paragraph class and use that mc-auto-number-format field to compose your own custom list. Not only does Flare's custom auto-number formatting give you much more flexibility than HTML lists (including the ability to do legal numbering like 1.2.1 or 1.a.i), but you can also cross-reference to that number (e.g., "see step 1.2.1") which you can't do with HTML lists. And the auto-numbering format doesn't have to be numbers -- a lot of people use it for things like "Note" and "Tip" paragraphs.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Removing Periods from ol | li

Post by NorthEast »

Bonnie Kern wrote:A paragraph style without the period works (p.NumberedList), but we do not want to retag every list in our current documentation.

Can the period be removed from the default li style? If not, what is the correct way to apply an automatically generated numbered list without the period?
I'm fairly sure you can't remove the full-stop in a standard list item (or at least there doesn't appear to be any CSS setting).

If you need to use autonumbers, but don't want to reformat your lists, then you should be able to hide the numbering from the ol tag, and apply an autonumber to the li tag; e.g.

Code: Select all

ol
{
	list-style-type: none;
}

ol li
{
	mc-auto-number-format: '{n+} ';
}
I've used the selector ol li to only apply the autonumber to list items inside a numbered list - you don't want numbers on your bullet lists.
This might not look right in the editor, but should be ok in the preview/output.

It may need more tweaking, but hopefully you get the jist of it.
Bonnie Kern
Propeller Head
Posts: 29
Joined: Mon Mar 16, 2009 3:54 pm

Re: Removing Periods from ol | li

Post by Bonnie Kern »

Thank you. I have applied this change to our new corporate print medium in the .css, and the resulting output for an ordered list that contains paragraph items (including ol | li -and- ol | li | p -and- ol | li | ul | li), resembles the following. What am I missing?
You do not have the required permissions to view the files attached to this post.
NorthEast
Master Propellus Maximus
Posts: 6426
Joined: Mon Mar 05, 2007 8:33 am

Re: Removing Periods from ol | li

Post by NorthEast »

Bonnie Kern wrote:Thank you. I have applied this change to our new corporate print medium in the .css, and the resulting output for an ordered list that contains paragraph items (including ol | li -and- ol | li | p -and- ol | li | ul | li), resembles the following. What am I missing?
I'm not sure why you're still getting the list numbering ('1.' etc); it doesn't appear for me, in a blank stylesheet.
That is a screenshot of the preview/ouput, and not the editor?

I can also see that bullet lists which are nested in numbered lists are inheriting the autonumber; so to fix that part, you could add:

Code: Select all

ul li
{
	mc-auto-number-format: none;
}
Bonnie Kern
Propeller Head
Posts: 29
Joined: Mon Mar 16, 2009 3:54 pm

Re: Removing Periods from ol | li

Post by Bonnie Kern »

Yes, that is the generated output. I applied these changes to the css default settings, as well as the medium, and the results are the same. What am I missing?

The complete list does not generate correctly without the full-stops, although I have tried all of the suggestions with changes to the following:
ol
ol li
ol li p
ol li ul li
ul li

Is there something else we should apply, such as a transitional DTD? Thanks very much.
edwardanthony777
Jr. Propeller Head
Posts: 3
Joined: Mon May 11, 2015 1:34 pm

Re: Removing Periods from ol | li

Post by edwardanthony777 »

Not sure if this one was resolved, but since it's an old post, thought I would ask once again if there is a simple fix for this issue with Flare 10 or higher.

Issue: "Our current documentation contains li ordered lists, which have a period after each number. To match our new corporate standard, the periods must be removed. However, it does not appear possible to remove the period from the default li style in the mc-auto-number-format in Flare".

I tried a few variations suggested in this post with no luck, but thought perhaps with the newer release there is a better way.

Any help would be much appreciated!

Ed
edwardanthony777
Jr. Propeller Head
Posts: 3
Joined: Mon May 11, 2015 1:34 pm

Re: Removing Periods from ol | li

Post by edwardanthony777 »

I think I just solved it with the following:

ol {
counter-reset: item;
list-style-type: none;
}
ul li {
list-style-type: default;
}
ol li:before {
content: counter(item) " ";
counter-increment: item
}

Seems to work.
Post Reply