registerContentQualityAnnotationTypesCategory

Type: Function

How to get registerContentQualityAnnotationTypesCategory?

JavaScript

import registerContentQualityAnnotationTypesCategory from 'fontoxml-content-quality/src/registerContentQualityAnnotationTypesCategory.js'

Add configuration to group one or more annotation types in an annotation type category. Categories are helpful when you have multiple annotation types and want authors to be able to filter between these types.

See Configuring category filters for more information.

Backend category filtering

The category identifier can be used in the Fonto Content Quality back-end. Use the if analytic together with the enabled-categories-includes() XPath function to conditionally execute analytics based on the enabled categories.

Example usage

JavaScript

import registerContentQualityAnnotationTypesCategory from 'fontoxml-content-quality/src/registerContentQualityAnnotationTypesCategory.js';
registerContentQualityAnnotationTypesCategory(
    {
        id: 'spelling-and-grammar'
        label: t('Spelling & Grammar'),
        description: t('See suggestions for spelling & grammar mistakes')
    },
    [
        { namespaceURI: 'urn:fontoxml:content-quality:language-tool:1.0.0', localName: 'grammar-error' },
        { namespaceURI: 'urn:fontoxml:content-quality:language-tool:1.0.0', localName: 'spelling-error' }
    ]
);

Arguments

  1. category

    (Required)

    Type: Object

    Properties

  2. annotationTypeIds

    (Required)

    Type: Array<Object>

    A list of objects with the namespaceURI and localName of the annotation type you want to associate with this category. These are the same as used in registerContentQualityAnnotationType.