Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): reorganize docs folder, add 404 checker #2125

Closed
wants to merge 42 commits into from

Conversation

leohhhn
Copy link
Contributor

@leohhhn leohhhn commented May 16, 2024

Description

Continuing #1999

Renames the docs with numbers, adds a Go linter and makefile to run it to check for 404 or broken links.

Contributors' checklist...
  • Added new tests, or not needed, or not feasible
  • Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory
  • Updated the official documentation or not needed
  • No breaking changes were made, or a BREAKING CHANGE: xxx message was included in the description
  • Added references to related issues and PRs
  • Provided any useful hints for running manual tests
  • Added new benchmarks to generated graphs, if any. More info here.

moul and others added 6 commits April 29, 2024 17:57
Signed-off-by: moul <94029+moul@users.noreply.github.com>
# Conflicts:
#	docs/02-getting-started/03-local-setup/browsing-gno-source-code.md
#	docs/02-getting-started/03-local-setup/browsing-gnoland.md
#	docs/02-getting-started/03-local-setup/installation.md
#	docs/02-getting-started/03-local-setup/interacting-with-gnoland.md
#	docs/04-concepts/stdlibs/events.md
@leohhhn leohhhn changed the title chore: reorganize docs folder with numbered prefixes chore(docs): reorganize docs folder with numbered prefixes May 16, 2024
@leohhhn leohhhn marked this pull request as ready for review May 17, 2024 16:41
@leohhhn leohhhn requested review from a team and moul as code owners May 17, 2024 16:41
@leohhhn leohhhn changed the title chore(docs): reorganize docs folder with numbered prefixes chore(docs): reorganize docs folder, add 404 linter May 17, 2024
docs/Makefile Outdated

# Build the linter
build:
cd linter && go build -o ./build/linter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool that you added a linter. However, please move it to misc/docs-linter.

Keep this Makefile here.

Thank you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to run it from the CI too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the linter: e7546dd

Adding the linter to the CI seems like it is out of scope for this PR - let's leave it for another one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the linter to the CI: 8fad8c9

Copy link
Member

@moul moul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

There is a question on the hierarchy that we need to address later, but this system looks good for both humans and machines, whether on GitHub or from a Go script that would want to generate static pages.

@leohhhn leohhhn requested a review from a team as a code owner May 17, 2024 18:53
@leohhhn leohhhn removed the request for review from a team May 17, 2024 18:53
@leohhhn
Copy link
Contributor Author

leohhhn commented Jun 3, 2024

I will resolve the merge conflicts after we merge this for consistency

@leohhhn
Copy link
Contributor Author

leohhhn commented Jun 3, 2024

I've also added a CI workflow but I'm not fully sure I'm doing it right - any inputs would be appreciated.

@leohhhn leohhhn changed the title chore(docs): reorganize docs folder, add 404 linter chore(docs): reorganize docs folder, add 404 checker Jun 5, 2024
@leohhhn
Copy link
Contributor Author

leohhhn commented Jun 6, 2024

Staging is returning a 404:
http://staging.gno.land:26657/
http://rpc.staging.gno.land:26657/

@albttx can you check this out?

@moul
Copy link
Member

moul commented Jun 13, 2024

Can you update this branch with master?

Related with #2258

@moul
Copy link
Member

moul commented Jun 13, 2024

Ignore 404 errors when not "localhost".

Comment on lines +27 to +28
- name: Run linter
run: make -C docs/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- name: Run linter
run: make -C docs/
- name: Build docs
run: make -C docs/ build
- name: Run linter
run: make -C docs/ lint

@grepsuzette
Copy link
Contributor

grepsuzette commented Jun 13, 2024

I am going to give a few comments and maybe help if I can.

The structure of the PR is currently like:
Screenshot 2024-06-13 at 14-03-36 chore(docs) reorganize docs folder add 404 checker by leohhhn · Pull Request #2125 · gnolang_gno

Our doc reads:

| Gno.land's documentation adopts the Diataxis framework, ensuring structured and predictable content. (...)

Diataxis is like standard doc, with a clear mental model about it.

There's actually a question, by numbering all files and directories are we actually following the guidelines?

For example this screenshot from https://diataxis.fr/complex-hierarchies/:

