aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock6
-rw-r--r--Cargo.toml2
-rw-r--r--README.md17
-rw-r--r--src/epub.rs4
-rw-r--r--src/main.rs3
5 files changed, 22 insertions, 10 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ea6bd9e..09d3bee 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -49,7 +49,7 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "bk"
-version = "0.1.1"
+version = "0.2.0"
dependencies = [
"argh",
"crossterm",
@@ -314,9 +314,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "signal-hook"
-version = "0.1.15"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ff2db2112d6c761e12522c65f7768548bd6e8cd23d2a9dae162520626629bd6"
+checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed"
dependencies = [
"libc",
"mio",
diff --git a/Cargo.toml b/Cargo.toml
index de90ce7..c7c45f0 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "bk"
-version = "0.1.1"
+version = "0.2.0"
authors = ["James Campos <james.r.campos@gmail.com>"]
edition = "2018"
license = "MIT"
diff --git a/README.md b/README.md
index ddae722..328b43e 100644
--- a/README.md
+++ b/README.md
@@ -20,16 +20,29 @@ or from github:
cargo install --path bk
# Usage
- bk [<path>] [-w <width>]
+
+ Usage: bk [<path>] [-w <width>]
+
+ read a book
+
+ Options:
+ -w, --width characters per line
+ --help display usage information
Running `bk` without a path will load the most recent Epub.
Type any function key (eg <kbd>F1</kbd>) to see the keybinds.
+# Configuration alternatives
+
+- Theming: theme your terminal
+- Config file: create an alias with cli options
+
# TODO
- more configuration
- better html support
-- better unicode support
+- test unicode
+- github actions / ci
- css?
- mobi?
diff --git a/src/epub.rs b/src/epub.rs
index f850add..d74bd2a 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -47,11 +47,11 @@ impl Epub {
match n.tag_name().name() {
"h1" | "h2" | "h3" | "h4" | "h5" | "h6" => {
- buf.push_str("\n\x1b\x5b1m");
+ buf.push_str("\n\x1b[1m");
for c in n.children() {
Self::render(buf, c);
}
- buf.push_str("\x1b\x5b0m\n");
+ buf.push_str("\x1b[0m\n");
}
"blockquote" | "p" | "tr" => {
buf.push('\n');
diff --git a/src/main.rs b/src/main.rs
index 8914f4f..dffbfff 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -530,8 +530,7 @@ struct Props {
fn restore(save_path: &str) -> Option<(String, Props)> {
let args: Args = argh::from_env();
let width = args.width;
- let path = args.path
- .and_then(|s| Some(fs::canonicalize(s).unwrap().to_str().unwrap().to_string()));
+ let path = args.path.map(|s| fs::canonicalize(s).unwrap().to_str().unwrap().to_string());
let save = fs::read_to_string(save_path).and_then(|s| {
let mut lines = s.lines();
Ok((