Skip to content

Commit

Permalink
chore: adds makefile to auto-build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
kbknapp committed Jul 2, 2015
1 parent a1dc031 commit 338e2a4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)

test:
cargo test

build:
cargo build

doc:
cd "$(THIS_DIR)"
cp src/lib.rs code.bak
cat README.md | sed -e 's/^/\/\/! /g' > readme.bak
sed -i '/\/\/ DOCS/r readme.bak' src/lib.rs
sed -i '/```rust/```ignore/r readme.bak' src/lib.rs
sed -i '/```toml/```ignore/r readme.bak' src/lib.rs
sed -i '/```sh/```ignore/r readme.bak' src/lib.rs
rm -rf docs/*
(cargo doc --no-deps && make clean) || (make clean && false)

clean:
cp -r target/doc/* docs/
cd "$(THIS_DIR)"
mv code.bak src/lib.rs || true
rm *.bak || true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ There are two ways to use `clog`, via the command line or a library in your appl

#### Command Line

```
```sh
USAGE:
clog [FLAGS] [OPTIONS]

Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// #![cfg_attr(feature = "unstable", feature(plugin))]
// #![cfg_attr(feature = "unstable", plugin(regex_macros))]

// DOCS

extern crate regex;
extern crate semver;
extern crate toml;
Expand Down

0 comments on commit 338e2a4

Please sign in to comment.