Screenshot 2024-06-13 at 14-25-23 Diátaxis in complex hierarchies - Diátaxis

Diataxis itself says in the end we can what can do whatever we want.

Personally I think:

  • Adding numbers to the files in a multi-part tutorial is a good idea.
  • Adding numbers to the top folders in docs/ is not ideal.
  • Adding numbers anywhere else is plainly normally wrong.

If we put aside the fact ordering can always be done in the markdown, numbering files introduces problems:

Insertion/deletion of a numbered file implies changing references to all subsequent files in the series, in all the docs/ files.

  • although doc-linter will help reducing the maintenance burden (eliminating issues/PR because of undetected dead-links),
  • changing the references will however still need to be done,
    • for all subsequent files in the numeric series,
    • changing all references in the files in docs/
  • since Diátaxis is about to improve docs iteratively, and seamlessly, the numbers will change all the time and it won't be seamless,
  • we want documentation to be a joy, not a burden.

So I suggest to abandon this idea of numbered files.

Just for example, the current PR has a file called docs/07-reference/03-stdlibs/01-std/03-coin.md. This is clearly not something we want to maintain.

We usually don't need the numbers. I understand the motivation to order files, but for documentation they should mostly matter for tutorials (you take a lesson with a tutor, since the initiation follows a certain path, numbered files make sense in that case).

According to the theory, if we use Diataxis mindfully, our documentation will evolve iteratively, and four solid poles will remain, not necessarily named like this, with the docs/README.md occupying a very neutral place in the middle:

Screenshot 2024-06-13 at 19-02-02 Excalidraw — Collaborative whiteboarding made easy

I propose the following:

  • abandon systematic numbering of files in docs/
  • use markdown lists to put items in the desired order instead (as shown at the end of this post).
  • use README.md as indexes (as discussed in PR 2258),
    • for example, docs/01-overview.md will become docs/README.md
    • this is predictable and reassuring
  • make use of leohhhn's doc-linter to detect deadlinks,
  • agree to have numbers in long tutorial filenames,
  • convene each directory has ideally 4-7 documentative items (already mostly the case),
  • convene that not perfect right now is ok,
  • trust that everything will fall into place if we use Diataxis guidelines and keep a simple architecture,
  • continue to improve the doc iteratively.

This means we can have that as a starting point.

docs/
  README.md
  getting-started/
  how-to-guides/
  concepts/
  reference/
  gno-tooling/
  gno-infrastructure/
  assets/
  legal/
  Makefile

Next iteration, gno-tooling can be moved in reference/tools.
Since gno-infrastructure is some sort of how-to guide, next iteration we can move it there.
This will allow easy and short contributions to the documentation. We don't need to do everything right now.

Also soon enough our docs/README.md will look like this:

gno docs
=======

Welcome to our docs. We are organized like so:

1. Tutorials
2. How to guides
3. Concepts
4. Reference

Not finding what you're looking for?
-------------------

Pellentesque malesuada, ipsum ac mollis pellentesque, risus
nunc ornare odio, et imperdiet dui mi et dui. Phasellus vel
porta turpis. In feugiat ultricies ipsum.

WDYT? Leon, I understand you have already gone through a lot of work in this PR. So I hope my comment is not discouraging. I just think numbered file will cost a lot of work in the future; it's not fair to not say anything. So let's discuss it.

thehowl pushed a commit that referenced this pull request Jun 19, 2024
<!-- please provide a detailed description of the changes made in this
pull request. -->

## Description

This PR cherrypicks the 404 link checker / linter from #2125.

<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
- [x] 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>
Copy link
Contributor

@mvertes mvertes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Numbering all the document files and directories seems a good idea to control their order of appearance, but why are some files / directories not yet numbered?

@leohhhn leohhhn marked this pull request as draft June 28, 2024 14:26
gfanton pushed a commit to gfanton/gno that referenced this pull request Jul 23, 2024
<!-- please provide a detailed description of the changes made in this
pull request. -->

## Description

This PR cherrypicks the 404 link checker / linter from gnolang#2125.

<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
- [x] 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>
@leohhhn
Copy link
Contributor Author

leohhhn commented Oct 21, 2024

Closing this as linter has been merged and the revamp will handle the reorg.

@leohhhn leohhhn closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants