diff --git a/apps/remixdocgen/src/app/App.tsx b/apps/remixdocgen/src/app/App.tsx index dfbc3c43cd..0e88d4ba32 100644 --- a/apps/remixdocgen/src/app/App.tsx +++ b/apps/remixdocgen/src/app/App.tsx @@ -39,6 +39,7 @@ const App = () => { client.eventEmitter.on('docsGenerated', (docs: string[]) => { console.log('docsGenerated', docs) }) + }; @@ -50,6 +51,7 @@ const App = () => {

Remix Docgen

{fileName &&

File: {fileName}

} {hasBuild && } + {hasBuild && } ) }; diff --git a/apps/remixdocgen/src/app/docgen-client.ts b/apps/remixdocgen/src/app/docgen-client.ts index ad455f7ae8..721bb433b2 100644 --- a/apps/remixdocgen/src/app/docgen-client.ts +++ b/apps/remixdocgen/src/app/docgen-client.ts @@ -18,7 +18,7 @@ export class DocGenClient extends PluginClient { this.eventEmitter = new EventEmitter() createClient(this) // this.docgen = new DocGen() - this.methods = ['generateDocs', 'publishDocs'] + this.methods = ['generateDocs', 'publishDocs', 'viewDocs'] this.onload().then(async () => { console.log('docgen client loaded') await this.setListeners() @@ -26,7 +26,8 @@ export class DocGenClient extends PluginClient { } async setListeners() { - this.currentTheme = await this.call('theme', 'currentTheme'); + this.currentTheme = await this.call('theme', 'currentTheme') + this.on("theme", "themeChanged", (theme: any) => { this.currentTheme = theme this.eventEmitter.emit('themeChanged', this.currentTheme) @@ -64,6 +65,17 @@ export class DocGenClient extends PluginClient { this.eventEmitter.emit('docsGenerated', docs) } + async opendDocs() { + console.log('docgen client openDocs') + await this.call('manager', 'activatePlugin', 'docgenviewer') + await this.call('tabs' as any, 'focus', 'docgenviewer') + await this.call('docgenviewer' as any, 'viewDocs') + } + + async viewDocs(docs: string[]) { + console.log('docgen client viewDocs') + } + async generateDocs() { console.log('docgen client generateDocs') this.docgen([this.build])