Skip to content

Commit

Permalink
chore: update docs/' Makefile and CI (#2534)
Browse files Browse the repository at this point in the history
- add 'make build' (embedmd)
- refactor Makefile (simplified)
- check on CI that docs/ is "built" (no diff)

Related (but not closing) #2532
Part of #2529

---------

Signed-off-by: moul <94029+moul@users.noreply.github.com>
  • Loading branch information
moul authored Jul 7, 2024
1 parent b5560e2 commit 7fe0f20
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ jobs:
- name: Build docs
run: make -C docs/ build

- name: Check diff
run: git diff --exit-code || (echo "Some docs files are not formatted, please run 'make build'." && exit 1)

- name: Run linter
run: make -C docs/ lint
8 changes: 3 additions & 5 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ all: build lint

# Build the linter
build:
cd ../misc/docs-linter && go build -o ./build/
go run -modfile ../misc/devdeps/go.mod github.com/campoy/embedmd -w `find . -name "*.md"`

# Run the linter for the docs/ folder
lint:
../misc/docs-linter/build/linter -path .

clean:
rm -rf ../misc/docs-linter/build
go build -C ../misc/docs-linter -o ./build
../misc/docs-linter/build -path .
2 changes: 1 addition & 1 deletion docs/concepts/concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ id: concepts
# Concepts

Welcome to the **Concepts** section for Gno. This section outlines the most important
concepts related to Gno & Gno.land.
concepts related to Gno & Gno.land.
2 changes: 1 addition & 1 deletion docs/concepts/stdlibs/coin.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ which can manipulate them depending on access rights.

Read more about coins in the [Effective Gno](../effective-gno.md#coins) section.

The Coin(s) API can be found in under the `std` package [reference](../../reference/stdlibs/std/coin.md).
The Coin(s) API can be found in under the `std` package [reference](../../reference/stdlibs/std/coin.md).
2 changes: 1 addition & 1 deletion docs/concepts/stdlibs/stdlibs.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ where you cloned the Gno repository.

```sh
export GNOROOT=$HOME/gno
```
```
2 changes: 1 addition & 1 deletion docs/concepts/testnets.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,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)
Release commit: [797c7a1](https://github.com/gnolang/gno/commit/797c7a132d65534df373c63b837cf94b7831ac6e)
2 changes: 1 addition & 1 deletion docs/getting-started/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ id: getting-started

Welcome to the **Getting Started** section for Gno. This section outlines how to
get started with Gno by using the Gno Playground, as well as how to set up a
local development environment, get funds, deploy packages, etc.
local development environment, get funds, deploy packages, etc.
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@ to see your address on the main page of the Userbook realm.

This concludes the "Local Setup" tutorial. For next steps, see the
[How-to guides section](../../how-to-guides/how-to-guides.md), where you will
learn how to write your first realm, package, and much more.
learn how to write your first realm, package, and much more.
2 changes: 1 addition & 1 deletion docs/getting-started/local-setup/local-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ id: local-setup
# Local setup
This section will show you how to set up a local environment for Gno development.
It includes instructions for installation, setting up a Gno.land keypair,
browsing Gno source code, and more.
browsing Gno source code, and more.
2 changes: 1 addition & 1 deletion docs/getting-started/playground-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ exploring the [Concepts](../concepts/concepts.md) section.
To get started writing Gno code, check out the
[How-to](../how-to-guides/how-to-guides.md) section, the `examples/` folder on
the [Gno monorepo](https://github.com/gnolang/gno), or one of many community projects and tutorials found in the
[awesome-gno](https://github.com/gnolang/awesome-gno/blob/main/README.md) repo on GitHub.
[awesome-gno](https://github.com/gnolang/awesome-gno/blob/main/README.md) repo on GitHub.
2 changes: 1 addition & 1 deletion docs/gno-infrastructure/gno-infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ id: gno-infrastructure

Welcome to the **Gno Infrastructure** section. This section is meant for users
wanting to learn how to run their own Gno node, set up their own faucet, run
an indexer service, and more.
an indexer service, and more.
2 changes: 1 addition & 1 deletion docs/gno-infrastructure/premining-balances.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,4 @@ Let's break down this command:
That's it 🎉
You have successfully premined a native currency balance on a locally-running Gno chain!
Additionally, you have also learned how to query the native currency balance for an address, using built-in ABCI queries
and the `gnokey` tool.
and the `gnokey` tool.
3 changes: 1 addition & 2 deletions docs/how-to-guides/creating-grc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ the main functionality of our token realm. The package can be found at the

[embedmd]:# (../assets/how-to-guides/creating-grc20/mytoken-1.gno go)
```go
package mytoken

import (
"std"
"strings"
Expand All @@ -48,6 +46,7 @@ func init() {
// Mint 1 million tokens to admin
mytoken.Mint(admin, 1000000*10000)
}

```

The code snippet above does the following:
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/how-to-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ id: how-to-guides

Welcome to the **How-to Guides** section for Gno. This section outlines how to
complete specific tasks related to Gno, such as writing a realm & package, deploying
code to the chain, creating a GRC20 or GRC721 token, etc.
code to the chain, creating a GRC20 or GRC721 token, etc.
2 changes: 1 addition & 1 deletion docs/how-to-guides/simple-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ var listOfTapas = []string{
// GetTapaSuggestion randomly selects and returns a tapa suggestion
func GetTapaSuggestion(userInput string) string {

// Create a pseudorandom number depending on the block height.
// Create a random number depending on the block height.
// We get the block height using std.GetHeight(), which is from an imported Gno library, "std"
// Note: this value is not fully random and is easily guessable
randomNumber := int(std.GetHeight()) % len(listOfTapas)
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to-guides/testing-gno.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ in the [Standard Library](../concepts/stdlibs/stdlibs.md) reference section.
That's it 🎉

You have successfully written and tested Gno code. Additionally, you have utilized the `gno test` tool, and understood
how it can be configured to make the developer experience smooth.
how it can be configured to make the developer experience smooth.
1 change: 0 additions & 1 deletion docs/how-to-guides/write-simple-dapp.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ The realm will contain the following functionality:
package poll

import (
"bytes"
"std"

"gno.land/p/demo/avl"
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/network-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ All networks follow the same pattern for websocket connections:

```shell
wss://<rpc-endpoint:port>/websocket
```
```
2 changes: 1 addition & 1 deletion docs/reference/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ id: reference
# Reference

Welcome to the **Reference** section for Gno. This section outlines common APIs,
network configurations, client usages, etc.
network configurations, client usages, etc.
2 changes: 1 addition & 1 deletion docs/reference/stdlibs/std/realm.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ Checks if the realm it was called upon is a user realm.
#### Usage
```go
if r.IsUser() {...}
```
```
3 changes: 3 additions & 0 deletions misc/devdeps/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
install:
go install mvdan.cc/gofumpt
go install google.golang.org/protobuf/cmd/protoc-gen-go

tidy:
go mod tidy
3 changes: 3 additions & 0 deletions misc/devdeps/deps.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@ import (

// linter
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"

// embedmd
_ "github.com/campoy/embedmd/embedmd"
)
2 changes: 2 additions & 0 deletions misc/devdeps/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ require (
mvdan.cc/gofumpt v0.6.0
)

require github.com/campoy/embedmd v1.0.0

require (
4d63.com/gocheckcompilerdirectives v1.2.1 // indirect
4d63.com/gochecknoglobals v0.2.1 // indirect
Expand Down
2 changes: 2 additions & 0 deletions misc/devdeps/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7fe0f20

Please sign in to comment.