From 661bde4fc7dd636f9480f81748de58fa72e5ced3 Mon Sep 17 00:00:00 2001 From: leohhhn Date: Fri, 28 Feb 2025 18:29:24 +0100 Subject: [PATCH] update workflows, embed --- .github/workflows/docs-generate.yml | 31 +++++++++++++++++++ .github/workflows/docs-sidebar-linter.yml | 2 +- .github/workflows/docs-url-linter.yml | 4 +-- docs/Makefile | 7 +++-- docs/README.md | 2 +- docs/concepts/realms.md | 2 +- docs/concepts/stdlibs/events.md | 2 +- docs/concepts/stdlibs/overview.md | 2 +- docs/concepts/testnets.md | 2 +- docs/getting-started/becoming-a-gnome.md | 2 +- .../developing-locally/running-testing-gno.md | 2 +- docs/getting-started/exploring-gnoland.md | 2 +- docs/getting-started/writing-gno.md | 2 +- docs/reference/network-config.md | 2 +- docs/reference/rpc-endpoints.md | 2 +- docs/reference/std.md | 2 +- 16 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/docs-generate.yml diff --git a/.github/workflows/docs-generate.yml b/.github/workflows/docs-generate.yml new file mode 100644 index 00000000000..3ef5e268f53 --- /dev/null +++ b/.github/workflows/docs-generate.yml @@ -0,0 +1,31 @@ +name: Docs Generate + +on: + pull_request: + paths: + - 'docs/**' + +jobs: + embed: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22.7' + + - name: make gen + run: + cd docs/ && make gen -B + + - name: Check if there is a diff + run: | + diff=$(git status --porcelain) + if [[ $diff ]]; then + echo 'Please run `make build` to update the sidebar.js file!' + exit 1 + fi diff --git a/.github/workflows/docs-sidebar-linter.yml b/.github/workflows/docs-sidebar-linter.yml index f9258961051..2e0932e47bf 100644 --- a/.github/workflows/docs-sidebar-linter.yml +++ b/.github/workflows/docs-sidebar-linter.yml @@ -1,4 +1,4 @@ -name: Update Sidebar +name: Docs Sidebar on: pull_request: diff --git a/.github/workflows/docs-url-linter.yml b/.github/workflows/docs-url-linter.yml index 274ffdc1cf4..f5928b54232 100644 --- a/.github/workflows/docs-url-linter.yml +++ b/.github/workflows/docs-url-linter.yml @@ -1,4 +1,4 @@ -name: Docs Linter +name: Docs on: push: @@ -9,7 +9,7 @@ on: - "docs/**" jobs: - build: + lint-urls: runs-on: ubuntu-latest steps: diff --git a/docs/Makefile b/docs/Makefile index ae4a912e7ac..6720f6e4c86 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -1,16 +1,19 @@ MISC_DOCS=../misc/docs -build: $(MISC_DOCS)/docusaurus/static/sidebar.json +build: $(MISC_DOCS)/docusaurus/static/sidebar.json gen $(MISC_DOCS)/docusaurus/static/sidebar.json: README.md go build -C $(MISC_DOCS)/tools/indexparser -o ./build $(MISC_DOCS)/tools/indexparser/build -path ../docs/README.md > $(MISC_DOCS)/docusaurus/static/sidebar.json -# Run the linter for the docs/ folder +# Run the link linter for the docs/ folder lint: go build -C $(MISC_DOCS)/tools/linter -o ./build $(MISC_DOCS)/tools/linter/build -path ../docs +gen: + go run -modfile ../misc/devdeps/go.mod github.com/campoy/embedmd -w `find . -name "*.md"` + dev: cd $(MISC_DOCS)/docusaurus/ && yarn start diff --git a/docs/README.md b/docs/README.md index 4c51e35838f..3c706975b2e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -66,4 +66,4 @@ Find references for package APIs, RPC endpoints, network configurations, and mor - [tx-indexer](https://github.com/gnolang/tx-indexer) - [tx-archive](https://github.com/gnolang/tx-archive) - [gno-js-client](https://github.com/gnolang/gno-js-client) - - [tm2-js-client](https://github.com/gnolang/tm2-js-client) \ No newline at end of file + - [tm2-js-client](https://github.com/gnolang/tm2-js-client) diff --git a/docs/concepts/realms.md b/docs/concepts/realms.md index e20d2cf46dd..67bb8e46cb2 100644 --- a/docs/concepts/realms.md +++ b/docs/concepts/realms.md @@ -148,4 +148,4 @@ std.CurrentRealm() => Realm { } ``` -Check out the realm reference page [here](../reference/std.md#realm). \ No newline at end of file +Check out the realm reference page [here](../reference/std.md#realm). diff --git a/docs/concepts/stdlibs/events.md b/docs/concepts/stdlibs/events.md index 313abde4ced..2cac53b181f 100644 --- a/docs/concepts/stdlibs/events.md +++ b/docs/concepts/stdlibs/events.md @@ -49,4 +49,4 @@ data: ``` You can fetch the ABCI response of a specific block by using the `/block_results` -RPC endpoint. \ No newline at end of file +RPC endpoint. diff --git a/docs/concepts/stdlibs/overview.md b/docs/concepts/stdlibs/overview.md index 73d5b825f48..b418e1e7101 100644 --- a/docs/concepts/stdlibs/overview.md +++ b/docs/concepts/stdlibs/overview.md @@ -73,4 +73,4 @@ where you cloned the Gno repository. ```sh export GNOROOT=$HOME/gno -``` \ No newline at end of file +``` diff --git a/docs/concepts/testnets.md b/docs/concepts/testnets.md index 37cf15c9c61..4510a0989a8 100644 --- a/docs/concepts/testnets.md +++ b/docs/concepts/testnets.md @@ -90,4 +90,4 @@ Release commit: [652dc7a](https://github.com/gnolang/gno/commit/652dc7a3a62ee043 The first Gno testnet. Find archive data [here](https://github.com/gnolang/tx-exports/tree/main/test1.gno.land). Launch date: May 6th 2022 -Release commit: [797c7a1](https://github.com/gnolang/gno/commit/797c7a132d65534df373c63b837cf94b7831ac6e) \ No newline at end of file +Release commit: [797c7a1](https://github.com/gnolang/gno/commit/797c7a132d65534df373c63b837cf94b7831ac6e) diff --git a/docs/getting-started/becoming-a-gnome.md b/docs/getting-started/becoming-a-gnome.md index 4c4c290a395..bae83a1e6a6 100644 --- a/docs/getting-started/becoming-a-gnome.md +++ b/docs/getting-started/becoming-a-gnome.md @@ -74,4 +74,4 @@ communication, you can grow as a contributor and leave a lasting impact. Becoming a Gnome is a journey of learning, collaboration, and creativity. By embracing these principles and finding ways to showcase your work, -you can help shape the future of gno.land while staying true to your own path. \ No newline at end of file +you can help shape the future of gno.land while staying true to your own path. diff --git a/docs/getting-started/developing-locally/running-testing-gno.md b/docs/getting-started/developing-locally/running-testing-gno.md index 8febee27416..a66af98e3bc 100644 --- a/docs/getting-started/developing-locally/running-testing-gno.md +++ b/docs/getting-started/developing-locally/running-testing-gno.md @@ -167,4 +167,4 @@ That's it 🎉 You've successfully run local tests and expressions using the `gno` binary. Next, let's jump into how to create a Gno key pair, which is crucial to deploying -your code and interacting with the gno.land blockchain. \ No newline at end of file +your code and interacting with the gno.land blockchain. diff --git a/docs/getting-started/exploring-gnoland.md b/docs/getting-started/exploring-gnoland.md index 95b343d2bfc..d3a3e40ce4f 100644 --- a/docs/getting-started/exploring-gnoland.md +++ b/docs/getting-started/exploring-gnoland.md @@ -106,4 +106,4 @@ blockchain environment. Get started writing Gno code by visiting the next tutorial. -[^1]: gno.land also has a standard library, which is [built directly into the GnoVM](https://github.com/gnolang/gno/tree/master/gnovm/stdlibs). \ No newline at end of file +[^1]: gno.land also has a standard library, which is [built directly into the GnoVM](https://github.com/gnolang/gno/tree/master/gnovm/stdlibs). diff --git a/docs/getting-started/writing-gno.md b/docs/getting-started/writing-gno.md index 6b285dc49bd..95beb6a122a 100644 --- a/docs/getting-started/writing-gno.md +++ b/docs/getting-started/writing-gno.md @@ -149,4 +149,4 @@ found online. ## Conclusion Congratulations! You've just created your first Gno application, along with tests -to confirm it's working properly. \ No newline at end of file +to confirm it's working properly. diff --git a/docs/reference/network-config.md b/docs/reference/network-config.md index da8b38eab40..f7ab10ea648 100644 --- a/docs/reference/network-config.md +++ b/docs/reference/network-config.md @@ -10,4 +10,4 @@ All networks follow the same pattern for websocket connections: ```shell wss:///websocket -``` \ No newline at end of file +``` diff --git a/docs/reference/rpc-endpoints.md b/docs/reference/rpc-endpoints.md index ad2919ff9a4..8b9d7a716ce 100644 --- a/docs/reference/rpc-endpoints.md +++ b/docs/reference/rpc-endpoints.md @@ -1 +1 @@ -# RPC Endpoints \ No newline at end of file +# RPC Endpoints diff --git a/docs/reference/std.md b/docs/reference/std.md index db7569a6dc7..ed2f4dc3728 100644 --- a/docs/reference/std.md +++ b/docs/reference/std.md @@ -747,4 +747,4 @@ Creates a new code realm for testing purposes. ```go path := "gno.land/r/demo/boards" codeRealm := std.NewCodeRealm(path) -``` \ No newline at end of file +```