Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
txthinking committed Sep 21, 2024
1 parent 206135a commit dce11e6
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 79 deletions.
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ brook server -l :9999 -p hello

## Client

| iOS | Android | Mac |Windows |Linux |OpenWrt |
| --- | --- | --- | --- | --- | --- |
| [![](https://brook.app/images/appstore.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![](https://brook.app/images/android.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.apk) | [![](https://brook.app/images/mac.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![Windows](https://brook.app/images/windows.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.msix) | [![](https://brook.app/images/linux.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.bin) | [![OpenWrt](https://brook.app/images/openwrt.png)](https://github.com/txthinking/brook/releases) |
| / | / | [App Mode](https://www.txthinking.com/talks/articles/macos-app-mode-en.article) | [How](https://www.txthinking.com/talks/articles/msix-brook-en.article) | [How](https://www.txthinking.com/talks/articles/linux-app-brook-en.article) | [How](https://www.txthinking.com/talks/articles/brook-openwrt-en.article) |
- [iOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Android](https://github.com/txthinking/brook/releases/latest/download/Brook.apk)
- [macOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Windows](https://github.com/txthinking/brook/releases/latest/download/Brook.msix)
- [Linux](https://github.com/txthinking/brook/releases/latest/download/Brook.bin)
- [OpenWrt](https://github.com/txthinking/brook/releases)

> You may want to use `brook link` to customize some parameters
- [About App Mode on macOS](https://www.txthinking.com/talks/articles/macos-app-mode-en.article)
- [How to install Brook on Windows?](https://www.txthinking.com/talks/articles/msix-brook-en.article)
- [How to install Brook on Linux](https://www.txthinking.com/talks/articles/linux-app-brook-en.article)
- [How to install Brook on OpenWrt](https://www.txthinking.com/talks/articles/brook-openwrt-en.article)

# Client

Brook GUI will pass different _global variables_ to the script at different times, and the script only needs to assign the processing result to the global variable `out`
Expand Down Expand Up @@ -449,7 +457,7 @@ Brook [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...]

- **--dialWithSocks5Username**="": If there is

- **--help, -h**: show help


- **--ipLimitInterval**="": Interval (s) for ipLimitMax (default: 0)

Expand Down Expand Up @@ -1028,11 +1036,11 @@ Generate markdown page

- **--file, -f**="": Write to file, default print to stdout

- **--help, -h**: show help

### help, h

Shows a list of commands or help for one command




## manpage

Expand All @@ -1045,6 +1053,7 @@ Generate man.1 page
## help, h

Shows a list of commands or help for one command

# Examples

List some examples of common scene commands, pay attention to replace the parameters such as IP, port, password, domain name, certificate path, etc. in the example by yourself
Expand Down
30 changes: 30 additions & 0 deletions docs/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bun

import * as fs from 'node:fs/promises'
import { $ } from 'bun'

var f = await fs.open("../readme.md", 'w+');
await fs.write(f.fd, '# Brook\n')
await fs.write(f.fd, '<!--SIDEBAR-->\n')
await fs.write(f.fd, '<!--G-R3M673HK5V-->\n')
await fs.write(f.fd, 'A cross-platform programmable network tool.\n')
await fs.write(f.fd, '\n')
await fs.write(f.fd, '# Sponsor\n')
await fs.write(f.fd, '**❤️ [Shiliew - A network app designed for those who value their time](https://www.txthinking.com/shiliew.html)**\n')

var s = await fs.readFile('getting-started.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
var s = await fs.readFile('gui.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
await fs.write(f.fd, '# CLI Documentation\n')
await fs.write(f.fd, 'Each subcommand has a `--example` parameter that can print the minimal example of usage\n')
var s = await $`brook mdpage`.text()
s = s.split("\n").filter(v => !v.startsWith("[")).join("\n").replace("```\n```", "```\nbrook --help\n```").split("\n").map(v => v.startsWith("**") && !v.startsWith("**Usage") ? "- " + v : v).join('\n')
s = s.replace("### help, h", "").replace("Shows a list of commands or help for one command", "").replaceAll("- **--help, -h**: show help", "")
await fs.write(f.fd, s)
var s = await fs.readFile('example.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
var s = await fs.readFile('resources.md', { encoding: 'utf8' })
await fs.write(f.fd, s)
await fs.close(f.fd)
await $`markdown ../readme.md ./index.html`
22 changes: 0 additions & 22 deletions docs/build.sh

This file was deleted.

16 changes: 12 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ brook server -l :9999 -p hello

## Client

| iOS | Android | Mac |Windows |Linux |OpenWrt |
| --- | --- | --- | --- | --- | --- |
| [![](https://brook.app/images/appstore.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![](https://brook.app/images/android.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.apk) | [![](https://brook.app/images/mac.png)](https://apps.apple.com/us/app/brook-network-tool/id1216002642) | [![Windows](https://brook.app/images/windows.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.msix) | [![](https://brook.app/images/linux.png)](https://github.com/txthinking/brook/releases/latest/download/Brook.bin) | [![OpenWrt](https://brook.app/images/openwrt.png)](https://github.com/txthinking/brook/releases) |
| / | / | [App Mode](https://www.txthinking.com/talks/articles/macos-app-mode-en.article) | [How](https://www.txthinking.com/talks/articles/msix-brook-en.article) | [How](https://www.txthinking.com/talks/articles/linux-app-brook-en.article) | [How](https://www.txthinking.com/talks/articles/brook-openwrt-en.article) |
- [iOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Android](https://github.com/txthinking/brook/releases/latest/download/Brook.apk)
- [macOS](https://apps.apple.com/us/app/brook-network-tool/id1216002642)
- [Windows](https://github.com/txthinking/brook/releases/latest/download/Brook.msix)
- [Linux](https://github.com/txthinking/brook/releases/latest/download/Brook.bin)
- [OpenWrt](https://github.com/txthinking/brook/releases)

> You may want to use `brook link` to customize some parameters
- [About App Mode on macOS](https://www.txthinking.com/talks/articles/macos-app-mode-en.article)
- [How to install Brook on Windows?](https://www.txthinking.com/talks/articles/msix-brook-en.article)
- [How to install Brook on Linux](https://www.txthinking.com/talks/articles/linux-app-brook-en.article)
- [How to install Brook on OpenWrt](https://www.txthinking.com/talks/articles/brook-openwrt-en.article)

64 changes: 19 additions & 45 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1216,12 +1216,9 @@
<li><a href="#echoclient">echoclient</a></li>
<li><a href="#ipcountry">ipcountry</a></li>
<li><a href="#completion">completion</a></li>
<li><a href="#mdpage">mdpage</a><ul>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#mdpage">mdpage</a></li>
<li><a href="#manpage">manpage</a></li>
<li><a href="#help-h-1">help, h</a></li>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#examples">Examples</a><ul>
Expand Down Expand Up @@ -1319,12 +1316,9 @@ <h1 id="brook">Brook</h1>
<li><a href="#echoclient">echoclient</a></li>
<li><a href="#ipcountry">ipcountry</a></li>
<li><a href="#completion">completion</a></li>
<li><a href="#mdpage">mdpage</a><ul>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#mdpage">mdpage</a></li>
<li><a href="#manpage">manpage</a></li>
<li><a href="#help-h-1">help, h</a></li>
<li><a href="#help-h">help, h</a></li>
</ul>
</li>
<li><a href="#examples">Examples</a><ul>
Expand Down Expand Up @@ -1368,37 +1362,23 @@ <h2 id="server">Server</h2>
<pre><code>brook server -l :9999 -p hello
</code></pre>
<h2 id="client">Client</h2>
<table>
<thead>
<tr>
<th>iOS</th>
<th>Android</th>
<th>Mac</th>
<th>Windows</th>
<th>Linux</th>
<th>OpenWrt</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642"><img src="https://brook.app/images/appstore.png" alt=""></a></td>
<td><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.apk"><img src="https://brook.app/images/android.png" alt=""></a></td>
<td><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642"><img src="https://brook.app/images/mac.png" alt=""></a></td>
<td><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.msix"><img src="https://brook.app/images/windows.png" alt="Windows"></a></td>
<td><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.bin"><img src="https://brook.app/images/linux.png" alt=""></a></td>
<td><a href="https://github.com/txthinking/brook/releases"><img src="https://brook.app/images/openwrt.png" alt="OpenWrt"></a></td>
</tr>
<tr>
<td>/</td>
<td>/</td>
<td><a href="https://www.txthinking.com/talks/articles/macos-app-mode-en.article">App Mode</a></td>
<td><a href="https://www.txthinking.com/talks/articles/msix-brook-en.article">How</a></td>
<td><a href="https://www.txthinking.com/talks/articles/linux-app-brook-en.article">How</a></td>
<td><a href="https://www.txthinking.com/talks/articles/brook-openwrt-en.article">How</a></td>
</tr>
</tbody></table>
<ul>
<li><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642">iOS</a></li>
<li><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.apk">Android</a></li>
<li><a href="https://apps.apple.com/us/app/brook-network-tool/id1216002642">macOS</a></li>
<li><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.msix">Windows</a></li>
<li><a href="https://github.com/txthinking/brook/releases/latest/download/Brook.bin">Linux</a></li>
<li><a href="https://github.com/txthinking/brook/releases">OpenWrt</a></li>
</ul>
<blockquote>
<p>You may want to use <code>brook link</code> to customize some parameters</p>
</blockquote>
<ul>
<li><a href="https://www.txthinking.com/talks/articles/macos-app-mode-en.article">About App Mode on macOS</a></li>
<li><a href="https://www.txthinking.com/talks/articles/msix-brook-en.article">How to install Brook on Windows?</a></li>
<li><a href="https://www.txthinking.com/talks/articles/linux-app-brook-en.article">How to install Brook on Linux</a></li>
<li><a href="https://www.txthinking.com/talks/articles/brook-openwrt-en.article">How to install Brook on OpenWrt</a></li>
</ul>
<h1 id="client-1">Client</h1>
<p>Brook GUI will pass different <em>global variables</em> to the script at different times, and the script only needs to assign the processing result to the global variable <code>out</code></p>
<h2 id="cli">CLI</h2>
Expand Down Expand Up @@ -2119,8 +2099,6 @@ <h1 id="global-options">GLOBAL OPTIONS</h1>
</li>
<li><p><strong>--dialWithSocks5Username</strong>=&quot;&quot;: If there is</p>
</li>
<li><p><strong>--help, -h</strong>: show help</p>
</li>
<li><p><strong>--ipLimitInterval</strong>=&quot;&quot;: Interval (s) for ipLimitMax (default: 0)</p>
</li>
<li><p><strong>--ipLimitMax</strong>=&quot;&quot;: Limit the number of client IP addresses, be careful when using this parameter, as the client may have dynamic IP. Works with server/wsserver/wssserver/quicserver (default: 0)</p>
Expand Down Expand Up @@ -2696,11 +2674,7 @@ <h2 id="mdpage">mdpage</h2>
</li>
<li><p><strong>--file, -f</strong>=&quot;&quot;: Write to file, default print to stdout</p>
</li>
<li><p><strong>--help, -h</strong>: show help</p>
</li>
</ul>
<h3 id="help-h">help, h</h3>
<p>Shows a list of commands or help for one command</p>
<h2 id="manpage">manpage</h2>
<p>Generate man.1 page</p>
<ul>
Expand All @@ -2709,7 +2683,7 @@ <h2 id="manpage">manpage</h2>
<li><p><strong>--file, -f</strong>=&quot;&quot;: Write to file, default print to stdout. You should put to /path/to/man/man1/brook.1 on linux or /usr/local/share/man/man1/brook.1 on macos</p>
</li>
</ul>
<h2 id="help-h-1">help, h</h2>
<h2 id="help-h">help, h</h2>
<p>Shows a list of commands or help for one command</p>
<h1 id="examples">Examples</h1>
<p>List some examples of common scene commands, pay attention to replace the parameters such as IP, port, password, domain name, certificate path, etc. in the example by yourself</p>
Expand Down

0 comments on commit dce11e6

Please sign in to comment.