diff --git a/README.md b/README.md index 1990da0f..c24d9f9b 100644 --- a/README.md +++ b/README.md @@ -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` @@ -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) @@ -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 @@ -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 diff --git a/docs/build.js b/docs/build.js new file mode 100755 index 00000000..50c17fe9 --- /dev/null +++ b/docs/build.js @@ -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, '\n') +await fs.write(f.fd, '\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` diff --git a/docs/build.sh b/docs/build.sh deleted file mode 100755 index 4e807531..00000000 --- a/docs/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -echo '# Brook' > ../readme.md -echo '' >> ../readme.md -echo '' >> ../readme.md -echo 'A cross-platform programmable network tool.' >> ../readme.md -echo '' >> ../readme.md -echo '# Sponsor' >> ../readme.md -echo '**❤️ [Shiliew - A network app designed for those who value their time](https://www.txthinking.com/shiliew.html)**' >> ../readme.md - -cat getting-started.md >> ../readme.md -cat gui.md >> ../readme.md - -echo '# CLI Documentation' >> ../readme.md -echo 'Each subcommand has a `--example` parameter that can print the minimal example of usage' >> ../readme.md -jb '$1`brook mdpage`.split("\n").filter(v=>!v.startsWith("[")).join("\n").replace("```\n```", "```\nbrook --help\n```").split("\n").forEach(v=> echo(v.startsWith("**") && !v.startsWith("**Usage") ? "- "+v : v))' >> ../readme.md - -cat example.md >> ../readme.md -cat resources.md >> ../readme.md - -markdown ../readme.md ./index.html - diff --git a/docs/getting-started.md b/docs/getting-started.md index 2ccb15bb..7b929673 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -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) + diff --git a/docs/index.html b/docs/index.html index dcb70cb0..6600dbce 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1216,12 +1216,9 @@
  • echoclient
  • ipcountry
  • completion
  • -
  • mdpage -
  • +
  • mdpage
  • manpage
  • -
  • help, h
  • +
  • help, h
  • Examples
  • Examples -

    help, h

    -

    Shows a list of commands or help for one command

    manpage

    Generate man.1 page

    -

    help, h

    +

    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