~matthiasbeyer/imag

8a9ee7a63f2b34f0d9d19c19598c75213114cf80 — Matthias Beyer 1 year, 28 days ago 9d543a5 + b7d77b3
Merge branch 'update-mdcat' into master

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
M .travis.yml => .travis.yml +2 -2
@@ 28,7 28,7 @@ matrix:
          script:
            - cd doc/user && mdbook build || exit 1
        - language: rust
          rust: 1.37.0
          rust: 1.40.0
          cache:
            directories:
              - /home/travis/.cargo


@@ 38,7 38,7 @@ matrix:
            - cargo build --all --all-features -j 1  || exit 1
            - cargo test  --all --all-features -j 1  || exit 1
        - language: rust
          rust: 1.38.0
          rust: 1.41.0
          cache:
            directories:
              - /home/travis/.cargo

M lib/entry/libimagentryview/Cargo.toml => lib/entry/libimagentryview/Cargo.toml +3 -3
@@ 30,16 30,16 @@ libimagstore     = { version = "0.10.0", path = "../../../lib/core/libimagstore"
libimagerror     = { version = "0.10.0", path = "../../../lib/core/libimagerror" }
libimagentryedit = { version = "0.10.0", path = "../../../lib/entry/libimagentryedit" }

mdcat   = { version = "0.13.0", optional = true }
mdcat   = { version = "0.15.0", optional = true }

[dependencies.pulldown-cmark]
version          = "^0.4"
version          = "^0.7"
optional         = true
default-features = false
features         = []

[dependencies.syntect]
version          = "3.2.0"
version          = "3"
optional         = true
default-features = false
features         = ["parsing", "assets", "dump-load"]

M lib/entry/libimagentryview/src/builtin/md.rs => lib/entry/libimagentryview/src/builtin/md.rs +4 -3
@@ 26,7 26,7 @@ use mdcat::{ResourceAccess, TerminalCapabilities, TerminalSize};
use pulldown_cmark::Parser;
use syntect::parsing::SyntaxSet;
use anyhow::Result;
use anyhow::Error;
use anyhow::format_err;

use crate::viewer::Viewer;



@@ 56,15 56,16 @@ impl<'a> Viewer for MarkdownViewer<'a> {
        let parser          = Parser::new(e.get_content());
        let base_dir        = self.rt.rtp();
        let syntax_set      = SyntaxSet::load_defaults_newlines();
        let capa            = TerminalCapabilities::ansi();

        ::mdcat::push_tty(sink,
                          TerminalCapabilities::ansi(),
                          &capa,
                          self.termsize,
                          parser,
                          base_dir,
                          self.resource_access,
                          syntax_set)
        .map_err(|e| Error::from(e.compat()))
        .map_err(|_| format_err!("Failed while formatting markdown"))
    }
}