1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-06 13:42:28 +08:00

doc: update doc styles

This commit is contained in:
dudaodong
2023-08-24 19:27:47 +08:00
parent fbeb031b40
commit 51f166d1d9
9 changed files with 48 additions and 44 deletions

View File

@@ -39,7 +39,7 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## 文档

View File

@@ -35,7 +35,7 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="../../styles/api_doc.css">
## 文档

View File

@@ -33,13 +33,15 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## 文档
### Channel
### <span id="NewChannel">NewChannel</span>
<p>返回一个Channel指针实例</p>
<b>函数签名:</b>
@@ -48,7 +50,7 @@ import (
type Channel[T any] struct
func NewChannel[T any]() *Channel[T]
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
```go
package main
@@ -67,12 +69,12 @@ func main() {
<p>将多个channel链接到一个channel直到取消上下文。</p>
<b>函数签名:</span></b>
<b>函数签名:</b>
```go
func (c *Channel[T]) Bridge(ctx context.Context, chanStream <-chan <-chan T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qmWSy1NVF-Y)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/qmWSy1NVF-Y)</span></b>
```go
package main
@@ -124,7 +126,7 @@ func main() {
```go
func (c *Channel[T]) FanIn(ctx context.Context, channels ...<-chan T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2VYFMexEvTm)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/2VYFMexEvTm)</span></b>
```go
package main
@@ -163,7 +165,7 @@ func main() {
```go
func (c *Channel[T]) Generate(ctx context.Context, values ...T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
```go
package main
@@ -201,7 +203,7 @@ func main() {
```go
func (c *Channel[T]) Repeat(ctx context.Context, values ...T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/k5N_ALVmYjE)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/k5N_ALVmYjE)</span></b>
```go
package main
@@ -240,7 +242,7 @@ func main() {
```go
func (c *Channel[T]) RepeatFn(ctx context.Context, fn func() T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4J1zAWttP85)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/4J1zAWttP85)</span></b>
```go
package main
@@ -281,7 +283,7 @@ func main() {
```go
func (c *Channel[T]) Or(channels ...<-chan T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Wqz9rwioPww)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/Wqz9rwioPww)</span></b>
```go
package main
@@ -324,7 +326,7 @@ func main() {
```go
func (c *Channel[T]) OrDone(ctx context.Context, channel <-chan T) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/lm_GoS6aDjo)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/lm_GoS6aDjo)</span></b>
```go
package main
@@ -362,7 +364,7 @@ func main() {
```go
func (c *Channel[T]) Take(ctx context.Context, valueStream <-chan T, number int) <-chan T
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9Utt-1pDr2J)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/9Utt-1pDr2J)</span></b>
```go
package main
@@ -408,7 +410,7 @@ func main() {
```go
func (c *Channel[T]) Tee(ctx context.Context, in <-chan T) (<-chan T, <-chan T)
```
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3TQPKnCirrP)</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/3TQPKnCirrP)</span></b>
```go
package main

View File

