SimparaSniff
DocbookCS.Simpara
Flags <para> elements whose children are all inline elements. DocBook defines
<simpara> for paragraphs that contain only inline content; <para> is for
paragraphs that may contain block-level children. Using <para> when <simpara>
is sufficient adds unnecessary markup weight.
A <para> directly inside <formalpara> is always skipped.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
additionalInlineElements | string | — | Comma-separated list of extra element names to treat as inline. Add any project-specific inline elements that are not in the built-in list. |
severity | string | error | Override the violation severity. Accepted values: error, warning. |
Example configuration
docbookcs.xml
<sniff class="DocbookCS\Sniff\SimparaSniff">
<property name="additionalInlineElements" value="productname,trademark"/>
</sniff>
What it catches
Wrong - only inline content
<para>See <function>array_map</function> for details.</para>
Correct
<simpara>See <function>array_map</function> for details.</simpara>
Not flagged - has a block-level child
<para>
<programlisting role="php">echo 'hello';</programlisting>
</para>