Skip to content

Commit

Permalink
doc(dome/doc): update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
chongqiangchen committed Apr 18, 2023
1 parent 5a8c475 commit ec18ff9
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = {
'class-methods-use-this': 'off',
radix: 'off',
'guard-for-in': 'off',
'max-len': ['error', { code: 150 }],
'max-len': ['error', { code: 250 }],

// TypeScript 相关
'@typescript-eslint/explicit-function-return-type': 'off',
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/relesae.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
paths-ignore:
- 'apps/**'

concurrency: ${{ github.workflow }}-${{ github.ref }}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
title: Docusaurus 插件
title: 引导
hide_title: true
slug: /docusaurus-plugins
---


## Docusaurus 插件

> 你可以使用 `solive-docusaurus-theme-code` 插件快速集成一个轻量级Solidity Editor嵌入你的文档.
> 你可以使用 `solive-docusaurus-theme-code` 插件快速集成一个轻量级Solidity Editor嵌入你的文档. (完善中)
### 安装

Expand All @@ -27,22 +29,22 @@ module.exports = {
### 快速使用

1. 你需要注意在代码块标记solive,和配置solive的属性:
```md
```solidity solive height=300px
````md
```solidity solive height=500px
// your code
```\
```
```
````

2. 你可以在代码块中配置solive相关属性 `height`(具体参考[属性表](/docs/solive-props)):
```md
2. 你可以在代码块中配置solive相关属性 `height`(具体参考[属性表](/docs/docusaurus-plugins/props)):
````md
```solidity solive height=300px
// your code
```\
```
```
````

3. 配置代码块文件名(可多文件):
```md
```solidity solive height=300px
````md
```solidity solive height=500px
/**
* @filename Storage.sol
*/
Expand All @@ -54,12 +56,12 @@ module.exports = {
*/

// your code
```\
```
```
````

3. 完整的代码块示例:
````md
```solidity solive height=300px
```solidity solive height=500px
/**
* @filename Storage.sol
*/
Expand Down Expand Up @@ -94,12 +96,12 @@ contract Storage {
return number;
}
}
```\
```
````

### 展示结果:

```solidity solive height=300px
```solidity solive height=500px
/**
* @filename Storage.sol
*/
Expand Down
21 changes: 21 additions & 0 deletions apps/doc/docs/expansion/docusaurus-plugins/props.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: 属性
slug: /docusaurus-plugins/props
hide_title: true
---

## 属性

> 注意:考虑对参数匹配的准确性和文档UI适应性,部分Solive的属性默认值有所变动,并增加和变动一些新的属性
| 属性 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| width | string | 90% | 容器宽度 |
| height | string | 500px | 容器高度 |
| consoleOpen | boolean | true | 是否显示控制台 |
| consoleTriggerControl | boolean | false | 是否显示控制台触发按钮 |
| consoleDefaultVisible | boolean | false | 控制台默认是否可见 |
| deployOpen | boolean | true | 是否显示部署 |
| deployDefaultVisible | boolean | false | 部署默认是否可见 |
| fileNavOpen | boolean | true | 是否显示文件导航栏 |
| fileNavDefaultVisible | boolean | false | 文件导航栏默认是否可见 |
38 changes: 32 additions & 6 deletions apps/doc/docs/get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,42 @@ pnpm install solive-core

```js
// 使用craco配置:
const nodeExternals = require('webpack-node-externals');
const webpack = require("webpack");

module.exports = {
// ...
webpack: {
configure: (webpackConfig, { env, paths }) => {
webpackConfig.externalsPresets = {node: true};
webpackConfig.externals = [nodeExternals()];
return webpackConfig;
}
configure: (webpackConfig, { env, paths }) => {
// eslint-disable-next-line no-param-reassign
webpackConfig.resolve.fallback = {
"http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"),
"zlib": require.resolve("browserify-zlib"),
"stream": require.resolve("stream-browserify"),
"events": require.resolve("events/"),
"crypto": require.resolve("crypto-browserify"),
"assert": require.resolve("assert/"),
"buffer": require.resolve("buffer/"),
"util": require.resolve("util/"),
"path": require.resolve("path-browserify"),
"tty": require.resolve("tty-browserify"),
"os": require.resolve("os-browserify/browser"),
"punycode": require.resolve("punycode/"),
"fs": false,
"url": require.resolve("url/"),
"net": require.resolve("net-browserify"),
"child_process": false,
async_hooks: false,
rawBody: false,
};

webpackConfig.plugins.push(
new webpack.ProvidePlugin({
Buffer: ["buffer", "Buffer"]
})
);
return webpackConfig;
}
}
};

Expand Down

0 comments on commit ec18ff9

Please sign in to comment.