gnolang / gno

Gno: An interpreted, stack-based Go virtual machine to build succinct and composable apps + Gno.land: a blockchain for timeless code and fair open-source.
https://gno.land/
Other
892 stars 372 forks source link

docs.gno.land revamp #2953

Open leohhhn opened 1 week ago

leohhhn commented 1 week ago

Description

Below outlines the reasoning & plan, organizational and content-wise, for the upcoming gno.land docs revamp.

Why?

We're doing a revamp to clean up and refresh the docs, and change what we want to tell our users about gno.land.

One of the main reasons for this revamp is to focus the content of the docs to users who want to become proficient Gnomes: they need to learn how to use Gno & the tools that support it, such as gnokey, gno, gnodev & last but not least, gnoweb.

The intent is to shift focus away from advanced usecases, such as setting up a new chain, to simple, "how to get started", "how to build xyz with Gno" & "how to become a good gnome/contributor" flows. This primarily puts the reader of the docs in the role of a newcomer looking to use gno.land as a platform to build decentralized, open-source applications, join a community of like-minded developers & users, and become a good contributor to the gno.land project.

Below are general notes and expectations, tasks to complete, and a preliminary index of the new docs structure.

General notes

Content order & flow

Should be dictated by the content itself, as opposed to the framework dictating it (which is the current case with sidebars.js). Ordering will be managed by a docs/README.md masterfile which will contain the docs index. This index will be the content index with all files linked, so that the file paths can be checked for validity, as well as used for generating a sidebar/navigation for a frontend. For actually generating content order, we have two options (RFC):

  1. Hacky way: utilize lexicographical ordering to order files only using filenames. This approach is used by the Go documentation already, and was proposed by @moul some time ago. By using numbers like on the below image, we leave "spots" for new files to come in, while keeping the ordering intact.
    Screenshot 2024-10-09 at 17 41 52 With this approach we can use docusaurus' autogenerated sidebar, and we can do the same for gnoweb down the line.
  2. Write a custom tool to parse the index into formats understandable by docusaurus, gnoweb, and other frameworks. Could become hard to maintain.

Finally, we don't have to conform to the simple UX we have currently; we could have something like what the Solana docs did with the content organization.

Tooling & client docs

We need a centralized source of truth for how to use a specific tool in order to avoid having to maintain multiple docs files, which has led to outdated information many times in the past. Here's the proposal discussed before:

Initial structure proposal

Legend:

Getting Started

Developer Guides

Concepts

Misc (needs better name or make into a no-name section)

Reference

Remarks

I am taking the lead on this effort, however, this cannot be a one-man job; I need help from others, as discussed previously on multiple occasions. Below are some things to consider:

Primary stakeholders here are: @moul, @thehowl, @leohhhn, @gnolang/tech-staff And of course, anyone who is willing to join the effort is more than welcome.

Moved over from the docs.gno.land repo: https://github.com/gnolang/docs.gno.land/issues/56

thehowl commented 1 week ago
  1. Hacky way: utilize lexicographical ordering to order files only using filenames. This approach is used by the Go documentation already, and was proposed by @moul some time ago. By using numbers like on the below image, we leave "spots" for new files to come in, while keeping the ordering intact.

The usage by Go is interesting, but also misguided: it seems to actually be used by some automatic tool to create the Go version changelog / release notes.

IMO, using ordering like this can work if we want to have something quick and easy to work with without having to develop too much additional tooling. But I dislike it because the permalink of the file becomes dependent on the ordering; ie. if we want to re-order the sections, the link would break. That's why even in this case, on the hosted documentation I'd prefer if we trimmed the number prefix (but used it only as meta-data for ordering).

Though I think that a file which we can use as a sidebar/navbar can work just as well for barebones usage, like it does for GitHub's wiki sidebar... by changing the CSS, we can also make it collapsable and function as a real side/navbar.

Finally, we don't have to conform to the simple UX we have currently; we could have something like what the Solana docs did with the content organization.

Agreed, ish. IMO, a goal of the content organization using mostly plain text and markdown is to make the docs content "gracefully fallback"; what this means is that even if I cat the file from my terminal I can read the docs, without needing a browser.

Markdown naturally lends itself towards this, and to be fair most users will access through the web, not through a plain-text terminal. But this kind of "graceful fallback" allows us not to get tied to any specific framework or way of showing the content; allowing even a basic render through gnoweb (which is an eventual usecase) to happen without needing to be a full-blown framework.

So, we can add stuff on docs.gno.land; let's just make sure that the content stays as markdown files that gracefully falls back. Then, we can more bells and whistles to the official website.

gnokey, gnodev, gno binaries, as the main tools the reader will be using, should have their separate guides in the docs, to which we can link to from their respective READMEs, still keeping one source of truth. If these tools change, we need a safe way to make sure that the docs are up to date. We can do this with proper codeowners setups & pinging docs owners for a review on PRs that modify the usage of these tools.

Let's use #2357 instead ;)

What is gno.land & Gno? Why build with it? *

BTW, me and manfred are writing this, as it's also useful as an internal/company memo. Still a draft, will keep you in the loop (it's a priority).

  • Creating a GRC20 token e@

  • Creating a .... (GRC721, DAO, ...)

Ideas for examples (order matters):

Let's put the focus on applications, using just gnoweb functions, rather than GRC20. Yes, most people will look for GRC20, but we want those that don't know anything about what GRC20 is to care about forums first, before moving onto the financial applications.

Concepts

Couldn't a lot of these just be part of a glossary?

std reference @ (write godoc and generate md)

We can keep what we currently have without many modifications, but this eventually should just be a link to the gno doc web interface.

leohhhn commented 1 day ago

Agreed, ish. IMO, a goal of the content organization using mostly plain text and markdown is to make the docs content "gracefully fallback"; what this means is that even if I cat the file from my terminal I can read the docs, without needing a browser.

Yes, I primarily meant on docusaurus - ie, do you have a sidebar, or a page of items, or something completely different. Markdown content is the source of truth & it has its own order.

Couldn't a lot of these just be part of a glossary?

For me, glossary = lookup dictionary - I expect this to be the place where you can read 1-2 sentences for a specific term. You still have a need for longer concept pages, which is why they have a place in the docs imho. So, for the proposed structure, I would keep the ones I listed.