From ab2fd8e82cd394a37a6e42aa929238c41b8f9ed4 Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Wed, 10 Jul 2024 13:09:27 +0800 Subject: [PATCH] Deploy user guide via mdbook (#10) * Add docs * Build mdbook in CI * Add getting_started.md * Test * . * Add User Guide badge * Nicer badge * Update README.md --- .github/workflows/{rustdoc.yml => docs.yml} | 15 ++++++++++----- README.md | 1 + docs/src/README.md | 3 +++ docs/src/SUMMARY.md | 7 +++++++ docs/src/getting_started.md | 9 +++++++++ 5 files changed, 30 insertions(+), 5 deletions(-) rename .github/workflows/{rustdoc.yml => docs.yml} (84%) create mode 100644 docs/src/README.md create mode 100644 docs/src/SUMMARY.md create mode 100644 docs/src/getting_started.md diff --git a/.github/workflows/rustdoc.yml b/.github/workflows/docs.yml similarity index 84% rename from .github/workflows/rustdoc.yml rename to .github/workflows/docs.yml index 6a1b5ec8..5c0a3b9f 100644 --- a/.github/workflows/rustdoc.yml +++ b/.github/workflows/docs.yml @@ -1,10 +1,10 @@ -name: Rustdoc +name: Docs on: workflow_dispatch: push: branches: - - main + - main permissions: contents: write @@ -19,7 +19,7 @@ env: RUSTUP_MAX_RETRIES: 10 jobs: - rustdoc: + docs: runs-on: ubuntu-22.04 steps: @@ -47,12 +47,17 @@ jobs: restore-keys: | ${{ runner.os }}-cargo- - # Build the rust crate docs - - name: Build Documentation + - name: Build Rustdoc run: cargo +nightly -Zgitoxide -Zgit doc --all --no-deps --lib env: RUSTDOCFLAGS: "-Z unstable-options --enable-index-page" + - name: Build User Guide + run: | + cargo install --vers "^0.4" mdbook + mdbook build docs && mdbook test docs + mv docs/book target/doc + - name: Deploy Docs uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/README.md b/README.md index f819972d..fe79735e 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Continuous integration](https://github.com/subcoin-project/subcoin/actions/workflows/ci.yml/badge.svg)](https://github.com/subcoin-project/subcoin/actions/workflows/ci.yml) [![Rustdoc](https://github.com/subcoin-project/subcoin/actions/workflows/rustdoc.yml/badge.svg)](https://github.com/subcoin-project/subcoin/actions/workflows/rustdoc.yml) +[![Static Badge](https://img.shields.io/badge/User%20Guide-blue?logo=mdBook&logoColor=%23292b2e&link=https%3A%2F%2Fsubcoin-project.github.io%2Fsubcoin%2Fbook)](https://subcoin-project.github.io/subcoin/book) > [!WARNING] > diff --git a/docs/src/README.md b/docs/src/README.md new file mode 100644 index 00000000..124a740d --- /dev/null +++ b/docs/src/README.md @@ -0,0 +1,3 @@ +# Subcoin + +Subcoin is Bitcoin full node implemented in the Substrate framework. diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md new file mode 100644 index 00000000..b3bb59ee --- /dev/null +++ b/docs/src/SUMMARY.md @@ -0,0 +1,7 @@ +# Summary + +[Introduction](README.md) + +# User Guide + +- [Getting Started](getting_started.md) diff --git a/docs/src/getting_started.md b/docs/src/getting_started.md new file mode 100644 index 00000000..c3f65efa --- /dev/null +++ b/docs/src/getting_started.md @@ -0,0 +1,9 @@ +# Getting Started + +## Installation + +### Build from source + +### Docker + +## Run