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

Migrate docs to docusaurus #3511

Conversation

srdtrk
Copy link
Member

@srdtrk srdtrk commented Apr 24, 2023

Description

This PR:

  • Migrates the docs to docusaurus.
  • Uses the docs theme from cosmos-sdk.
  • Allows navigation to ADRs from the navbar.

closes: #3492, #3002

addresses: #3488

Structural Changes

Markdown Files

In the previous VuePress layout, markdown files could be placed anywhere within the docs project directory. The organization of the monolithic sidebar was managed by adding new entries to the sidebar in docs/.vuepress/config.js.

The new layout introduces multiple sidebars separated by the navbar. Currently, there are two sidebars: Documentation and Architecture Decision Records (previously, ADRs were not accessible through the website). To add new entries to the navbar, you edit the docs/docusaurus.config.js file. These two sidebars are autogenerated from the content found in the docs/docs/ directory (for the Documentation sidebar) and docs/architecture/ directory (for the ADRs sidebar).

In the previous layout, documentation markdown files (those displayed on the website) were distributed across several directories:

docs/
├── README.md
├── apps/
├── architecture/
├── assets/
├── client/
├── ibc/
├── middleware/
└── roadmap/
...

In the new layout, all markdown files displayed under the Documentation tab (in the navbar) are located within the following directories (including subdirectories):

docs/docs/
├── 00-intro.md
├── 01-ibc/
├── 02-apps/
├── 03-ibc/
├── 04-middleware/
└── 05-migrations/

The naming conventions for these files are explained in docs/README.md. ADRs still reside in the docs/architecture/ directory, as in the previous layout. Docusaurus can still autogenerate the navbar page correctly for ADRs, with the only change being the modification of docs/architecture/README.md to ensure Docusaurus places it at the top of the autogenerated ADR sidebar.

There are three other unchanged directories besides docs/architecture/:

docs/
├── dev/
├── events/
└── requirements/
...

These folders contain markdown files that are not accessible from the website for various reasons:

  • dev/ includes guides for creating PRs, issues, and etc.
  • requirements/ contains the requirements for specific IBC features.
  • events/ includes a deprecated markdown file about events emitted by ibc-go modules.

Images and Other Static Files

Previously, all images, including those used in documentation markdown files, were treated as static files and stored in the docs/assets/ directory. This was one of the reasons why docs versioning had to be managed through GitHub tags/releases.

The new layout differentiates between images used in documentation files (such as those in docs/docs/ markdown files) and truly static images (like website icons, banners, and logos). Static images are stored in the docs/static/img/ directory, while images used in documentation markdown files are kept in the ./images/ directory within the same directory as the markdown files. This means that each category has its own ./images/ directory, as seen in docs/docs/:

docs/docs/
├── 01-ibc
│   │ ...
│   │
│   ├── 04-middleware
│   │   ├── 01-overview.md
│   │   ├── 02-develop.md
│   │   ├── 03-integration.md
│   │   ├── _category_.json
│   │   └── images/
│   │ ...
├── 02-apps
│   ├── 01-interchain-accounts
│   │   │ ...
│   │   │
│   │   └── images/
│   ├── 02-transfer
...

Commit Message / Changelog Entry

docs: migrate to docusaurus

see the guidelines for commit messages. (view raw markdown for examples)


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

srdtrk added 30 commits April 19, 2023 15:56
@damiannolan
Copy link
Member

Awesome work getting this effort started! Much appreciated ❤️

The diff is quite large and seems like its showing some unrelated files. Is it possible for me to build and run the docs locally? That way I'd be happy to leave my approval by sanity checking a local deployment.

This PR doesn't change any of the contents, correct? It is just the structural changes to allow rendering the new markup?

@DimitrisJim
Copy link
Contributor

DimitrisJim commented May 3, 2023

@damiannolan yeah, just npm install followed by npm start in the docs/ folder to fire it up locally. The steps are somewhere in the PR but difficult to find due to the # of changes.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

running this locally seems perfectly fine to me and looks dope 🥳 left a couple of questions/comments.

@@ -41,7 +41,7 @@ This IBC implementation in Golang is built as a Cosmos SDK module. To understand

## Roadmap

