Skip to content

Commit

Permalink
docs: reorg & rename top level docs (gnolang#1455)
Browse files Browse the repository at this point in the history
## Description

This PR introduces a small reorg to the docs structure. 

Our docs follow the [Diataxis](https://diataxis.fr/) framework, but upon
further thought I don't believe that we need to or that we should follow
the framework 1:1, as it can be too rigid at times. IMHO it is more
understandable to have the "Explanation" category renamed to "Concepts"
or "Gno Concepts". While this is a minor change, I believe people who
are not aware of Diataxis will find "Concepts" more intuitive.

This PR also extracts the "Gno Tooling" out of "Explanation", as the
category deserves its own spot in the sidebar.

EDIT: This PR also resolves the conflict with and modifies the
`docs/reference/standard-library.md` file (merged with
[gnolang#859](gnolang#859)).

<details><summary>Contributors' checklist...</summary>

- [x] Added new tests, or not needed, or not feasible
- [x] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [x] Updated the official documentation or not needed
- [x] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [x] Added references to related issues and PRs
- [x] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
  • Loading branch information
leohhhn authored and gfanton committed Jan 18, 2024
1 parent 483601b commit 60e3824
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Gno is an interpreted and fully-deterministic implementation of the Go
programming language, designed to build succinct and composable smart contracts.
The first blockchain to use it is Gno.land, a
[Proof of Contribution](./docs/explanation/proof-of-contribution.md)-based chain, backed by
[Proof of Contribution](./docs/concepts/proof-of-contribution.md)-based chain, backed by
a variation of the [Tendermint](https://docs.tendermint.com/v0.34/introduction/what-is-tendermint.html)
consensus engine.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions docs/getting-started/browsing-gno-source-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ id: browsing-gno-source-code

## Overview

In this tutorial, you will learn how to browse deployed Gno [Realms](../explanation/realms.md)
and [Packages](../explanation/packages.md). Additionally, you will understand how the `Render` method is utilized
In this tutorial, you will learn how to browse deployed Gno [Realms](../concepts/realms.md)
and [Packages](../concepts/packages.md). Additionally, you will understand how the `Render` method is utilized
to achieve Realm state visibility.

## Prerequisites
Expand Down Expand Up @@ -48,7 +48,7 @@ We should be able to access the website locally on http://127.0.0.1:8888/.

Packages in Gno.land usually have names resembling `gno.land/p/<name>`. Since packages do not contain state, we can only
view their source code on-chain. To learn more about Packages, please check out
the [Packages](../explanation/packages.md) explanation document.
the [Packages](../concepts/packages.md) explanation document.

Using `gnoweb`, we can browse the source code in our browser.
For example, the `avl` package is deployed at `gno.land/p/demo/avl`.
Expand All @@ -68,7 +68,7 @@ In contrast to Packages, Realms in Gno.land usually have names resembling `gno.l

Realms _do_ contain state, and in addition to being able to view their source code on-chain, users can also view their
internal state representation in the form of the `Render()` output. To learn more about Realms, please
check out the [Realms](../explanation/realms.md) explanation document.
check out the [Realms](../concepts/realms.md) explanation document.

Using `gnoweb`, we can browse the Realm `Render()` method output and source code in our browser.
For example, the `boards` Realm is deployed at `gno.land/r/demo/boards`.
Expand Down
4 changes: 2 additions & 2 deletions docs/how-to-guides/creating-grc20.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ id: creating-grc20

## Overview

This guide shows you how to write a simple _GRC20_ Smart Contract, or rather a [Realm](../explanation/realms.md), in [Gno (Gnolang)](../explanation/gno-language.md). For actually deploying the Realm, please see the [deployment](deploy.md) guide.
This guide shows you how to write a simple _GRC20_ Smart Contract, or rather a [Realm](../concepts/realms.md), in [Gno (Gnolang)](../concepts/gno-language.md). For actually deploying the Realm, please see the [deployment](deploy.md) guide.

Our _GRC20_ Realm will have the following functionality:

Expand Down Expand Up @@ -153,7 +153,7 @@ Detailing what is happening in the above code:
- Calling the `Mint` method would create a configurable number of tokens by the administrator.
- Calling the `Burn` method would destroy a configurable number of tokens by the administrator.
- Calling the `Render` method would return a user's `balance` as a formatted string. Learn more about the `Render`
method and how it's used [here](../explanation/realms.md).
method and how it's used [here](../concepts/realms.md).
- Finally, we provide a local function to assert that the calling account is in fact the owner, otherwise panic. This is a very important function that serves to prevent abuse by non-administrators.

## Conclusion
Expand Down
6 changes: 3 additions & 3 deletions docs/how-to-guides/creating-grc721.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ id: creating-grc721

## Overview

This guide shows you how to write a simple _GRC721_ Smart Contract, or rather a [Realm](../explanation/realms.md),
in [Gno (Gnolang)](../explanation/gno-language.md). For actually deploying the Realm, please see
This guide shows you how to write a simple _GRC721_ Smart Contract, or rather a [Realm](../concepts/realms.md),
in [Gno (Gnolang)](../concepts/gno-language.md). For actually deploying the Realm, please see
the [deployment](deploy.md) guide.

Our _GRC721_ Realm will have the following functionality:
Expand Down Expand Up @@ -186,7 +186,7 @@ Detailing what is happening in the above code:
method on the `grc721` instance we instantiated at the top of the file; this method returns a formatted string that
includes the token: symbol, supply and account balances (`balances avl.Tree`) which is a mapping denoted
as: `OwnerAddress -> TokenCount`; otherwise returns false and renders a `404`; you can find more information about
this `Render` method and how it's used [here](../explanation/realms.md).
this `Render` method and how it's used [here](../concepts/realms.md).
- Finally, we provide a local function to assert that the calling account is in fact the owner, otherwise panic. This is
a very important function that serves to prevent abuse by non-administrators.

Expand Down
8 changes: 4 additions & 4 deletions docs/how-to-guides/simple-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ id: simple-contract

## Overview

This guide shows you how to write a simple _Counter_ Smart Contract, or rather a [Realm](../explanation/realms.md),
in [Gno (Gnolang)](../explanation/gno-language.md). For actually deploying the Realm, please see
This guide shows you how to write a simple _Counter_ Smart Contract, or rather a [Realm](../concepts/realms.md),
in [Gno (Gnolang)](../concepts/gno-language.md). For actually deploying the Realm, please see
the [deployment](deploy.md) guide.

Our _Counter_ Realm will have the following functionality:
Expand Down Expand Up @@ -50,7 +50,7 @@ cd counter-app
mkdir r
```

Alternatively, if we were writing a [Gno Package](../explanation/packages.md), we would denote this directory name
Alternatively, if we were writing a [Gno Package](../concepts/packages.md), we would denote this directory name
as `p` (for `package`). You can learn more about Packages in our [Package development guide](simple-library.md).

Additionally, we will create another sub-folder that will house our Realm code, named `counter`:
Expand Down Expand Up @@ -115,7 +115,7 @@ There are a few things happening here, so let's dissect them:
- `Increment` and `Decrement` are public Realm (Smart Contract) methods, and as such are callable by users.
- `Increment` and `Decrement` directly modify the `count` value by making it go up or down (change state).
- Calling the `Render` method would return the `count` value as a formatted string. Learn more about the `Render`
method and how it's used [here](../explanation/realms.md).
method and how it's used [here](../concepts/realms.md).

:::info A note on constructors
Gno Realms support a concept taken from other programming languages - _constructors_.
Expand Down
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 @@ -8,7 +8,7 @@ id: simple-library

This guide shows you how to write a simple library (Package) in Gnolang, which can be used by other Packages and Realms.
Packages are _stateless_, meaning they do not hold state like regular Realms (Smart Contracts). To learn more about the
intricacies of Packages, please see the [Packages reference](../explanation/packages.md).
intricacies of Packages, please see the [Packages reference](../concepts/packages.md).

The Package we will be writing today will be a simple library for suggesting a random tapas dish.
We will define a set list of tapas, and define a method that randomly selects a dish from the list.
Expand Down
51 changes: 26 additions & 25 deletions misc/docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,32 @@ const sidebars = {
'how-to-guides/connect-wallet-dapp',
],
},
{
type: 'category',
label: 'Concepts',
items: [
'concepts/realms',
'concepts/packages',
'concepts/tendermint2',
'concepts/gnovm',
'concepts/proof-of-contribution',
'concepts/gno-language',
'concepts/gno-modules',
'concepts/gno-test',
'concepts/from-go-to-gno',
],
},
{
type: 'category',
label: 'Gno Tooling',
items: [
'concepts/gno-tooling/cli/gno-tooling-gno',
'concepts/gno-tooling/cli/gno-tooling-gnokey',
'concepts/gno-tooling/cli/gno-tooling-gnofaucet',
'concepts/gno-tooling/cli/gno-tooling-gnoland',
'concepts/gno-tooling/cli/gno-tooling-tm2txsync',
]
},
{
type: 'category',
label: 'Reference',
Expand Down Expand Up @@ -81,31 +107,6 @@ const sidebars = {
},
],
},
{
type: 'category',
label: 'Explanation',
items: [
'explanation/realms',
'explanation/tendermint2',
'explanation/gnovm',
'explanation/proof-of-contribution',
'explanation/gno-language',
'explanation/gno-modules',
'explanation/gno-test',
'explanation/from-go-to-gno',
{
type: 'category',
label: 'Gno Tooling',
items: [
'explanation/gno-tooling/cli/gno-tooling-gno',
'explanation/gno-tooling/cli/gno-tooling-gnokey',
'explanation/gno-tooling/cli/gno-tooling-gnofaucet',
'explanation/gno-tooling/cli/gno-tooling-gnoland',
'explanation/gno-tooling/cli/gno-tooling-tm2txsync',
]
},
],
},
],
};

Expand Down

0 comments on commit 60e3824

Please sign in to comment.