diff --git a/README.md b/README.md
index a9a78c0..e3e1d98 100644
--- a/README.md
+++ b/README.md
@@ -34,6 +34,8 @@ __barkeep__ strives to be [non-intrusive](#non-intrusive-design).
+💡 _[Documentation](https://oir.github.io/barkeep/) is a superset of what's below and easier to navigate._
+
---
- Display a waiting animation with a message:
@@ -230,6 +232,36 @@ __barkeep__ strives to be [non-intrusive](#non-intrusive-design).
+- Use a function (e.g. lambda) to monitor progress, instead of a variable
+ (_credit: [jh0x](https://github.com/oir/barkeep/pull/97)_):
+
+ ```cpp
+ unsigned long total_area = 10000;
+ unsigned long width = 0, height = 0;
+ auto bar = bk::ProgressBar([&] { return width * height; }, {
+ .total = total_area,
+ .message = "Sweeping area",
+ .speed = 1.,
+ });
+ while (width < 100 and height < 100) {
+ std::this_thread::sleep_for(70ms);
+ if (width < 100) { width++; }
+ if (height < 100) { height++; }
+ }
+ ```
+
+ Observe how a lambda is passed as the first argument as opposed to a variable
+ like `&width`.
+
+
+
+
+
+
+
+ Such monitoring functions are concurrently invoked,
+ see [this section](#Caveat) for what that might imply.
+
- Combine diplays using `|` operator to monitor multiple variables:
```cpp
diff --git a/docs/README.md b/docs/README.md
index 4d0c385..2a47085 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -34,6 +34,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
+
+
+### Animations
+
+
+
- Display a waiting animation with a message:
```cpp
@@ -61,6 +67,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
+
+
+### Counters
+
+
+
- Display a counter to monitor a numeric variable while waiting:
```cpp
@@ -82,6 +94,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
+
+
+### Progress bars
+
+
+
- Display a progress bar to monitor a numeric variable and measure its completion by comparing against a total:
```cpp
@@ -128,6 +146,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
+
+
+### Deferred start
+
+
+
- Displaying can be deferred with `.show = false`, and explicitly invoked by calling
`show()`, instead of at construction time.
@@ -169,6 +193,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
}
```
+
+
+### Iterable bar
+
+
+
- Automatically iterate over a container with a progress bar display
(instead of monitoring an explicit progress variable):
@@ -223,7 +253,50 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
-
+
+
+
+### Functional progress
+
+
+
+- Use a function (e.g. lambda) to monitor progress, instead of a variable
+ (_credit: [jh0x](https://github.com/oir/barkeep/pull/97)_):
+
+ ```cpp
+ unsigned long total_area = 10000;
+ unsigned long width = 0, height = 0;
+ auto bar = bk::ProgressBar([&] { return width * height; }, {
+ .total = total_area,
+ .message = "Sweeping area",
+ .speed = 1.,
+ });
+ while (width < 100 and height < 100) {
+ std::this_thread::sleep_for(70ms);
+ if (width < 100) { width++; }
+ if (height < 100) { height++; }
+ }
+ ```
+
+ Observe how a lambda is passed as the first argument as opposed to a variable
+ like `&width`.
+
+
+
+
+
+
+
+ Such monitoring functions are concurrently invoked,
+ see [this section](#caveat) for what that might imply.
+
+
+
+
+### Multi display
+
+
+
- Combine diplays using `|` operator to monitor multiple variables:
```cpp
@@ -259,6 +332,13 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
Instead of using `|` operator, you can also call `Composite()` with the components explicitly, which also accepts an additional string argument as the delimiter between the components.
See the example below.
+
+
+
+### Multiline
+
+
+
- If your display is multiline (has `\n` appear in it), all lines are automatically rerendered during animations.
The example below combines three bars similarly to the example above, however uses `\n` as the delimiter:
```cpp
@@ -303,6 +383,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
+
+
+### Status messages
+
+
+
- Display status messages:
```cpp
@@ -326,6 +412,12 @@ __barkeep__ also has [python bindings](https://pypi.python.org/pypi/barkeep).
This is because a string is too big of an object to have unguarded concurrent access (see [this section](#caveat)).
+
+
+### No-tty mode
+
+
+
- Use "no tty" mode to, e.g., output to log files:
```cpp
diff --git a/docs/index.html b/docs/index.html
index cd0731f..3361db4 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -173,6 +173,10 @@
monospace;
font-style: italic;
}
+
+ .markdown-section ul {
+ margin-bottom: 0;
+ }