Page 1 of 1

importance="optional" for li ?

Posted: Thu Feb 08, 2018 8:23 pm
by DrStrangelove
We recently converted our content to Dita. Some of our tasks correctly use steps/step but many are still using ul/li. We eventually intend to convert them but that cannot be completed in the available timeframe.

We want optional steps to be labelled as "Optional:" regardless of whether the importance is on the step or on the li.

Code: Select all

<li importance="optional">Do this.</li>
importance="optional" is valid for li. I added the following to the style sheet, but the output does not include the label. How can I get this to work?

Code: Select all

li[importance="optional"]:before {
content: "Optional: ";
font-weight: bold;
}

Re: importance="optional" for li ?

Posted: Fri Feb 09, 2018 1:37 pm
by Costin
Hi DrStrangelove,

Setting the importance="optional" attribute on the <li/> does not affect the output, as the attribute is not passed to the class appropriate for list entries.
Therefore, the solution would be to set the outputclass attribute to "optional" instead.
Specifically, in your documents, you should use something like:

Code: Select all

<li outputclass="optional">Do this.</li>
In the output, this would translate in

Code: Select all

<li class="li optional">Do this.</li>
, so you could just filter the optional list entries from CSS.

Regards,
Costin

Re: importance="optional" for li ?

Posted: Fri Feb 09, 2018 8:58 pm
by DrStrangelove
Thank you!