From 2613b70bec7284aadf04290192a96faa902ee33e Mon Sep 17 00:00:00 2001 From: bashbunni Date: Fri, 8 Apr 2022 14:10:02 -0700 Subject: [PATCH] docs: add context to example --- examples/{download-progress => progress-download}/README.md | 3 +++ examples/{download-progress => progress-download}/main.go | 0 examples/{download-progress => progress-download}/tui.go | 0 3 files changed, 3 insertions(+) rename examples/{download-progress => progress-download}/README.md (58%) rename examples/{download-progress => progress-download}/main.go (100%) rename examples/{download-progress => progress-download}/tui.go (100%) diff --git a/examples/download-progress/README.md b/examples/progress-download/README.md similarity index 58% rename from examples/download-progress/README.md rename to examples/progress-download/README.md index 730860ff35..7d95c548f8 100644 --- a/examples/download-progress/README.md +++ b/examples/progress-download/README.md @@ -1,5 +1,8 @@ # Download Progress This example was built based on [this](https://github.com/charmbracelet/bubbles/discussions/127) discussion. +This example demonstrates how to download a file from a given URL, and show its progress with a [progress Bubble](https://github.com/charmbracelet/bubbles/). +The status of the download is updated with [`io.TeeReader`](https://pkg.go.dev/io#TeeReader). +This calls `Write` which is where we send the updated status with `Program#Send()` ## How to Run `go build .` in this directory on your machine (in examples/download-progress) diff --git a/examples/download-progress/main.go b/examples/progress-download/main.go similarity index 100% rename from examples/download-progress/main.go rename to examples/progress-download/main.go diff --git a/examples/download-progress/tui.go b/examples/progress-download/tui.go similarity index 100% rename from examples/download-progress/tui.go rename to examples/progress-download/tui.go