import * as assets from './assets' ; import * as configure from './configure' ; import * as render from './render' ; import path from 'path' ; import { PolicyBuilderConfig , PolicyBuilderPaths } from '~/src/types' ; const defaultPaths = { partials : 'partials' , templates : 'templates' , output : 'docs' , } ; export async function policybuilder ( configuration , paths = defaultPaths ) { configure . mergeAutomaticPSPVars ( configuration ) ; await assets . copyStaticAssets ( paths ) ; await assets . downloadCustomLogo ( configuration , paths ) ; await render . renderMkdocsYAML ( configuration , paths , path . join ( paths . output , 'mkdocs.yml' ) ) ; await render . renderIndexPage ( configuration , paths , path . join ( paths . output , 'index.md' ) ) ; const renderedPartials = await render . renderPartials ( configuration , paths ) ; const renderedPSPDocs = await render . renderPSPDocs ( configuration , paths ) ; return { renderedPartials , renderedPSPDocs } ; }