File tree Expand file tree Collapse file tree 5 files changed +22
-10
lines changed
Expand file tree Collapse file tree 5 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " bk"
3- version = " 0.1.1 "
3+ version = " 0.2.0 "
44authors = [" James Campos <james.r.campos@gmail.com>" ]
55edition = " 2018"
66license = " MIT"
Original file line number Diff line number Diff 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
2532Running ` bk ` without a path will load the most recent Epub.
2633
2734Type 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
Original file line number Diff line number Diff 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 \x5b 1m " ) ;
50+ buf. push_str ( "\n \x1b [1m " ) ;
5151 for c in n. children ( ) {
5252 Self :: render ( buf, c) ;
5353 }
54- buf. push_str ( "\x1b \x5b 0m \n " ) ;
54+ buf. push_str ( "\x1b [0m \n " ) ;
5555 }
5656 "blockquote" | "p" | "tr" => {
5757 buf. push ( '\n' ) ;
Original file line number Diff line number Diff line change @@ -530,8 +530,7 @@ struct Props {
530530fn 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 ( (
You can’t perform that action at this time.
0 commit comments