Skip to content

Commit

Permalink
Merge pull request #35 from lunaryorn/refactor-terminal-support
Browse files Browse the repository at this point in the history
Refactor terminal support
  • Loading branch information
swsnr authored Aug 25, 2018
2 parents 9625087 + 6aaf0ed commit 9861348
Show file tree
Hide file tree
Showing 15 changed files with 927 additions and 587 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
### Added
- `mdcat` builds on Windows now (see [GH-34][]).

### Changed
- Refactor internal terminal representation, replacing the terminal enum with a
new `Terminal` trait and dynamic dispatch.
- Only include terminal backends supported on the platform.

[GH-34]: https://github.com/lunaryorn/mdcat/pull/34

## [0.8.0] – 2018-02-15
Expand Down
18 changes: 11 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,29 @@ version = "0.8.1-pre"
categories = ["command-line-utilities", "text-processing"]
license = "Apache-2.0"
authors = ["Sebastian Wiesner <sebastian@swsnr.de>"]
build = "build.rs"

[badges]
travis-ci = { repository = "lunaryorn/mdcat" }
maintenance = { status = "actively-developed" }

[features]
default = []

iterm2 = ["mime", "base64"]
terminology = ["immeta"]

[dependencies]
atty = "^0.2"
failure = "^0.1"
reqwest = "^0.8"
term_size = "^0.3"
url = "^1.6"

mime = {version = "^0.3", optional = true}
base64 = {version = "^0.9", optional = true}
immeta = {version = "^0.4", optional = true}

[dependencies.clap]
version = "^2.29"
default-features = false
Expand All @@ -37,13 +48,6 @@ version = "^2"
default-features = false
features = ["parsing", "assets", "dump-load"]

[target.'cfg(target_os = "macos")'.dependencies]
mime = "^0.3"
base64 = "^0.9"

[target.'cfg(all(unix, not(target_os = "macos")))'.dependencies]
immeta = "^0.4"

[package.metadata.release]
sign-commit = true
upload-doc = false
Expand Down
28 changes: 28 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Copyright 2018 Sebastian Wiesner <sebastian@swsnr.de>

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at

// http://www.apache.org/licenses/LICENSE-2.0

// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

fn enable_feature(feature: &str) {
println!("rustc-cfg={}", feature);
}

fn main() {
#[cfg(target_os = "macos")]
{
enable_feature("iterm2");
}
#[cfg(all(unix, not(target_os = "macos")))]
{
enable_feature("terminology");
}
}
Loading

0 comments on commit 9861348

Please sign in to comment.