dita-lightweight-dita message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Notes on lists, tight and loose, and @compact attribute
- From: Mark Giffin <mark@markgiffin.com>
- To: "dita-lightweight-dita@lists.oasis-open.org" <dita-lightweight-dita@lists.oasis-open.org>
- Date: Sun, 1 Oct 2023 18:11:47 -0700
Executive Summary
- We discussed adding tight/loose lists to MDITA to match
CommonMark spec.
- Related to this, we talked about adding @compact attribute
(from DITA 1.3) to XDITA and HDITA.
- However, @compact was removed from HTML5 (replaced with CSS as
it should be).
- This question arose: Should @compact be removed from DITA 2.0?
Isn't it an archaic styling attribute?
Still to be decided:
- How to handle tight/loose lists in MDITA
- How will that affect XDITA and HDITA, if at all
Background Info
This subcommittee discussion came up because of the following DITA
OT bug, which applies only to MDITA and Markdown, not XML DITA:
https://github.com/jelovirt/org.lwdita/issues/175
Summary of Bug 175
In the original Markdown, to make HTML output list spacing tight,
you would put carriage return between list items. To give the HTML
output looser spacing, you'd put a carriage return between list
items. This idea was carried over into the CommonMark Markdown
standard, which MDITA is based on. Here is the CommonMark spec on
this subject:
https://spec.commonmark.org/0.30/#loose
Even though MDITA is based on CommonMark, MDITA was not designed to
support tight and loose lists like this, so it violates CommonMark
on this point. This pretty much applies only to HTML output. For
other output like PDF, it probably does not really apply. Or should
not apply. This caused us to look at the @compact attribute for DITA
1.3 XML.
The @compact Attribute Was Removed in HTML5
In HTML5, the @compact attribute has been removed. It was deprecated
in HTML 4, 20 years ago. Modern popular browsers do not support
@compact, they ignore it. It can be replaced with CSS.
Mozilla Developer Network docs on @compact in <ul>:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ul
compact - Deprecated Non-standard
Warning: Do not use this attribute, as it has been deprecated: use
CSS instead. To give a similar effect as the compact attribute,
the CSS property line-height can be used with a value of 80%.
DITA 1.3 Still Supports @compact
DITA 1.3 @compact attribute in the spec:
https://www.oxygenxml.com/dita/1.3/specs/langRef/attributes/commonAttributes.html#common-atts__compact
Indicates close vertical spacing between list items.
Expanded spacing is the processing default. The output result of
compact spacing depends on the processor or browser. Allowable
values are:
yes - Indicates compact spacing.
no - Indicates expanded spacing.
DITA Open Toolkit Support for @compact
DITA 1.3 XML content using @compact:
Running XHTML output through the latest DITA OT version (4.1.1) with
DITA 1.3 XML content using @compact on <ul>, produces results
in XHTML like this:
<ul class="ul" compact="compact">
ÂÂÂÂÂÂÂ <li class="li">one</li>
But since @compact is archaic HTML syntax, it is unsupported by
modern browsers. You could probably make a CSS class that operated
on @compact, but why bother. Use HTML @class.
- XDITA does not support @compact
- HDITA - Does not support @compact. And since @compact is gone
in HTML5, use CSS instead.
- MDITA - DITA OT does not recognize tight/loose lists in MDITA.
That's it.
Mark Giffin
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]