commit
c36f3987d1
4 changed files with 27 additions and 22 deletions
25
.circleci/config.yml
Normal file
25
.circleci/config.yml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
version: 2.0
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
docker:
|
||||||
|
- image: jimmycuadra/rust
|
||||||
|
working_directory: ~/md-pdf
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- cargo-{{ checksum "Cargo.lock" }}
|
||||||
|
- run: which rustfmt || cargo install rustfmt
|
||||||
|
- run: apt update && apt install -y wget
|
||||||
|
- run: ./scripts/install-deps.sh
|
||||||
|
- run: cargo fmt -- --write-mode=diff
|
||||||
|
- run: cargo build
|
||||||
|
- run: cargo build --release
|
||||||
|
- save_cache:
|
||||||
|
key: cargo-{{ checksum "Cargo.lock" }}
|
||||||
|
paths:
|
||||||
|
- ~/.cargo
|
||||||
|
- target/
|
||||||
|
- run: cargo test
|
||||||
|
- run: cargo test --release
|
18
.travis.yml
18
.travis.yml
|
@ -1,18 +0,0 @@
|
||||||
language: rust
|
|
||||||
rust:
|
|
||||||
- stable
|
|
||||||
cache: cargo
|
|
||||||
|
|
||||||
before_script:
|
|
||||||
- export PATH="$PATH:$HOME/.cargo/bin"
|
|
||||||
- which rustfmt || cargo install rustfmt
|
|
||||||
|
|
||||||
script:
|
|
||||||
- ./scripts/install-deps.sh
|
|
||||||
- cargo fmt -- --write-mode=diff
|
|
||||||
- cargo build
|
|
||||||
- cargo build --release
|
|
||||||
- cargo test
|
|
||||||
- cargo test --release
|
|
||||||
- cd test-files && cargo run --release -- build && cd -
|
|
||||||
- cd test-files && cargo run -- build && cd -
|
|
|
@ -1,5 +1,5 @@
|
||||||
# md-pdf
|
# md-pdf
|
||||||
|
|
||||||
[![Travis](https://img.shields.io/travis/hoily/md-pdf.svg?style=flat-square)](https://travis-ci.org/hoily/md-pdf)
|
[![CircleCI](https://img.shields.io/circleci/project/github/hoily/md-pdf.svg?style=flat-square)](https://circleci.com/gh/hoily/md-pdf)
|
||||||
|
|
||||||
Convert markdown files into PDF Documents.
|
Convert markdown files into PDF Documents.
|
||||||
|
|
|
@ -7,9 +7,7 @@ fn stub(config: Config, input: String) -> Result<String, String> {
|
||||||
|
|
||||||
pub fn render(config: Config, input: String) -> Result<String, String> {
|
pub fn render(config: Config, input: String) -> Result<String, String> {
|
||||||
let mut rendered_input = input;
|
let mut rendered_input = input;
|
||||||
for renderer in vec![
|
for renderer in vec![stub] {
|
||||||
stub
|
|
||||||
] {
|
|
||||||
rendered_input = try!(renderer(config.clone(), rendered_input));
|
rendered_input = try!(renderer(config.clone(), rendered_input));
|
||||||
}
|
}
|
||||||
return Ok(rendered_input);
|
return Ok(rendered_input);
|
||||||
|
|
Reference in a new issue