Thank you for deciding to contribute and help us improve Percona Server for MongoDB documentation!
We welcome contributors from all users and community. By contributing, you agree to the Percona Community code of conduct.
You can contribute to documentation in the following ways:
-
Request a doc change through a Jira issue. If you’ve spotted a doc issue (a typo, broken links, inaccurate instructions, etc.) but don’t have time nor desire to fix it yourself - let us know about it.
- Click the open a Jira ticket link at the bottom of the page. This opens the Jira issue tracker for the doc project.
- Sign in (create a Jira account if you don’t have one) and click Create to create an issue.
- Describe the issue you have detected in the Summary, Description, Steps To Reproduce, Affects Version fields.
-
Contribute to documentation yourself. Click the Edit this page icon next to the page title. This link leads you to the source file of the page on GitHub. There you make changes, create a pull request that we review and add to the doc project. For details how to do it, read on.
Percona Distribution for MongoDB documentation is written in Markdown language, so you can edit it online via GitHub. If you wish to have more control over the doc process, jump to how to edit documentation locally.
To contribute to the documentation, you should be familiar with the following technologies:
- MkDocs documentation generator. We use it to convert source
.mdfiles to .html and PDF documents. - git and GitHub
- Docker. It allows you to run MkDocs in a virtual environment instead of installing it and its dependencies on your machine.
There are several active versions of the documentation. Each version has a branch in the repository named accordingly:
- 3.6 (EOL)
- 4.0 (EOL)
- 4.2 (EOL)
- 4.4 (EOL)
- 5.0 (EOL)
- 6.0
- 7.0
- 8.0
The .md files are in the docs directory.
-
Click the Edit this page link on the sidebar. The source
.mdfile of the page opens in GitHub editor in your browser. If you haven't worked with the repository before, GitHub creates a fork of it for you. -
Edit the page. You can check your changes on the Preview tab.
-
Commit your changes.
- In the Commit changes section, describe your changes.
- Select the Create a new branch for this commit and start a pull request option
- Click Propose changes.
-
GitHub creates a branch and a commit for your changes. It loads a new page on which you can open a pull request to Percona. The page shows the base branch - the one you offer your changes for, your commit message and a diff - a visual representation of your changes against the original page. This allows you to make a last-minute review. When you are ready, click the Create pull request button.
-
Someone from our team reviews the pull request and if everything is correct, merges it into the documentation. Then it gets published on the site.
This option is for users who prefer to work from their computer and / or have the full control over the documentation process.
The steps are the following:
- Fork this repository
- Clone the repository on your machine:
git clone git@github.com:<your_name>/psmdb-docs.git- Change the directory to
psmdb-docsand add the remote upstream repository:
git remote add upstream git@github.com:percona/psmdb-docs.git- Pull the latest changes from upstream
git fetch upstream
git merge upstream/<branch>Make sure that your local branch and the branch you merge changes from are the same. So if you are on 8.0 branch, merge changes from upstream/8.0.
- Create a separate branch for your changes
git checkout -b <my_changes>- Make changes
- Commit your changes
- Open a pull request to Percona
To verify how your changes look, generate the static site with the documentation. This process is called building. You can do it in these ways: You can do it in these ways:
Learn more about the documentation structure in the Repository structure section.
- Get Docker
- We use this Docker image to build documentation. Run the following command:
docker run --rm -v $(pwd):/docs perconalab/pmm-doc-md mkdocs buildIf Docker can't find the image locally, it first downloads the image, and then runs it to build the documentation.
- Go to the
sitedirectory and open theindex.htmlfile to see the documentation. - To view your changes as you make them, run the following command:
docker run --rm -p 8000:8000 -v $(pwd):/docs perconalab/pmm-doc-md mkdocs serve -a 0.0.0.0:8000Paste the 0.0.0.0:8000 in your browser and you will see the documentation. The page reloads automatically as you make changes.
The doc project also includes a single-page HTML output for a PDF document. It is accessible at the 0.0.0.0:8000/percona-server-for-mongodb/print_page.html.
Save this page as a PDF. Depending on the browser, you may need to select the Export to PDF, Print - Save as PDF or just Save and select PDF as the output format.
In order not to break your running workflows, it's recommended to install MkDocs in a virtual environment.
pip install -r requirements.txt- While in the root directory of the doc project, run the following command to build the documentation:
mkdocs build - Go to the
sitedirectory and open theindex.htmlfile in your web browser to see the documentation. - To automatically rebuild the documentation and reload the browser as you make changes, run the following command:
mkdocs serve - To build the PDF documentation, open the
site/print_page.htmlin your browser. Save it as PDF. Depending on the browser, you may need to select the Export to PDF, Print - Save as PDF or just Save and select PDF as the output format.
The repository includes the following directories and files:
mkdocs-base.yml- the base configuration file. It includes general settings and documentation structure.mkdocs.yml- configuration file. Contains the settings for building the docs with Material theme.mkdocs-pdf.yml- configuration file. Contains the settings for building the PDF docs.docs:*.md- Source markdown files._images- Images, logos and faviconscss- Stylesjs- Javascript files
_resource:templates:styles.scss- Styling for PDF documents
theme:main.html- The layout template for hosting the documentation on Percona website
- overrides - The folder with the Material theme template customization for builds
.github:workflows:main.yml- The workflow configuration for building documentation with a GitHub action. (The documentation is built withmiketool to a dedicatedpublishbranch)
site- This is where the output HTML files are put after the build