How to contribute to docs
IF YOU HAVE ANY QUESTIONS post in the #documentation channel on discord
Yearn's documentation repository is hosted on GitHub in order to foster and encourage open source collaboration.
Note for translators: Non-english docs are store in separate branches. When merging your changes, direct your pull request to the corresponding branch
Working with HackMD
In order to contribute to Yearn docs, you will need to be able to write with Markdown syntax. It's extremely easy to learn. Use this cheat sheet to get started.
If you have no experience cloning and working on a repository, you can make your edits or additions in HackMD and then create an issue in GitHub that contains the Markdown copy. Just create a profile on Discord, and that can be linked to create a HackMD account.
Here's how to contribute using issues:
Create an issue in https://github.com/yearn/yearn-devdocs
Title your proposed changes - Make it clear what you are editing or adding
Paste the changes directly from your HackMD into the 'Write' section
Click 'Submit new issue'
Editing through the documentation UI
Another simple way to contribute is through the built in 'Edit on GitHub' button that you will see on all pages of Yearn docs. For this, you won't need to use HackMD at all, just make sure to have a GitHub account.
Find the 'Edit on GitHub' button on the top right of the docs page.
Find the pencil button on the GitHub page that opens. It will say 'Edit the file in your fork of this project'
From here, you will be able to edit any of the copy. Once you're finished, give your changes a title and a description at the bottom and 'Propose Changes'
After you 'Propose changes' GitHub will create a branch of the yearn-devdocs repository for you and show a summary of the changes you made. If everything looks right and complies with the Writing Style Guide, click 'Create pull request'
In your pull request (PR), give enough context about your changes for the repo admin to understand why they should be accepted. Afterwards, click 'Create pull request' and the admins will either merge, deny or make a comment.
Cloning the docs repository
Cloning a repository is ideal if you are working on more than one page.
This is a basic guide that doesn't involve using the command prompt. There are multiple ways to go about cloning and contributing to a repository. We encourage you to learn more about GitHub as it will help you troubleshoot any issues that you might encounter.
Login to your GitHub account
Install GitHub Desktop
Install Visual Code Studio (VSCode)
Fork the yearn/yearn-devdocs repository
Login to GitHub Desktop, find your forked repository and clone it
Click 'contribute to parent project'. This only effects your upstream and origin and upstream branch, which can be edited through the command line
Open the repository in VSCode
Create a new branch and give it a title that has to do with your current task. Keeping different tasks in different branches is important for organizational purposes
Find the page you are looking to edit in VSCode's sidebar. They follow the same structure as the Docs UI. README.md will always be
Edit the .md file, save it and minimize VSCode
GitHub Desktop will now show that you have changed a file. Give your change (commit) a title and description, then click 'commit to master'
Now, your changes are committed to your local branch. In order to push them to your public GitHub repo, click 'publish branch'
You now see a notification suggesting to make a pull request (PR) both on GitHub Desktop and the website. If you don't see this, you can go to https://github.com/yearn/yearn-devdocs and create one from there
Click on 'create pull request' and you should see the following screen
Make sure the base repository is 'yearn/yearn-devdocs' and the base is 'master'. (unless you are contributing to translated versions, in which case, the base should be the name of the language you are translating) The head repository should be 'your-username/yearn-devdocs' and the compare should be 'your-branch-name'
Make sure that your PR has all of the information needed to contextualize the change and that your changes comply with the Writing Style Guide. Once you create a pull request, it will be sent to the repo admins who can approve it to be merged into the live site.