From 21df4e04612ba0019dafa2860f860f3cc6cc4f93 Mon Sep 17 00:00:00 2001 From: Uttarayan Mondal Date: Wed, 10 Mar 2021 00:00:44 +0530 Subject: [PATCH] Added documentation action --- .github/workflows/docs.yaml | 37 +++++++++++++++++++++++ .github/workflows/{rust.yml => rust.yaml} | 0 README.md | 4 +-- src/lib.rs | 1 + 4 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docs.yaml rename .github/workflows/{rust.yml => rust.yaml} (100%) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..4ce79ed --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,37 @@ +name: Documentation + +on: + push: + branches: [ master ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install latest toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain:stable + default: true + override: true + - name: Build Docs + run: cargo doc --color=always + - name: Copy docs + run: | + mv docs/index.html ./ + rm -rf docs + cp -r target/doc ./docs + mv index.html docs/ + - name: Push changes + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email 'github-actions[bot]@users.noreply.github.com' + git add docs + git commit -am "Generated docs from github-actions[bot]" + git push diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yaml similarity index 100% rename from .github/workflows/rust.yml rename to .github/workflows/rust.yaml diff --git a/README.md b/README.md index cd69790..95f0313 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Documentation of [ntext-rs](https://uttarayan21.github.io/ntext-rs) generated by A rust library to get numbers (usize) as words -`12345 ` -> `twelvethousandthreehundredfortyfive` +`12345 ` -> `Twelve Thousand,Three Hundred,Forty-Five` Add to cargo.toml @@ -24,6 +24,6 @@ fn main() { ``` which should output -`twelvethousandthreehundredfortyfive` +`Twelve Thousand,Three Hundred,Forty-Five` Check the [documentation](https://uttarayan21.github.io/ntext-rs) which has more examples and is usually up to date. diff --git a/src/lib.rs b/src/lib.rs index 6fa8ea4..1bdf3dd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,5 @@ //! Example program with default formatting +//! Source [ntext-rs](https://github.com/uttarayan21/ntext-rs) //!```rust //!extern crate ntext; //!use ntext::to_text;