Skip to content

Commit

Permalink
docs: 优化文档详情部分,优化文档导航包含详情部分的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kercylan98 committed Jan 14, 2024
1 parent c881ae4 commit f9d3188
Show file tree
Hide file tree
Showing 24 changed files with 102 additions and 15 deletions.
5 changes: 4 additions & 1 deletion examples/internal/deadlock-detect-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion examples/internal/room-shunt-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion examples/internal/simple-echo-websocket-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion examples/internal/ticker-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion examples/internal/ticker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
game 目录下包含了各类通用的游戏玩法性内容,其中该目录主要为基础性内容,具体目录将对应不同的游戏功能性内容。



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion game/activity/internal/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion game/activity/internal/example/activities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion planner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
planner 包含了策划工具相关的内容



</details>


***
## 详情信息
5 changes: 4 additions & 1 deletion planner/pce/exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@
|:--|:--



</details>


***
## 详情信息
4 changes: 4 additions & 0 deletions planner/pce/exporter/cmd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
|[Execute](#Execute)|将所有子命令添加到根命令并适当设置标志。这是由 main.main() 调用的。 rootCmd 只需要发生一次



</details>


***
## 详情信息
#### func Execute()
Expand Down
5 changes: 4 additions & 1 deletion utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ utils 旨在提供一组用于处理通用功能的函数和数据结构。该
- 工具函数:该包还提供了一些通用的工具函数,如字符串处理、日期时间操作和文件操作等。这些工具函数可以帮助您简化代码编写,处理文本数据,操作日期时间,读写文件等。



</details>


***
## 详情信息
4 changes: 4 additions & 0 deletions utils/compress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ compress 提供了一些用于压缩和解压缩数据的函数。
|[ZIPUnCompress](#ZIPUnCompress)|对已进行ZIP压缩的数据进行解压缩,返回字节数组及错误信息



</details>


***
## 详情信息
#### func GZipCompress(data []byte) bytes.Buffer, error
Expand Down
4 changes: 4 additions & 0 deletions utils/crypto/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
|[DecodedSHA256](#DecodedSHA256)|对字节数组进行SHA256加密并返回其结果。



</details>


***
## 详情信息
#### func EncryptBase64(data []byte) string
Expand Down
4 changes: 4 additions & 0 deletions utils/file/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
|[FindLineChunksByOffset](#FindLineChunksByOffset)|该函数与 FindLineChunks 类似,不同的是该函数可以指定 offset 从指定位置开始读取文件



</details>


***
## 详情信息
#### func PathExist(path string) bool, error
Expand Down
13 changes: 10 additions & 3 deletions utils/generator/genreadme/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/kercylan98/minotaur/utils/super"
"go/format"
"strings"
"sync"
)

func New(pkgDirPath string, output string) (*Builder, error) {
Expand Down Expand Up @@ -97,14 +98,18 @@ func (b *Builder) genMenus() {
collection.FindFirstOrDefaultInSlice(structInfo.Comments.Clear, "暂无描述..."),
)
}
b.detailsEnd()
}

b.detailsEnd()
b.newLine("***")
}

func (b *Builder) genStructs() {
b.title(2, "详情信息")
var titleOnce sync.Once
var titleBuild = func() {
titleOnce.Do(func() {
b.title(2, "详情信息")
})
}

var funcHandler = func(params []*astgo.Field) string {
var s string
Expand All @@ -127,6 +132,7 @@ func (b *Builder) genStructs() {
if function.Internal || function.Test {
continue
}
titleBuild()
b.title(4, strings.TrimSpace(fmt.Sprintf("func %s%s %s",
function.Name,
func() string {
Expand Down Expand Up @@ -165,6 +171,7 @@ func (b *Builder) genStructs() {
if structInfo.Internal || structInfo.Test {
continue
}
titleBuild()
b.title(3, fmt.Sprintf("%s `%s`", structInfo.Name, super.If(structInfo.Interface, "INTERFACE", "STRUCT")))
b.newLine(structInfo.Comments.Clear...)
b.newLine("```go")
Expand Down
4 changes: 4 additions & 0 deletions utils/network/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
|[IP](#IP)|返回本机出站地址



</details>


***
## 详情信息
#### func IP() (ip net.IP, err error)
Expand Down
4 changes: 4 additions & 0 deletions utils/random/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
|[WeightMapKey](#WeightMapKey)|按权重随机从map中产生一个数据并返回数据和对应 key



</details>


***
## 详情信息
#### func Dice() int
Expand Down
4 changes: 4 additions & 0 deletions utils/reflects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
|[GetPointer](#GetPointer)|获取指针



</details>


***
## 详情信息
#### func WrapperFunc(f any, wrapper func (call func ( []reflect.Value) []reflect.Value) func (args []reflect.Value) []reflect.Value) (wf Func, err error)
Expand Down
4 changes: 4 additions & 0 deletions utils/runtimes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
|[CurrentRunningFuncName](#CurrentRunningFuncName)|获取正在运行的函数名



</details>


***
## 详情信息
#### func GetWorkingDir() string
Expand Down
4 changes: 4 additions & 0 deletions utils/sorts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
|[Topological](#Topological)|拓扑排序是一种对有向图进行排序的算法,它可以用来解决一些依赖关系的问题,比如计算字段的依赖关系。拓扑排序会将存在依赖关系的元素进行排序,使得依赖关系的元素总是排在被依赖的元素之前。



</details>


***
## 详情信息
#### func Topological(slice S, queryIndexHandler func (item V) Index, queryDependsHandler func (item V) []Index) S, error
Expand Down
4 changes: 4 additions & 0 deletions utils/str/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
|[FormatSpeedyFloat64](#FormatSpeedyFloat64)|返回numberStr经过格式化后去除空格和“,”分隔符的结果



</details>


***
## 详情信息
#### func RangeLine(eachString string, eachFunc func (index int, line string) error) error
Expand Down
4 changes: 4 additions & 0 deletions utils/xlsxtool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
|[GetSheetMatrix](#GetSheetMatrix)|将sheet转换为二维矩阵



</details>


***
## 详情信息
#### func GetSheetMatrix(sheet *xlsx.Sheet) *matrix.Matrix[*xlsx.Cell]
Expand Down

0 comments on commit f9d3188

Please sign in to comment.