Skip to content

Commit 07aff03

Browse files
committed
0.2
1 parent 82b332a commit 07aff03

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bk"
3-
version = "0.1.1"
3+
version = "0.2.0"
44
authors = ["James Campos <james.r.campos@gmail.com>"]
55
edition = "2018"
66
license = "MIT"

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,29 @@ or from github:
2020
cargo install --path bk
2121

2222
# Usage
23-
bk [<path>] [-w <width>]
23+
24+
Usage: bk [<path>] [-w <width>]
25+
26+
read a book
27+
28+
Options:
29+
-w, --width characters per line
30+
--help display usage information
2431

2532
Running `bk` without a path will load the most recent Epub.
2633

2734
Type any function key (eg <kbd>F1</kbd>) to see the keybinds.
2835

36+
# Configuration alternatives
37+
38+
- Theming: theme your terminal
39+
- Config file: create an alias with cli options
40+
2941
# TODO
3042
- more configuration
3143
- better html support
32-
- better unicode support
44+
- test unicode
45+
- github actions / ci
3346
- css?
3447
- mobi?
3548

src/epub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ impl Epub {
4747

4848
match n.tag_name().name() {
4949
"h1" | "h2" | "h3" | "h4" | "h5" | "h6" => {
50-
buf.push_str("\n\x1b\x5b1m");
50+
buf.push_str("\n\x1b[1m");
5151
for c in n.children() {
5252
Self::render(buf, c);
5353
}
54-
buf.push_str("\x1b\x5b0m\n");
54+
buf.push_str("\x1b[0m\n");
5555
}
5656
"blockquote" | "p" | "tr" => {
5757
buf.push('\n');

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,7 @@ struct Props {
530530
fn restore(save_path: &str) -> Option<(String, Props)> {
531531
let args: Args = argh::from_env();
532532
let width = args.width;
533-
let path = args.path
534-
.and_then(|s| Some(fs::canonicalize(s).unwrap().to_str().unwrap().to_string()));
533+
let path = args.path.map(|s| fs::canonicalize(s).unwrap().to_str().unwrap().to_string());
535534
let save = fs::read_to_string(save_path).and_then(|s| {
536535
let mut lines = s.lines();
537536
Ok((

0 commit comments

Comments
 (0)