@@ -31,7 +31,7 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## 文档
@@ -47,7 +47,7 @@ slices和map的length大于0时返回true否则返回false<br/>
```go
func Bool[T any](value T) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ETzeDJRSvhm)</span></b>
```go
package main
@@ -111,7 +111,7 @@ func main() {
```go
func And[T, U any](a T, b U) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/W1SSUmt6pvr)</span></b>
```go
package main
@@ -137,7 +137,7 @@ func main() {
```go
func Or[T, U any](a T, b U) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/UlQTxHaeEkq)</span></b>
```go
package main
@@ -163,7 +163,7 @@ func main() {
```go
func Xor[T, U any](a T, b U) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/gObZrW7ZbG8)</span></b>
```go
package main
@@ -189,7 +189,7 @@ func main() {
```go
func Nor[T, U any](a T, b U) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/g2j08F_zZky)</span></b>
```go
package main
@@ -215,7 +215,7 @@ func main() {
```go
func Xnor[T, U any](a T, b U) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/OuDB9g51643)</span></b>
```go
package main
@@ -241,7 +241,7 @@ func main() {
```go
func Nand[T, U any](a T, b U) bool
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/vSRMLxLIbq8)</span></b>
```go
package main
@@ -267,7 +267,7 @@ func main() {
```go
func TernaryOperator[T, U any](isTrue T, ifValue U, elseValue U) U
```
<b>示例:</b>
<b>示例:<span class="run-container">[运行](https://go.dev/play/p/ElllPZY0guT)</span></b>
```go
package main

View File

@@ -12,7 +12,7 @@ Package algorithm implements some basic algorithm. eg. sort, search.
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## Usage

View File

@@ -34,7 +34,7 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## Documentation

View File

@@ -33,7 +33,7 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="../api_doc.css">
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## Documentation
@@ -47,7 +47,7 @@ import (
type Channel[T any] struct
func NewChannel[T any]() *Channel[T]
```
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</b>
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
```go
package main
@@ -71,7 +71,7 @@ func main() {
```go
func (c *Channel[T]) Bridge(ctx context.Context, chanStream <-chan <-chan T) <-chan T
```
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/qmWSy1NVF-Y)</b>
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/qmWSy1NVF-Y)</span></b>
```go
package main
@@ -123,7 +123,7 @@ func main() {
```go
func (c *Channel[T]) FanIn(ctx context.Context, channels ...<-chan T) <-chan T
```
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/2VYFMexEvTm)</b>
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/2VYFMexEvTm)</span></b>
```go
package main
@@ -157,7 +157,7 @@ func main() {
<p>Create channel, put values into the channel repeatly until cancel the context.</p>
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/k5N_ALVmYjE)</b>
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/k5N_ALVmYjE)</span></b>
```go
func (c *Channel[T]) Repeat(ctx context.Context, values ...T) <-chan T
@@ -201,7 +201,7 @@ func main() {
```go
func (c *Channel[T]) Generate(ctx context.Context, values ...T) <-chan T
```
<b>Example: <span class="run-container">[运行](https://go.dev/play/p/7aB4KyMMp9A)</b>
<b>Example: <span class="run-container">[Run](https://go.dev/play/p/7aB4KyMMp9A)</span></b>
```go
package main
@@ -234,7 +234,7 @@ func main() {
<p>Create a channel, excutes fn repeatly, and put the result into the channel, until close context.</p>
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/4J1zAWttP85)</b>
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/4J1zAWttP85)</span></b>
```go
func (c *Channel[T]) RepeatFn(ctx context.Context, fn func() T) <-chan T
@@ -276,7 +276,7 @@ func main() {
<p>Read one or more channels into one channel, will close when any readin channel is closed.</p>
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/Wqz9rwioPww)</b>
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/Wqz9rwioPww)</span></b>
```go
func (c *Channel[T]) Or(channels ...<-chan T) <-chan T
@@ -319,7 +319,7 @@ func main() {
<p>Read a channel into another channel, will close until cancel context.</p>
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/lm_GoS6aDjo)</b>
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/lm_GoS6aDjo)</span></b>
```go
func (c *Channel[T]) OrDone(ctx context.Context, channel <-chan T) <-chan T
@@ -357,7 +357,7 @@ func main() {
<p>Create a channel whose values are taken from another channel with limit number.</p>
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/9Utt-1pDr2J)</b>
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/9Utt-1pDr2J)</span></b>
```go
func (c *Channel[T]) Take(ctx context.Context, valueStream <-chan T, number int) <-chan T
@@ -403,7 +403,7 @@ func main() {
<p>Split one chanel into two channels, until cancel the context.</p>
<b>Signature: <span class="run-container">[运行](https://go.dev/play/p/3TQPKnCirrP)</b>
<b>Signature: <span class="run-container">[Run](https://go.dev/play/p/3TQPKnCirrP)</span></b>
```go
func (c *Channel[T]) Tee(ctx context.Context, in <-chan T) (<-chan T, <-chan T)

View File

@@ -31,6 +31,8 @@ import (
<div STYLE="page-break-after: always;"></div>
<link rel="stylesheet" type="text/css" href="/styles/api_doc.css">
## Documentation
@@ -46,7 +48,7 @@ All other types are truthy if they are not their zero value.</p>
```go
func Bool[T any](value T) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/ETzeDJRSvhm)</span></b>
```go
package main
@@ -111,7 +113,7 @@ func main() {
```go
func And[T, U any](a T, b U) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/W1SSUmt6pvr)</span></b>
```go
package main
@@ -139,7 +141,7 @@ func main() {
```go
func Or[T, U any](a T, b U) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/UlQTxHaeEkq)</span></b>
```go
package main
@@ -167,7 +169,7 @@ func main() {
```go
func Xor[T, U any](a T, b U) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/gObZrW7ZbG8)</span></b>
```go
package main
@@ -195,7 +197,7 @@ func main() {
```go
func Nor[T, U any](a T, b U) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/g2j08F_zZky)</span></b>
```go
package main
@@ -222,7 +224,7 @@ func main() {
```go
func Xnor[T, U any](a T, b U) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/OuDB9g51643)</span></b>
```go
package main
@@ -249,7 +251,7 @@ func main() {
```go
func Nand[T, U any](a T, b U) bool
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/vSRMLxLIbq8)</span></b>
```go
package main
@@ -277,7 +279,7 @@ func main() {
```go
func TernaryOperator[T, U any](isTrue T, ifValue U, elseValue U) U
```
<b>Example:</b>
<b>Example:<span class="run-container">[运行](https://go.dev/play/p/ElllPZY0guT)</span></b>
```go
package main