Skip to content

Commit

Permalink
Update README. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
xoac committed Jul 21, 2020
1 parent 1c28d8d commit 66e9bdc
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
38 changes: 22 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# cargo-io-lib-template

This is tweaked `cargo init --lib` for FOSS.
This is tweaked `cargo init --lib` for FOSS. It contains recommendations from [cargo book].

## What this template provide?:
- Follow [Rust API Guidelines]
* license MIT OR APACHE v2.0
- Contains default `README.tpl` that help you generate README.md with [cargo-readme]
- Contains `CHANGELOG.md` that follow [keepchangelog]
- Quick start [CI workflow](https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md) on stable rust:
* `cargo check`
* `cargo test`
* `cargo fmt`
* `cargo clippy -- -D warnings`

## pre-requires:
Installed:

- [cargo-generate] `cargo install --git https://github.com/ashleygwilliams/cargo-generate` [(see issue #1)](https://github.com/xoac/crates-io-lib-template/issues/1)
- [cargo-readme] `cargo install cargo-readme`

## How to use:
You need to do this 4 simple steps:
You need to do four simple steps:
### 1. Use `cargo generate` to clone this template
```
cargo generate --git https://github.com/xoac/crates-io-lib-template.git --name my-project
Expand All @@ -22,33 +39,22 @@ sed -i 's/GITHUB_ORG_PATH/https:\/\/github\.com\/xoac\//g' README.tpl CHANGELOG.
This is limitation because of this [issue](https://github.com/ashleygwilliams/cargo-generate/issues/17).

### 3. Update Cargo.toml
Edit `Cargo.toml` there are some basic information you should provide.
Edit `Cargo.toml` there are some basic information you should provide (look for `TODO`).

[Learn more about Cargo.toml here.](https://doc.rust-lang.org/cargo/reference/manifest.html)

This is limitation because of this [issue](https://github.com/ashleygwilliams/cargo-generate/issues/17).


### 4. Replace this README.md
Create description of you library at top of `src.lib.rs` and generate `README.md` with:
Add documentation at top of `src/lib.rs` and generate `README.md` from that with:
```
cargo readme > README.md
```
[Lern more about `cargo readme` here.][cargo-readme]


## What this template provide:
- Follow [Rust API Guidelines]
* license MIT OR APACHE v2.0
- Contains default `README.tpl` that help you generate README.md with [cargo-readme]
- Contains `CHANGELOG.md` that follow [keepchangelog]
- Quick start [workflow](https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md) on stable rust:
* `cargo check`
* `cargo test`
* `cargo fmt`
* `cargo clippy -- -D warnings`

[Rust API Guidelines]:https://rust-lang.github.io/api-guidelines/about.html
[cargo-readme]:https://github.com/livioribeiro/cargo-readme
[cargo-generate]:https://github.com/ashleygwilliams/cargo-generate
[keepchangelog]:https://keepachangelog.com
[cargo-book]:https://doc.rust-lang.org/cargo
2 changes: 1 addition & 1 deletion README.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![crates.io](https://img.shields.io/crates/v/{{project-name}}.svg)](https://crates.io/crates/{{project-name}})
[![Documentation](https://docs.rs/{{project-name}}/badge.svg)](https://docs.rs/{{project-name}}/)
![CI master](GITHUB_ORG_PATH{{project-name}}/workflows/Continuous%20integration/badge.svg?branch=master)
[![CI master](GITHUB_ORG_PATH{{project-name}}/workflows/Continuous%20integration/badge.svg?branch=master)](GITHUB_ORG_PATH{{project-name}}/actions?query=workflow%3A%22Continuous+integration%22)
{% raw %}{{badges}}

# {{crate}}
Expand Down

0 comments on commit 66e9bdc

Please sign in to comment.