Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libro lab #6

Merged
merged 11 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@difizen/libro-shared-model": "0.0.1",
"@difizen/libro-toc": "0.0.1",
"@difizen/libro-widget": "0.0.1",
"@difizen/mana-docs": "0.0.1"
"@difizen/libro-docs": "0.0.1"
},
"changesets": ["shaggy-lemons-prove"]
}
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# libro

[![Code: CI](https://github.com/difizen/libro/actions/workflows/ci.yml/badge.svg)](https://github.com/difizen/libro/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/difizen/libro/graph/badge.svg?token=8LWLNZK78Z)](https://codecov.io/gh/difizen/libro)
<div align="center">
<img src="https://mdn.alipayobjects.com/huamei_hdnzbp/afts/img/A*cngiQYmKficAAAAAAAAAAAAADjOxAQ/original" alt="Editor" width="280">
</div>

<div id="top" align="center">
notebook 产品前端解决方案。
</div>

[![Code: CI](https://github.com/difizen/libro/actions/workflows/ci.yml/badge.svg)](https://github.com/difizen/libro/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/difizen/libro/graph/badge.svg?token=8LWLNZK78Z)](https://codecov.io/gh/difizen/libro)

- 优雅的交互和丰富的功能
- 方便扩展和二次开发
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @difizen/mana-docs
# @difizen/libro-docs

## 0.0.2-alpha.0

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/docs/examples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title: 输出示例
order: 0
---

# Libro 输出示例
# libro 输出示例

<code src="../../src/output" compact="true"></code>
10 changes: 10 additions & 0 deletions apps/docs/docs/examples/lab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: Lab
order: 1
---

# libro lab

本地在某个文件目录下,起一个`jupyterlab`服务,该文件目录中包含以 `.ipynb` 为后缀名的文件。

<code src="../../src/lab" compact="true"></code>
2 changes: 1 addition & 1 deletion apps/docs/docs/examples/workbench.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 工作台
order: 1
---

# Libro 工作台
# libro 工作台

本地在某个文件目录下,起一个`jupyterlab`服务,该文件目录中包含以 `.ipynb` 为后缀名的文件。

Expand Down
3 changes: 2 additions & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@difizen/mana-docs",
"name": "@difizen/libro-docs",
"version": "0.0.2-alpha.0",
"private": true,
"license": "MIT",
Expand All @@ -22,6 +22,7 @@
"@difizen/mana-app": "latest",
"@difizen/mana-react": "latest",
"@difizen/libro-jupyter": "^0.0.2-alpha.0",
"@difizen/libro-lab": "^0.0.2-alpha.0",
"@difizen/libro-core": "^0.0.2-alpha.0",
"@ant-design/icons": "^5.1.0",
"react": "^18.2.0",
Expand Down
22 changes: 22 additions & 0 deletions apps/docs/src/lab/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { ServerConnection, ServerManager } from '@difizen/libro-jupyter';
import { ConfigurationService } from '@difizen/mana-app';
import { SlotViewManager } from '@difizen/mana-app';
import { ApplicationContribution, ViewManager } from '@difizen/mana-app';
import { inject, singleton } from '@difizen/mana-app';

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

async onStart() {
this.serverConnection.updateSettings({
baseUrl: 'http://localhost:8888/',
wsUrl: 'ws://localhost:8888/',
});
this.serverManager.launch();
}
}
9 changes: 9 additions & 0 deletions apps/docs/src/lab/index.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.libro-workbench-app {
width: 100%;
height: calc(100vh - 61px);
}

.dumi-default-doc-layout > main {
margin: unset;
max-width: unset;
}
21 changes: 21 additions & 0 deletions apps/docs/src/lab/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { LibroLabModule } from '@difizen/libro-lab';
import { ManaAppPreset, ManaComponents, ManaModule } from '@difizen/mana-app';

import { LibroApp } from './app.js';
import './index.less';

const BaseModule = ManaModule.create().register(LibroApp);

const App = (): JSX.Element => {
return (
<div className="libro-workbench-app">
<ManaComponents.Application
key={'libro'}
asChild={true}
modules={[ManaAppPreset, LibroLabModule, BaseModule]}
/>
</div>
);
};

export default App;
5 changes: 0 additions & 5 deletions apps/docs/src/workbench/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ const BaseModule = ManaModule.create().register(
view: FileTreeView,
slot: LibroWorkbenchSlots.Left,
}),
// createViewPreference({
// autoCreate: true,
// view: FileTreeView,
// slot: LibroWorkbenchSlots.Left,
// }),
);

const App = (): JSX.Element => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"test": "nx run-many --target=test",
"ci": "nx run-many --target=lint:prettier,lint,test,test:jest",
"ci:affected": "nx affected --target=lint:prettier,lint,test:jest,coverage:jest",
"docs": "nx run @difizen/mana-docs:start",
"docs": "nx run @difizen/libro-docs:start",
"changeset": "changeset",
"clean": "git clean -fX ."
},
Expand Down
Loading