import { Package } from 'dgeni' ; import { Document } from '../shared' ; import { computeOutputPathProcessor , computeWhoUsesProcessor , extractContentTitleProcessor , } from './processors' ; import { ContentFileReader , contentFileReader } from './readers' ; import { nestjsMarkedNunjucksFilter } from './rendering/filters/nestjs-marked' ; import { nestjsMarkedNunjucksTag } from './rendering/tags/nestjs-marked' ; import { renderNestJSMarkdown } from './services' ; export default new Package ( 'content' , [ ] ) . factory ( contentFileReader ) . factory ( renderNestJSMarkdown ) . factory ( nestjsMarkedNunjucksTag ) . factory ( nestjsMarkedNunjucksFilter ) . processor ( extractContentTitleProcessor ) . processor ( computeOutputPathProcessor ) . processor ( computeWhoUsesProcessor ) . config ( ( readFilesProcessor , contentFileReader ) => { readFilesProcessor . fileReaders . push ( contentFileReader ) ; } ) . config ( ( templateEngine , nestjsMarkedNunjucksTag , nestjsMarkedNunjucksFilter ) => { templateEngine . tags . push ( nestjsMarkedNunjucksTag ) ; templateEngine . filters . push ( nestjsMarkedNunjucksFilter ) ; } ) . config ( computeIdsProcessor => { computeIdsProcessor . idTemplates . push ( { docTypes : [ 'content' , 'who-uses' ] , getId : ( doc ) => { return ( doc . fileInfo . relativePath . replace ( /.*\/?modules\// , '' ) . replace ( /\/docs\// , '/' ) . replace ( /\.\w*$/ , '' ) ) ; } , getAliases : ( doc ) => [ doc . id ] , } ) ; } ) ; export * from './processors' ; export * from './readers' ;