Skip to content

Commit

Permalink
docs: add default example
Browse files Browse the repository at this point in the history
  • Loading branch information
BroKun committed Oct 20, 2023
1 parent dbe5623 commit 52366a0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: 输出示例
order: 0
nav:
path: /examples
---

# Libro 输出示例
Expand Down
2 changes: 0 additions & 2 deletions apps/docs/docs/examples/workbench.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
title: 工作台
order: 1
nav:
path: /examples
---

# Libro 工作台
Expand Down
15 changes: 6 additions & 9 deletions apps/docs/src/workbench/app.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import {
LibroService,
ServerConnection,
LibroJupyterConfiguration,
ServerManager,
} from '@difizen/libro-jupyter';
import type { FileTreeView } from '@difizen/mana-app';
import { ConfigurationService } from '@difizen/mana-app';
import { FileTreeViewFactory } from '@difizen/mana-app';
import { FileTreeViewFactory, SlotViewManager } from '@difizen/mana-app';
import { URI } from '@difizen/mana-app';
import {
ApplicationContribution,
SlotViewManager,
ViewManager,
} from '@difizen/mana-app';
import { ApplicationContribution, ViewManager } from '@difizen/mana-app';
import { inject, singleton } from '@difizen/mana-app';

import { LibroWorkbenchSlots } from './layout/workbench-layout.view.js';

@singleton({ contrib: ApplicationContribution })
export class LibroApp implements ApplicationContribution {
@inject(ServerConnection) serverConnection: ServerConnection;
@inject(LibroService) libroService: LibroService;
@inject(SlotViewManager) slotViewManager: SlotViewManager;
@inject(ServerManager) serverManager: ServerManager;
@inject(ViewManager) viewManager: ViewManager;
@inject(SlotViewManager) slotViewManager: SlotViewManager;
@inject(ConfigurationService) configurationService: ConfigurationService;

async onStart() {
Expand All @@ -33,6 +29,7 @@ export class LibroApp implements ApplicationContribution {
LibroJupyterConfiguration['OpenSlot'],
LibroWorkbenchSlots.Main,
);
this.serverManager.launch();
await this.initialWorkspace();
}

Expand Down
9 changes: 7 additions & 2 deletions apps/docs/src/workbench/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import {
createSlotPreference,
RootSlotId,
CardTabView,
SideTabView,
FileTreeView,
createViewPreference,
} from '@difizen/mana-app';
import { FileTreeView } from '@difizen/mana-app';

import { LibroApp } from './app.js';
import { LibroWorkbenchLayoutView, LibroWorkbenchSlots } from './layout/index.js';
Expand All @@ -29,6 +29,11 @@ const BaseModule = ManaModule.create().register(
view: FileTreeView,
slot: LibroWorkbenchSlots.Left,
}),
// createViewPreference({
// autoCreate: true,
// view: FileTreeView,
// slot: LibroWorkbenchSlots.Left,
// }),
);

const App = (): JSX.Element => {
Expand Down

0 comments on commit 52366a0

Please sign in to comment.