For an overview of upcoming changes to ibc-go take a look at the [roadmap](./docs/roadmap/roadmap.md).
For an overview of upcoming changes to ibc-go take a look at the [roadmap](./docs/docs/01-ibc/09-roadmap.md).
Copy link
Contributor

Choose a reason for hiding this comment

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

dunno if this is necessary but seems kinda difficult to find this? I.e wouldn't know to look into docs/01-ibc for this, would expect it to be more top level like previously.

docs/README.md Show resolved Hide resolved
@@ -1,9 +0,0 @@
<!--
Copy link
Contributor

Choose a reason for hiding this comment

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

can't seem to find where this was moved. It might have been deleted alltogether since it was just pointing to another location?

Copy link
Member

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

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

ACK general structural layout. Local render looks great.

As a side note for a follow up PR it may be nice to add a main page under "IBC Application Modules" with a table of contents linking to transfer and interchain-accounts docs as well as a short blurb and link to the cosmos/ibc-apps repository.

docs/architecture/README.md Show resolved Hide resolved
docs/docs/01-ibc/04-middleware/01-overview.md Show resolved Hide resolved
Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Followup ACK. Thanks again for the work @srdtrk! I left some followup comments/questions, but I'm happy to see them addressed in followup pr's to the feature branch

@srdtrk srdtrk merged commit c1498a6 into feat/migrate-fully-to-docusaurus May 5, 2023
@srdtrk srdtrk deleted the serdar/issue#3492-migrate-docs-to-docusaurus branch May 5, 2023 11:02
srdtrk added a commit that referenced this pull request Sep 20, 2023
* docs: migrate to docusaurus (#3511)

The following stack was used:
- Docusaurus 2
- tailwindcss
- postcss

Min required node version is: 16.14
---------

Co-authored-by: colin axnér <[email protected]>

* merge: fixing conficts

* merge: bringing back client docs

* merge: removing versions again

* merge: fix conflicts

* fix: merge conflicts

* fix: merge conflicts

* fix: merge conflicts

* docs: implement versioned documentation (#3577)

* docs: workflow and linter improvements (#3805)

* docs: added version 7.0.0 docs, need to check for bugs

* docs: renamed the version to v7.0.0

* docs: added v6.1.0

* docs: added v5.3.0

* docs: added v4.4.0

* docs: updated the base url redirect, and version banners

* docs: replaced 'Pre-requisites Readings' -> 'Pre-requisite readings'

* docs: added missing ADRs to README.md

* docs: added versioning info to README.md

* docs: replaced '../../../../docs/architecture/adr-001-coin-source-tracing.md' -> '../../../architecture/adr-001-coin-source-tracing.md'

* docs: updated the url of the 7.0.0 (latest)

* docs: fixed all broken links

* docs: updated 'make build-docs' command to use docusaurus

* docs: Added a Links section to README.md

* docs: updated code blocks in 02-integration.md to use docusaurus features as an example

* docs: removed all TODOs from README.md

* docs: updated the typical versioned docs tree in README.md

* docs: made file naming section more precise

* docs: updated README.md

* docs: updated release-tracker.md

* docs: removed search section from README.md

* docs: updated release-management.md

* docs: updated Makefile

* docs: fixed more broken links

* docs: updated workflows to only run when changes to main occur (not releases)

* fix(ci): attempt to convert absolute urls to absolute filepaths in the ci

* fix(ci): added '@site/' to ignorePatterns instead

* imp(docs): removed wrong comment

* fix(ci): fix markdown-link-check for docusaurus

* docs: changed architecture links to absolute links

* fix(ci): replace only affects architect and event links now

* docs: fix broken more links

* imp(ci): ignore http links in markdown-link-check replace statements

* imp(ci): markdown-link-check should only run on modified md files

* fix(ci): attempt to fix markdown-link-check

* fix(ci): only check modified files for markdown-link-check

* revert(ci): reverted link-check.yml to initial state

* imp(ci): set link check timeout to 16 mins

* imp(ci/link-check): link-check should ignore versioned_docs now

* fix(ci/link-check): attempt to ignore files ending with '/'

* docs: fixed broken link

* docs: fixed broken link in RELEASES.md

* fix(ci/link-check): config works now

* refactor(ci/link-check): combined two regexp patterns into one in link-check config

* fix(ci/link-check): config is good - attempt to fix the workflow

* fix(ci/link-check): config is good - attempt to fix the workflow

* fix(ci/link-check): added verbose mode

* revert(ci/link-check): reverted workflow to initial state (not config)

* nit: broke a link to test ci

* revert(docs): fixed broken link

* build(docs/deps): updated docusaurus to 2.4.1

* docs: replaced intro titles

* docs: remove extra ')'

* docs: wrapped some prerequisites in note

* docs: replaces '::: tip' with ':::tip'

* docs: replace '::: warning' with ':::warning'

* docs: fix styling error

* docs: readme updated

* docs: removed all references to 'order:' frontmatter

* docs: fixed list styling in transfer/state-transitions

* docs: removed unneeded quotation

* imp(docs): improved the markdownlint settings

* imp(docs): improved the markdownlint settings

* docs: ran markdownlint with the new config

* docs: do not lint autogenerated CHANGELOG.md

* docs: removed 'bash' from the codeblock in the PR template

* docs: added '.github' to .markdownlintignore

* imp(docs): added more comments to markdownlint config

* docs: fixed incorrect category linking

* docs: fixed indentation issue in fee middleware

* imp(docs): added two more rules to markdownlint

* docs: ran 'make docs-lint'

* docs: made transfer the first app

* docs: made transfer the first app in all versions

* imp(makefile/docs): added link-check to makefile

* docs: added back the spaces

* docs: fixed a lint violation

* docs: contents of DOCS_GUIDELINES.md have been merged with README.md

* docs: ran markdownlint-cli

* docs: fixed a lot of linting errors

* docs: fixed a more linting errors

* docs: fixed all linting errors

* docs: corrected PR template's code box

* imp(docs): add a new workflow for linting changed markdown files

* docs: fixed linter violation

* imp(docs): switch to using markdownlint-cli2

* revert(ci/markdown-lint): original state

* imp(ci/markdown-lint): fix an error

* imp(ci/markdown-lint): only runs on PRs which modify .md files

* imp(ci/markdown-lint): only runs on PRs which modify .md files not in .github

* docs: fixed broken link

* imp(ci/link-check): this workflow only runs if a .md file has been modified

* deps(docs): ran 'npm i --save @easyops-cn/docusaurus-search-local'

* feat(docs): added local search bar

* fix(docs): search bar highlight color is not buggy anymore

* imp(docs): added term highlighting to search

* fix: merge conflicts

* docs: ran linter

* refactor: removed markdownlint changes in this PR

* refactor: removed markdownlint changes in this PR

* refactor: removed linkcheck changes in this PR

* revert: changes in PR template

* revert: added swagger-docs thing back

* revert: "revert: added swagger-docs thing back"

This reverts commit f6cdcdb.

* revert: "revert: changes in PR template"

This reverts commit 5a23809.

* revert: "refactor: removed linkcheck changes in this PR"

This reverts commit b401b31.

* revert: "refactor: removed markdownlint changes in this PR"

This reverts commit eb31283.

* revert: "refactor: removed markdownlint changes in this PR"

This reverts commit d5b74e0.

* add extra path to ignore

* docs linting

* Update docs/docs/01-ibc/09-roadmap.md

Co-authored-by: Charly <[email protected]>

---------

Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Charly <[email protected]>

* feat: v7.3.x docs added

* imp: improved Makefile for serving docs

* imp: checked out some problematic files

* fix: merge conflicts

* imp(docs): added versioned docs for v6.2.x

* ci: switched to docusaurus check and deploy workflows (#4688)

* ci: switched to docusaurus check and deploy workflows

* ci: added workflow_dispatch back to deploy-docs

* imp(lint): ignores all changelogs now

* imp: ran linter

* imp(makefile): improved build-docs

* fix(docs): broken links

* imp: improved workflows around markdownlint

* imp: improved workflows around markdownlint

* imp(docs): added the new ibc assets

* deps(docs): updated deps

* style(docs): reorganized footer code

* docs: fix cosmos-sdk broken links

* imp(docs): removed link from the footer logo

* imp(docs): improved footer

* imp(docs): added a link to privacy policy

* deps(docs): added 'npm run dev' script

* imp(docs): apply review item

* imp: ran 'make docs-lint'

* imp: added 'make tag-docs-version'

---------

Co-authored-by: colin axnér <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: Charly <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants