diff --git a/tools/dgeni/src/processors/markdown.ts b/tools/dgeni/src/processors/markdown.ts index fea67ce626..40b48f750c 100644 --- a/tools/dgeni/src/processors/markdown.ts +++ b/tools/dgeni/src/processors/markdown.ts @@ -81,13 +81,14 @@ export class MarkdownCodeProcessor implements Processor { $runAfter = ['paths-computed']; $runBefore = ['rendering-docs']; docTypes = []; + contentKey = 'content'; constructor() {} $process(docs: Document[]) { return docs.map((doc) => { if(this.docTypes.includes(doc.docType)){ - doc.content = marked.parse(doc.content); + doc[this.contentKey] = marked.parse(doc.content); }; return doc; }); diff --git a/tools/dgeni/src/transforms/daffodil-api-package/index.ts b/tools/dgeni/src/transforms/daffodil-api-package/index.ts index 6144727062..00aed855bc 100644 --- a/tools/dgeni/src/transforms/daffodil-api-package/index.ts +++ b/tools/dgeni/src/transforms/daffodil-api-package/index.ts @@ -14,6 +14,7 @@ import { FilterContainedDocsProcessor } from '../../processors/filterDocs'; import { FilterOutPrivatePropertiesProcessor } from '../../processors/filterOutPrivateProperties'; import { GenerateApiListProcessor } from '../../processors/generateApiList'; import { MakeTypesHtmlCompatibleProcessor } from '../../processors/makeTypesHtmlCompatible'; +import { MarkdownCodeProcessor } from '../../processors/markdown'; import { PackagesProcessor } from '../../processors/packages'; import { API_SOURCE_PATH, @@ -39,6 +40,7 @@ export const apiDocs = new Package('daffodil-api', [ .processor(new AddLinkTagToDaffodilReferencesProcessor()) .processor(new GenerateApiListProcessor()) .processor(new PackagesProcessor()) + .processor(new MarkdownCodeProcessor()) .factory('API_DOC_TYPES_TO_RENDER', (EXPORT_DOC_TYPES) => EXPORT_DOC_TYPES.concat(['component', 'directive', 'pipe', 'package'])) //Configure our package .config((readFilesProcessor, readTypeScriptModules, tsParser) => { @@ -59,6 +61,10 @@ export const apiDocs = new Package('daffodil-api', [ DAFF_DGENI_EXCLUDED_PACKAGES_REGEX + '/**/src/index.ts', ]; }) + .config((markdown: MarkdownCodeProcessor, EXPORT_DOC_TYPES) => { + markdown.docTypes.push(...EXPORT_DOC_TYPES); + markdown.contentKey = 'description'; + }) .config((computePathsProcessor, EXPORT_DOC_TYPES, generateApiList) => { const API_SEGMENT = DAFF_DOC_KIND_PATH_SEGMENT_MAP[DaffDocKind.API];