mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-08 14:42:27 +08:00
doc: update doc styles
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user