title: Contribution Guidelines weight: 9
Docsy is an open source project and we love getting patches and contributions to make Docsy and its docs even better.
The Docsy theme itself lives in https://github.com/google/docsy.
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to https://cla.developers.google.com/ to see your current agreements on file or to sign a new one.
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
As Docsy is a theme rather than a site, you can't serve the theme directly to check your changes work. Instead use your updated local theme in a local copy of the Docsy example site (copy or make your changes in the themes/docsy directory) and preview from there. Alternatively, clone the Docsy theme repo and test your changes in a local copy of this site, as described below.
This project follows Google's Open Source Community Guidelines.
Alternatively, if there's something you'd like to see in Docsy (or if you've found something that isn't working the way you'd expect), but you're not sure how to fix it yourself, please create an issue.
This user guide is, like our example site, a Docsy site that uses the Hugo static site generator. We welcome updates to the docs!
We use Netlify to manage the deployment of the site and provide previews of doc updates. The instructions here assume you're familiar with basic GitHub workflows.
userguide subdirectory.If you've just spotted something you'd like to change while using the docs, Docsy has a shortcut for you:
If you want to run your own local Hugo server to preview your changes as you work:
Fork the Docsy repo into your own project, then create a local copy using git clone:
git clone https://github.com/google/docsy.git
Change to the userguide directory and run the following Hugo command to build the site and start the Hugo server.
Note that you need the themesDir flag because the site files are inside the theme repo.
cd userguide
hugo server --themesDir ../..
By default your site will be available at http://localhost:1313/. Now that you're serving your site locally, Hugo will watch for changes to the content and automatically refresh your site.
Continue with the usual GitHub workflow to edit files, commit them, push the changes up to your fork, and create a pull request.
Docsy comes with Dockerfile and docker-compose files to run the server
locally with Docker, without installing any additional dependencies.
Using Docker:
docker build -t docsy/user-guide .
docker run -it --user=$(id -u):$(id -g) -p 1313:1313 \
-v $(pwd):/app/docsy -v /app/docsy/userguide/node_modules \
docsy/user-guide
Using Docker Compose:
docker-compose build
DOCSY_USER=$(id -u):$(id -g) docker-compose up
Open http://localhost:1313 in your web browser to load the docsy user guide. In most cases, docsy will automatically reload the site to reflect any changes to the documentation or the code. Changes to some parts of the docsy code may require manually reloading the page or re-starting the container.
Press Ctrl + C to stop the container.
We use Prettier to format the markdown source of the User Guide. To to check the formatting of your documentation changes, use the following command:
npm run check:format
To automatically fix formatting issues, run npm run fix:format.
Prettier doesn't currently understand Hugo template language directives, so you might need to bracket such directives using the following ignore directives:
<!-- prettier-ignore-start -->
{{</* tabpane */>}}
...
{{</* /tabpane */>}}
<!-- prettier-ignore-end -->
You can use these ignore directives to surround any markdown that you'd like
Prettier to ignore. If the region is a contiguous block of text, then you can
omit the end directive and replace the start directive with
prettier-ignore-start.
If there's something you'd like to see in the docs, but you're not sure how to fix it yourself, please create an issue in this repository. You can also create an issue about a specific page by clicking the Create Issue button in the top right hand corner of the page.