-
Notifications
You must be signed in to change notification settings - Fork 70
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
Documentation improvements - suggestion for GitBook #413
Documentation improvements - suggestion for GitBook #413
Conversation
@gtsonevv I love the improved look, but the setup looks a bit complex to me. I must say that I got used to automated docs.rs service that just takes my Rust crate and makes the docs out of it with zero configuration. I believe that the improved look will contribute to the adoption and I hope that we will be able to flesh out the docs with more examples and relevant information / references. What would be the best way forward? Will the free plan work for us, or should I register a paid plan? |
|
||
- name: Deploy to GitBook | ||
env: | ||
GITBOOK_TOKEN: ${{ secrets.GITBOOK_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is this token used?
git clone --branch=git-book https://near:${{ secrets.GH_PAT }}@github.com/near/near-sdk-js.git book | ||
rsync -av --delete markdown-docs/ book/markdown-docs/ | ||
cd book | ||
git config user.name "GitHub Actions" | ||
git config user.email "[email protected]" | ||
git add markdown-docs/ | ||
git commit -m "Update documentation [skip ci]" | ||
git push https://near:${{ secrets.GH_PAT }}@github.com/near/near-sdk-js.git git-book |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no GH_PAT
secret. As I mentioned in DM, there is MY_GITHUB_TOKEN
secret associated with my frol
account, so not near:
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@race-of-sloths score 5
@gtsonevv Thank you for your contribution! Your pull request is now a part of the Race of Sloths! Current status: executed
Your contribution is much appreciated with a final score of 5! What is the Race of SlothsRace of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow For contributors:
For maintainers:
Feel free to check our website for additional details! Bot commands
|
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