getDocumentationSiteMap
API / @publicodes/react-ui / getDocumentationSiteMap
function getDocumentationSiteMap(__namedParameters): Record<string, string>
Get all the URLs of the documentation pages and their corresponding rule names.
Parameters
Parameter | Type |
---|---|
__namedParameters | object |
__namedParameters.documentationPath | string |
__namedParameters.engine | Engine <string > |
Returns
Record
<string
, string
>
A record of rule names indexed by their corresponding documentation URLs.
Example
const engine = new Engine({
'contrat salarié': undefined,
'contrat salarié . rémunération': 2140,
})
const documentationPath = '/doc'
const siteMap = getDocumentationSiteMap({
engine,
documentationPath
})
// siteMap will be: {
// '/doc/contrat-salarié': 'contrat salarié',
// '/doc/contrat-salarié/rémuneration': 'contrat salarié . rémunération'
// }