Skip to content

Commit 98df806

Browse files
feat: add exported context to modules/classes
1 parent 45c6e5e commit 98df806

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/ParsedDocumentation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export declare type BaseDocumentationContainer = {
8080
export declare type ProcessBlock = {
8181
main: boolean;
8282
renderer: boolean;
83+
exported: boolean;
8384
};
8485
export declare type ModuleDocumentationContainer = {
8586
type: 'Module';

src/markdown-helpers.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,9 +755,16 @@ export const convertListToTypedKeys = (listTokens: Token[]): TypedKeyList => {
755755

756756
export const findProcess = (tokens: Token[]): ProcessBlock => {
757757
for (const tk of tokens) {
758-
if (tk.type === 'inline' && tk.content.indexOf('Process') === 0) {
758+
if (
759+
tk.type === 'inline' &&
760+
(tk.content.startsWith('Process') || tk.content.startsWith('Exported in'))
761+
) {
759762
const ptks = tk.children!.slice(2, tk.children!.length - 1);
760-
const procs: ProcessBlock = { main: false, renderer: false };
763+
const procs: ProcessBlock = {
764+
main: false,
765+
renderer: false,
766+
exported: tk.content.startsWith('Exported in'),
767+
};
761768
for (const ptk of ptks) {
762769
if (ptk.type !== 'text') continue;
763770
if (ptk.content === 'Main') procs.main = true;
@@ -766,7 +773,7 @@ export const findProcess = (tokens: Token[]): ProcessBlock => {
766773
return procs;
767774
}
768775
}
769-
return { main: true, renderer: true };
776+
return { main: true, renderer: true, exported: false };
770777
};
771778

772779
export const slugifyHeading = (heading: string): string => {

0 commit comments

Comments
 (0)