Skip to content

Commit 8d8310f

Browse files
authored
Merge pull request #21 from togglebyte/dev
Dev
2 parents 80cdff2 + f5977ea commit 8d8310f

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/backend.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,17 @@ Hides the cursor.
2727

2828
Clears the screen. Useful when not enabling an alt screen (which will be cleared
2929
by default).
30+
31+
## `full_screen` function
32+
33+
As a convenience it's possible to call `TuiBackend::full_screen()`.
34+
This is the same as writing:
35+
```rust
36+
let mut backend = Self::builder()
37+
.enable_alt_screen()
38+
.enable_raw_mode()
39+
.hide_cursor()
40+
.finish()
41+
.unwrap();
42+
backend.finalize();
43+
```

src/recipes/routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Finally register both "home", "a" and "b" as templates.
5555

5656
```rust,ignore
5757
fn main() {
58-
let doc = Document::new("@index [title: 'hello']");
58+
let doc = Document::new("@index");
5959
let mut backend = TuiBackend::full_screen();
6060
let mut builder = Runtime::builder(doc, &backend);
6161

src/templates/functions.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ text greetings[to_int(true)]
7070

7171
Will output: "Hi".
7272

73+
## `to_float(arg)`
74+
75+
Try to convert any value to a floating point number.
76+
77+
Boolean `true` will convert to `1.0`, and `false` will convert to `0.0`.
78+
79+
### Example
80+
81+
```
82+
text to_float(123)
83+
```
84+
85+
Will output: "123".
86+
7387
## `round(number, decimal_count=0)`
7488

7589
Round a floating point value.

0 commit comments

Comments
 (0)