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

ParameterType
__namedParametersobject
__namedParameters.documentationPathstring
__namedParameters.engineEngine<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'
// }

Defined in

index.ts:35