content-quality-configuration

Type: Object

Set to an object containing the configuration properties for Content Quality. This extends the default configuration.

You can set this configuration using the configurationManager configurationManager.set('content-quality-configuration', {});.

Configuration for Content Quality. Typically you only need to set the chunkIsContentQuery to ignore some of the elements which do not contain contents. And/or set the baseIETFLanguageQuery and nodeIETFLanguageQuery if you use a non use the xml:lang attribute for languages or have you own default fallback language.

Properties

Name Type Description
[baseIETFLanguageQuery] XPathTest

A XPathTest which must return the base language string for a chunk in IETF BCP-47 format. This can be gotten either from an node, ancestor node or a default language fallback. Defaults to (ancestor-or-self::*[@xml:lang][1]/@xml:lang, "en-US")[1].

```xpath
(: Fixed language :)
"en-US"
```
```xpath
(: Custom language attribute using underscores :)
(ancestor-or-self::*[@language][1]/@language/replace(., "_", "-"), "en-US")[1]
```
```xpath
(: Custom language attribute with mapping :)
(ancestor-or-self::*[@language][1]/editorName:getLang(@language), "en-US")[1]
```
```javascript
// Register custom language mapping function
registerCustomXPathFunction('editorName:getLang', [ 'xs:string?' ], 'xs:string?', function (dynamicContext, language) {
    return mapLanguageToIETF(language) || null;
});
```
[checkTimeout] Number

The timeout in milliseconds used for debouncing backend requests on content mutations. Defaults to 200.

[chunkBorderQuery] XPathTest

A XPathTest that determines if a node is a chunk. Defaults to fonto:block-layout(.) or fonto:is-removed(.) or fonto:closed(.).

[chunkIsContentQuery] XPathTest

A XPathTest that determines if the chunk should be annotated. Defaults to fonto:block-layout(.) and not(fonto:closed(.)) and not(fonto:is-removed(.)).

```xpath
(: Ignore some elements, for example in DITA do not process the data element and anything in a map :)
not(self::data) and not(/map) and fonto:block-layout(.) and not(fonto:closed(.)) and not(fonto:is-removed(.))
```
[isEnabledOnLoad] Boolean

Indicates if Content Quality should be active on load. Defaults to false.

[nodeIETFLanguageQuery] XPathTest

A XPathTest which can return a IETF BCP-47 language code of a specific node, if any. This should NOT look at ancestors or default languages. Defaults to @Q{http://www.w3.org/XML/1998/namespace}lang.

```xpath
(: Custom language attribute with mapping :) @language => editorName:getLang()
```
semanticAttributes Array<SemanticAttribute>

An array containing attributes which should trigger a recheck of a node when the attribute value changes. For example, language tag(s) or concept URIs. Defaults to [ { attributeName: 'lang', attributeNamespace: 'http://www.w3.org/XML/1998/namespace' } ]

```javascript
// If you have attributes which could impact the annotation results, you can specify them. For example in DITA
// when you use the `xref` element and have an annotator which checks validity (for example obsolete entities),
// you can specify the `href` attribute to be a semantic attribute.
[
    { attributeName: 'lang', attributeNamespace: 'http://www.w3.org/XML/1998/namespace' },
    { attributeName: 'href', elementQuery: 'self::xref' }
]
```

  SemanticAttribute

Type: Object

Configuration for a semantic attribute.

Properties

Name Type Description
attributeName String

The local name of the attribute.

[attributeNamespace] String

The namespace URI of the attribute. When null, it WILL be checked; when not defined, it is not checked.

[elementQuery] String

A XPathTest that determines if the attribute is of the intended element.

[sidebarHeading] String

The heading to use for the "Quality check" sidebar pane.

[sidebarIcon] String

The icon to use for the "Quality check" sidebar tab button.

[sidebarLabel] String

The label to use for the "Quality check" sidebar tab button.

[sidebarTooltipContent] String

The tooltip to use for the "Quality check" sidebar tab button.

Was this page helpful?