-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: added install, usage and intro
- Loading branch information
Showing
4 changed files
with
167 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,92 @@ | ||
# Markdown Extension Examples | ||
# Install | ||
|
||
This page demonstrates some of the built-in markdown extensions provided by VitePress. | ||
## Bun & Node.js | ||
|
||
## Syntax Highlighting | ||
```bash | ||
bun install -d localtunnels | ||
npm install -g localtunnels | ||
|
||
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting: | ||
# or, invoke immediately | ||
bunx localtunnels | ||
npx localtunnels | ||
``` | ||
|
||
**Input** | ||
_We are looking to publish this package npm under the name `localtunnels`. We are also hoping npm will release the name for us._ | ||
|
||
````md | ||
```js{4} | ||
export default { | ||
data () { | ||
return { | ||
msg: 'Highlighted!' | ||
} | ||
} | ||
} | ||
``` | ||
```` | ||
|
||
**Output** | ||
|
||
```js{4} | ||
export default { | ||
data () { | ||
return { | ||
msg: 'Highlighted!' | ||
} | ||
} | ||
} | ||
## Binaries | ||
|
||
For now, you can download the `localtunnels` binaries from the [releases page](https://github.com/stacksjs/localtunnels/releases/tag/v0.1.1). Choose the binary that matches your platform and architecture: | ||
|
||
## macOS (Darwin) | ||
|
||
For M1/M2 Macs (arm64): | ||
|
||
```bash | ||
# Download the binary | ||
curl -L https://github.com/stacksjs/localtunnels/releases/download/v0.10.0/lpx-darwin-arm64 -o localtunnels | ||
|
||
# Make it executable | ||
chmod +x localtunnels | ||
|
||
# Move it to your PATH | ||
mv localtunnels /usr/local/bin/localtunnels | ||
``` | ||
|
||
## Custom Containers | ||
For Intel Macs (amd64): | ||
|
||
```bash | ||
# Download the binary | ||
curl -L https://github.com/stacksjs/localtunnels/releases/download/v0.10.0/lpx-darwin-x64 -o localtunnels | ||
|
||
**Input** | ||
# Make it executable | ||
chmod +x localtunnels | ||
|
||
# Move it to your PATH | ||
mv localtunnels /usr/local/bin/localtunnels | ||
``` | ||
|
||
```md | ||
::: info | ||
This is an info box. | ||
::: | ||
## Linux | ||
|
||
::: tip | ||
This is a tip. | ||
::: | ||
For ARM64: | ||
|
||
::: warning | ||
This is a warning. | ||
::: | ||
```bash | ||
# Download the binary | ||
curl -L https://github.com/stacksjs/localtunnels/releases/download/v0.10.0/lpx-linux-arm64 -o localtunnels | ||
|
||
::: danger | ||
This is a dangerous warning. | ||
::: | ||
# Make it executable | ||
chmod +x localtunnels | ||
|
||
::: details | ||
This is a details block. | ||
::: | ||
# Move it to your PATH | ||
mv localtunnels /usr/local/bin/localtunnels | ||
``` | ||
|
||
**Output** | ||
For x64: | ||
|
||
::: info | ||
This is an info box. | ||
::: | ||
```bash | ||
# Download the binary | ||
curl -L https://github.com/stacksjs/localtunnels/releases/download/v0.10.0/lpx-linux-x64 -o localtunnels | ||
|
||
::: tip | ||
This is a tip. | ||
::: | ||
# Make it executable | ||
chmod +x localtunnels | ||
|
||
::: warning | ||
This is a warning. | ||
::: | ||
# Move it to your PATH | ||
mv localtunnels /usr/local/bin/localtunnels | ||
``` | ||
|
||
## Windows | ||
|
||
::: danger | ||
This is a dangerous warning. | ||
::: | ||
For x64: | ||
|
||
::: details | ||
This is a details block. | ||
::: | ||
```bash | ||
# Download the binary | ||
curl -L https://github.com/stacksjs/localtunnels/releases/download/v0.10.0/lpx-windows-x64.exe -o localtunnels.exe | ||
|
||
## More | ||
# Move it to your PATH (adjust the path as needed) | ||
move localtunnels.exe C:\Windows\System32\localtunnels.exe | ||
``` | ||
|
||
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown). | ||
<!-- _Alternatively, you can install:_ | ||
```bash | ||
brew install localtunnels # wip | ||
pkgx install localtunnels # wip | ||
``` --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,60 @@ | ||
--- | ||
outline: deep | ||
--- | ||
|
||
<p align="center"><img src="https://github.com/stacksjs/localtunnels/blob/main/.github/art/cover.jpg?raw=true" alt="Social Card of this repo"></p> | ||
|
||
# Runtime API Examples | ||
# A Better Developer Experience | ||
|
||
> A zero-config local tunnel that's simple, lightweight, and secure. | ||
## Features | ||
|
||
- Simple, lightweight local tunnel | ||
- Security built-in, including HTTPS | ||
- IAC, self-hostable _(via AWS)_ | ||
- Custom subdomains | ||
- CLI & Library | ||
|
||
## Changelog | ||
|
||
Please see our [releases](https://github.com/stacksjs/localtunnels/releases) page for more information on what has changed recently. | ||
|
||
## Contributing | ||
|
||
This page demonstrates usage of some of the runtime APIs provided by VitePress. | ||
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details. | ||
|
||
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files: | ||
## Community | ||
|
||
```md | ||
<script setup> | ||
import { useData } from 'vitepress' | ||
For help, discussion about best practices, or any other conversation that would benefit from being searchable: | ||
|
||
const { theme, page, frontmatter } = useData() | ||
</script> | ||
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions) | ||
|
||
## Results | ||
For casual chit-chat with others using this package: | ||
|
||
### Theme Data | ||
<pre>{{ theme }}</pre> | ||
[Join the Stacks Discord Server](https://discord.gg/stacksjs) | ||
|
||
### Page Data | ||
<pre>{{ page }}</pre> | ||
## Postcardware | ||
|
||
### Page Frontmatter | ||
<pre>{{ frontmatter }}</pre> | ||
``` | ||
Two things are true: Stacks OSS will always stay open-source, and we do love to receive postcards from wherever Stacks is used! 🌍 _We also publish them on our website. And thank you, Spatie_ | ||
|
||
<script setup> | ||
import { useData } from 'vitepress' | ||
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094 | ||
|
||
const { site, theme, page, frontmatter } = useData() | ||
</script> | ||
## Sponsors | ||
|
||
## Results | ||
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us. | ||
|
||
### Theme Data | ||
- [JetBrains](https://www.jetbrains.com/) | ||
- [The Solana Foundation](https://solana.com/) | ||
|
||
<pre>{{ theme }}</pre> | ||
## Credits | ||
|
||
### Page Data | ||
- [Chris Breuer](https://github.com/chrisbbreuer) | ||
- [All Contributors](../../contributors) | ||
|
||
<pre>{{ page }}</pre> | ||
## License | ||
|
||
### Page Frontmatter | ||
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information. | ||
|
||
<pre>{{ frontmatter }}</pre> | ||
Made with 💙 | ||
|
||
## More | ||
<!-- Badges --> | ||
|
||
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). | ||
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/localtunnels/main?style=flat-square | ||
[codecov-href]: https://codecov.io/gh/stacksjs/localtunnels --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Usage | ||
|
||
There are two ways of using this local tunnel: _as a library or as a CLI._ | ||
|
||
## Library | ||
|
||
Given the npm package is installed: | ||
|
||
```ts | ||
import type { LocalTunnelConfig } from 'localtunnels' | ||
import { startLocalTunnel } from 'localtunnels' | ||
|
||
const config: LocalTunnelConfig = { | ||
from: 'localhost:5173', | ||
domain: 'stacksjs.dev', // optional, defaults to the stacksjs.dev domain | ||
subdomain: 'test', // optional, uses a random subdomain by default | ||
verbose: true, // optional, defaults to false | ||
} | ||
|
||
startLocalTunnel(config) | ||
``` | ||
|
||
You may als use a configuration file: | ||
|
||
```ts | ||
// tunnel.config.{ts,js} | ||
import type { LocalTunnelConfig } from '@stacksjs/localtunnels' | ||
|
||
const config: LocalTunnelConfig = { | ||
from: 'localhost:5173', | ||
domain: 'stacksjs.dev', // optional, defaults to the stacksjs.dev domain | ||
subdomain: 'test', // optional, uses a random subdomain by default | ||
verbose: true, // optional, defaults to false | ||
} | ||
|
||
export default config | ||
``` | ||
|
||
_Then run:_ | ||
|
||
```bash | ||
./localtunnels start | ||
``` | ||
|
||
## CLI | ||
|
||
```bash | ||
localtunnels start --from localhost:5173 --subdomain test --verbose | ||
localtunnels --help | ||
localtunnels --version | ||
``` | ||
|
||
To learn more, head over to the [documentation](https://localtunnels.sh/). |