getDocumentationSiteMap
API / @publicodes/react-ui / getDocumentationSiteMap
function getDocumentationSiteMap(engine): Record<string, string>; Defined in: index.ts:35
Get all the URLs of the documentation pages and their corresponding rule names.
Parameters
| Parameter | Type | Description |
|---|---|---|
engine | { documentationPath: string; engine: Engine; } | The engine instance containing the rules. |
engine.documentationPath | string | - |
engine.engine | Engine | - |
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'
// }