Documentation improvements - suggestion for GitBook #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
Test Plan
Related issues/PRs
GitBook
GitBook might be a good alternative that can be used to update the visuals of the documentation.
There is a free version, but for it we have some limitations.
Only one user can be supported in the free version, for every additional user included, there is a price. More information can be found in here - https://www.gitbook.com/pricing
The
Plus
plan might be enough for what we are after, and depending on monthly or annual plan, the costs might be decent.After my research, I conducted that currently there is a limit on the documentation import size -
The maximum number of pages that can be uploaded in a single import is 20.
There is a solution for that, with no limitations - https://docs.gitbook.com/integrations/git-sync
Also there is some other limitations, more info can be found here - https://docs.gitbook.com/help-and-faq/faq/content-creation-faq
If we decide to use
GitBook
, I have included a new script filegenerate-docs-markdown.js
, and a new script trigger commanddocs:generate-markdown
inpackage.json
Regarding the automation of the deployment of the documentation, GitHub workflow file can be added.
Below you can find an example file for the automation process.
Example:
typedoc-generate-gitbook-docs.yml
Notes:
We could use this library - https://github.com/ZanderZhao/gitbook-action for the last part
Deploy to GitBook
, but something to take in mind is that it will replace the old documentation content ingh-pages
branch. https://github.com/ZanderZhao/gitbook-action?tab=readme-ov-file#step3-choose-optionsYOUR_GITBOOK_REPOSITORY
with the actual GitBook repository URL.YOUR_GITBOOK_TOKEN
secret should be added to your GitHub repository settings. This token allows the GitHub Actions workflow to push changes to your GitBook repository.YOUR_DOCUMENTATION_BRANCH
should be the branch which will be connected to the GitBook - GitHub SyncYOUR_TRIGGER_BRANCH
should be the branch from which the GitHub Workflow will be triggered.YOUR_GITHUB_PERSONAL_ACCESS_TOKEN
secret should be added to your GitHub repository settings. This token allows the GitHub Actions workflow to push changes to the GitHub repository.This setup will automatically build and deploy TypeDoc documentation to GitBook whenever there is a push to the suggested branch.
The end documentation can look something like this: - https://limechain.gitbook.io/limechain-test