From b5eddf19859bbd860bdf83e7de2c38317951304c Mon Sep 17 00:00:00 2001 From: m0ham3dx <82266083+m0ham3dx@users.noreply.github.com> Date: Sun, 8 Jan 2023 07:59:16 +0530 Subject: [PATCH] mx - CI - mdbook addons - admonition(callouts) and mermaid (code driven diagrams) with example implementation (#2025) * P1 (#1) * CI trigger test with changes * CI trigger test with changes - type fix * Post Trigger Rendering Test * remove actions triggers on P1 branch used during testing * mx - P1 Prep PR - with configured md-admonition and md-mermaid (#2) * CI trigger test with changes * CI trigger test with changes - type fix * Post Trigger Rendering Test * remove actions triggers on P1 branch used during testing * Add example callouts (admonitions) and mermaid diagram in intro.md * Update book/getting-started/intro.md Co-authored-by: Georgios Konstantopoulos --- .github/workflows/book.yml | 8 +++++++- book/getting-started/intro.md | 32 +++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml index ad03416c..e1b2947d 100644 --- a/.github/workflows/book.yml +++ b/.github/workflows/book.yml @@ -5,6 +5,7 @@ on: paths: - 'book/**' - 'book.toml' + pull_request: branches: [master] paths: @@ -23,6 +24,8 @@ jobs: run: | mkdir mdbook curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook + curl -sSL https://github.com/tommilligan/mdbook-admonish/releases/download/v1.8.0/mdbook-admonish-v1.8.0-x86_64-unknown-linux-gnu.tar.gz| tar -xz --directory=./mdbook + curl -sSL https://github.com/badboy/mdbook-mermaid/releases/download/v0.12.6/mdbook-mermaid-v0.12.6-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook echo `pwd`/mdbook >> $GITHUB_PATH - name: Install mdbook-template @@ -32,7 +35,10 @@ jobs: echo `pwd`/mdbook-template >> $GITHUB_PATH - name: Build - run: mdbook build + run: | + mdbook-admonish install + mdbook-mermaid install + mdbook build - name: Save pages artifact uses: actions/upload-pages-artifact@v1 diff --git a/book/getting-started/intro.md b/book/getting-started/intro.md index 1345ffb8..245df94a 100644 --- a/book/getting-started/intro.md +++ b/book/getting-started/intro.md @@ -3,6 +3,36 @@ Welcome to the hands-on guide for the ethers-rs library! This documentation contains a collection of examples demonstrating how to use the library to build Ethereum-based applications in Rust. The examples cover a range of topics, from basic smart contract interactions to more advanced usage of ethers-rs. +```admonish info +You can find the official ethers-rs documentation on docs.rs - [here](https://docs.rs/ethers/0.5.0/ethers/). +``` + Each example includes a detailed description of the functionality being demonstrated, as well as complete code snippets that you can use as a starting point for your own projects. -We hope that these docs will help you get started with ethers-rs and give you a better understanding of how to use the library to build your own web3 applications in Rust. If you have any questions or need further assistance, please don't hesitate to reach out to the ethers-rs community. \ No newline at end of file +We hope that these docs will help you get started with ethers-rs and give you a better understanding of how to use the library to build your own web3 applications in Rust. If you have any questions or need further assistance, please don't hesitate to reach out to the ethers-rs community. + +The following is a brief overview diagram of the topis covered in this guide. + +```mermaid +graph LR + %% The code below is for styling the graph + %%------------------------------------------------- + %%{init: {'theme':'dark', 'themeVariables':{'textColor':' #ffffff ', 'nodeBorder':'#ff2d00', 'edgeLabelBackground':'#000000' ,'lineColor':'#87ff00', 'fontSize':'14px', 'curve':'linear'}}}%% + + %%------------------------------------------------- + %% Actual Diagram code is below + + A[Ethers-rs
Manual] --> A1[Providers] + A --> A2[Middleware] + A --> A3[Contracts] + A --> A4[Events] + A --> A5[Subscriptions] + A --> A6[Queries] + A --> A7[Transactions] + A --> A8[Wallets] + A --> A9[Big numbers] + A --> A10[Anvil] +``` +```admonish bug +This diagram is incomplete and will undergo continuous changes. +```