Ankr is the leading Web3 infrastructure company. It provides all the necessary blockchain infrastructure and services for companies to build new and bring their existing projects to Web3.
Ankr Docs contain information on Ankr, from general product information to user guides, SDK documentation, API references, RPC methods, Web3 tutorials, developer guides, and more. The docs are targeted at existing and potential Ankr users and explain what different products do and how to use them, both as an end-user or developer.
The docs are built on Nextra — a Next.js based static site generator.
As an ever-developing company, we welcome you to contribute to Ankr Docs — via feedback raising an issue or a pull request adding/updating content.
As raising an issue and describing a problem is pretty self-explanatory, let's jump straight to adding/updating content.
Adding/updating content is done via pull requests to this repo. If you're in the mood to improve our content:
- Understand the pull request policy.
- Work with the content either via the GitHub web interface or clone-commit-push.
We do not pose a strict policy on pull requests.
If you're an Ankr user, use the GitHub web interface:
- Go to the pages folder and either see what subfolder you need to add a new .md file or navigate to the .md file that you want to edit.
- Click Add file to add a new file or click the pencil icon to edit an existing file.
- Fill the newly created file with content or edit the content in the existing file you opened.
- When done, commit the changes to a new branch. A pull request will be created automatically.
Now, if you're with us, you know to uphold our standards.
If you are new to them, here are the guidelines:
- Get acquainted with Ankr Docs gitflow.
- Get acquainted with Ankr Docs deploying routine.
- Remember our internal branch naming and pull request policy.
- Clone the repo.
- Create a new branch branching off from stage.
- Get acquainted with the file and folder structure.
- Install dependencies for the docs.
- Run a local dev env.
- Work with the content and resources in your favorite IDE.
- Commit, push.
- Test your work, deploying it to a staging server and seeing if everything is as smooth on web as it was locally.
- Merge your changes, following the gitflow from #1 and pull request policy from #3.
Currently, we're using the following Gitflow:
- Create a feature branch from the
stage
branch. Use the branch naming format described further in this doc. - Work on the documentation for the feature.
- When done, test your documentation deploying it to
STAGE
. - When tested, create a pull request to the
stage
branch and add colleagues as reviews, at your discretion. Use the pull request naming format described further in this doc. - When merged, test the
stage
branch deploying it toSTAGE
. - When ready, create a pull request to the
main
branch. - When merged, test the
main
branch deploying it toSTAGE
. - When tested, deploy the
main
branch toPROD
.
To deploy:
- Navigate to the Actions tab on the repo page.
- Under
All workflows
, on the left, clickDeploy
. - Click the
Run workflow
button on the right, then choose the branch and environment to deploy to.- Deploy to
STAGE
or any other staging server from the drop-down list to view and test your doc updates in a safe environment. - When tested and ready, deploy to
PROD
available to general public.
- Deploy to
- Click the green
Run workflow
button right below the chosen values.
-
Branch off from stage.
-
Follow the branch naming format.
The common pattern for a branch name
<type>/<JIRA-TASK-NUMBER-description>
.Types:
feature
— tasks and storiesbugfix
— bugs such as typoshotfix
— on-the-spot updates
Naming examples:
feature/FOOBAR-1-create-ankr-staking-docs
bugfix/FOOBAR-2-fix-typos
hotfix/FOOBAR-3-update-sc-addresses-for-staking
-
Follow the pull request naming format.
The common pattern for a pull request title or commit message is
<type>[optional scope]: <TASK-000 description>
.Naming examples:
feat: FOOBAR-555 add docs for Ankr Protocol
fix(Fantom staking): FOOBAR-666 fix typos
chore: FOOBAR-777 update smart contract addresses for Ankr Staking
-
Make sure the Assignee is you and there are two labels — documentation and a section-specific label (e.g. staking).
git clone git@github.com:Ankr-network/ankr-docs.git && cd ankr-docs
git checkout stage && git checkout -b `<type>/<JIRA-TASK-NUMBER-description>`
┌ ○ .github
├ ○ workflows
├ deploy.yml — workflows for deploying the project via GitHub Actions.
├ ○ pages — source files with the content to generate static HTML files from.
├ ○ public — images to use in the docs.
├ ○ src
├ ○ components — custom React components to import and use in the project.
├ ○ hooks — hooks to sync wasm-docs and other projects.
├ ○ icons — icons to use in the metainfo.
├ ○ scripts — scripts implementing additional custom functionality.
├ ○ styles — custom CSS styles overwriting the default Nextra styles.
├ .gitignore — list of intentionally untracked files and folders to skip when committing.
├ next.config.mjs — configuration file for the Next.js framework, which powers Nextra.
├ next-env.d.ts — ensures Next.js types are picked up by the TypeScript compiler. Don't remove or edit!
├ package.json — project dependencies and dev commands.
├ postcss.config.js — configuration file listing additional packages to import to Nextra.
├ README.md — readme of the project.
├ redirects.js — redirects solution.
├ redirects.json — map of redirects for the redirects solution.
├ tailwind.config.js — additional CSS framework (imported in postcss.config.js).
├ theme.config.tsx — configuration file for Nextra with the essential project parameters.
├ tsconfig.json — paths to different features of wasm-docs as a TS project.
└ yarn.lock — lock file to ensure the same environment across devices.
yarn install
yarn dev
FYI, it's http://localhost:3000/docs/
.
Yeah, work that sweet content!
Remember that deploying routine above? Follow it.
Remember that pull request policy above? Let's sum it up:
- For the love of code, follow the pull request policy, or I will come to you in your dreams!
- Merge your branch to stage.
- If stage doesn't have any other unfinished work and is ready for prod, merge stage into main.
- Have a cookie.