From 3ef31f7e99b0b0787e3f8f9b7f24de850f9dd43b Mon Sep 17 00:00:00 2001 From: Damon Chen Date: Thu, 2 Jun 2022 12:52:01 +0800 Subject: [PATCH] Problem: Missing support of uploading cpp documents to gitbook platform (fix #396) Close: - #396 Solution: - Add cronos-play-docs as submodule - Update Makefile cpp-docs and cpp-cronos-play-docs --- .github/workflows/docs.yml | 2 ++ .gitmodules | 3 +++ Makefile | 18 ++++++++++++++++-- docs/cpp/cronos-play-docs | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) create mode 160000 docs/cpp/cronos-play-docs diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 7bf9b9fb..5f3e0227 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -38,3 +38,5 @@ jobs: run: make cpp-docs-gitbook - name: Generate mdbook run: make cpp-docs-mdbook + - name: Generate cronos-play-docs + run: make cpp-cronos-play-docs diff --git a/.gitmodules b/.gitmodules index f50bc977..b0b9409f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "third_party/luna_classic"] path = third_party/luna_classic url = https://github.com/terra-money/classic-core.git +[submodule "docs/cpp/cronos-play-docs"] + path = docs/cpp/cronos-play-docs + url = git@github.com:crypto-org-chain/cronos-play-docs.git diff --git a/Makefile b/Makefile index 22a63666..89267447 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ cpp: build_cpp # to fix link error on macos . ./checkmac.sh && . ./scripts/.env && cd $(cpp_example) && make run -cppx86_64: +cppx86_64: . ./checkmac.sh && rustup target add x86_64-apple-darwin . ./checkmac.sh && cargo build --package defi-wallet-core-cpp --release --target x86_64-apple-darwin . ./checkmac.sh && cd $(cpp_example) && make x86_64_build @@ -88,7 +88,7 @@ cpp-ci-tests: build_cpp cpp-tests: python-tests # Choose the defualt cpp docs engine -cpp-docs: cpp-docs-gitbook +cpp-docs: cpp-cronos-play-docs cpp-docs-doxygen: build_cpp @nix-shell ./docs/cpp/shell.nix --run "cd $(cpp_docs) && doxygen" @@ -102,6 +102,20 @@ ifeq ($(UNAME), Darwin) open $(cpp_docs)/sphinx/_build/html/index.html endif +cpp-cronos-play-docs: build_cpp + @nix-shell ./docs/cpp/shell.nix --run "\ + cd $(cpp_docs) && doxygen && doxybook2 \ + --input doxygen/xml \ + --output cronos-play-docs \ + --config config.json \ + --summary-input SUMMARY.md.tmpl \ + --summary-output cronos-play-docs/SUMMARY.md \ + && cd cronos-play-docs && gitbook build" +ifeq ($(UNAME), Darwin) + @nix-shell ./docs/cpp/shell.nix --run "\ + cd $(cpp_docs)/cronos-play-docs/src && gitbook serve --open" +endif + cpp-docs-gitbook: build_cpp @nix-shell ./docs/cpp/shell.nix --run "\ cd $(cpp_docs) && doxygen && doxybook2 \ diff --git a/docs/cpp/cronos-play-docs b/docs/cpp/cronos-play-docs new file mode 160000 index 00000000..a53e5005 --- /dev/null +++ b/docs/cpp/cronos-play-docs @@ -0,0 +1 @@ +Subproject commit a53e500579dc0ebde4b728233e58bf2d5077f555