This repository hosts the end-user documentation for Mautic on the Read the Docs platform. Whenever a PR is merged, changes are deployed immediately to https://docs.mautic.org/.
We aim to move all aspects of the end-user documentation to Read the Docs.
For more background, our end goal, and to let us know if you want to help, please join the Education Team channel (#t-education) on Slack (get an invite at https://mautic.org/slack). Thanks in advance!
There are two ways to set up your local environment:
Mautic uses DDEV to simplify local development and testing of documentation updates.
Go to the Get Started page for instructions to install DDEV on your local machine.
Note
For Windows users: You can install and run DDEV on traditional Windows. However, it's recommended that you use Windows Subsystem for Linux 2 (WSL2) for faster and better performance.
If you're new to WSL, follow the instructions on the DDEV blog to install and set up WSL and DDEV.
After you've installed DDEV, follow these steps:
-
Fork and clone this repository to your local machine.
-
Navigate into the project directory by running:
cd user-documentation
-
Start the DDEV environment with this command:
ddev start
-
After making changes to documentation files, you need to build the updated docs by running:
ddev build-docs
-
Run the below command to view your changes live on your browser:
ddev launch
This automatically opens your browser and navigates to
https://user-documentation.ddev.site/
.Note: You must ensure that your changes work as expected. Every time you make changes, run
ddev build-docs
and refresh the page in your browser to see the changes.
Tip
If you don't see the configuration take effect, run ddev restart
to restart the project.
The following provides instructions for how to build docs locally for visualization without pushing to the remote:
-
Install Python 3 for your OS if not already installed
-
Install Sphinx
pip install sphinx
-
Install sphinx-rtd-theme
pip install sphinx-rtd-theme
-
Install MyST Parser
pip install myst_parser
-
CD into the docs directory
cd [path to this repo]/docs
-
Run
make html
This will generate HTML in
docs/build/html
. Setup a web server with the web root asdocs/build/html
or opendocs/build/html/index.html
in a browser.
Before pushing, run Vale and address suggestions and errors as applicable.
- Install
vale
vale .
You can automatically build changes to rst files using a file watcher.
- Go to Preferences -> Tools -> File Watchers -> + button -> custom
- Configure the watcher as presented in the screenshot
Currently, we manually create the translation files necessary for Transifex to inform translators that there are changes to the content.
To do this, run the following at the command line after following the steps to build the documentation locally.
- Run the command in the
/docs
foldersphinx-build -b gettext . docs_translations
- Commit the files created with your pull request
To make a small change to the base language files for the documentation, use the 'edit file' button on the documentation and commit your changes. This creates a new Pull Request.
To make more complex changes, follow the steps below:
-
Install a code editor. Visual Studio Code is recommended as it automatically installs all the extensions you need.
-
Install GitHub CLI which simplifies Git commands.
-
Create a working folder on your local computer.
-
Open a terminal and navigate to that folder using the command
cd <path/to/folder>
. -
Fork the
mautic/user-documentation
repository on GitHub by clicking on the fork button at the top right. -
Once forked, if you know your way around Git and you are writing documentation for something which is specific to the latest version of Mautic, you should branch from
main
.If you are writing documentation for a feature which is coming in a future release - for example,
5.0
- then branch off the relevant branch for that release, which should generally speaking match the branch used in the mainmautic/mautic
repository, for example,5.x
. -
Type
gh repo clone [your-forked-repo-name]/user-documentation
to clone your forked repository to your local computer. -
Open the folder
user-documentation
that is created in your editor. -
At the bottom left of your screen, you will see the default branch called
main
is showing as your active branch. Click this, and a box will appear at the top of the page allowing you to 'create a new branch'. Type a name which relates to the work you plan to do. -
Make your desired changes by editing the files, which you can locate on the left pane.
-
Use the Source Control icon on the menu on the left to view changed files. Click the plus icon next to them to 'stage' them for committing. This lets you save and describe changes in chunks, making it easier to reverse specific changes in the future.
-
If editing text, ensure to run necessary commands to update files for translations on Transifex and include those updates in your PR.
-
Commit all your changes, then click the 'Publish Branch' button. This action might prompt you to create a fork of the repository if not done earlier.
-
Under the Source Control icon, navigate to the 'Branches' section. Find your branch, hover over the 'Create pull request' icon, and click it.
-
This action will direct you to the GitHub web interface where you can add an appropriate title and description for your proposed changes.
-
If reviewers request changes, switch back to the branch (as explained in step 9). Implement the necessary changes and follow steps 11-14 again. After updating, commit, and push your changes, then notify the reviewer to check the updated content.
Thanks goes to these wonderful people (emoji key):
Gustavo Kennedy Renkel 🌍 |
Roman 🌍 |
Tomasz Kowalczyk 📖 |
kukis2107 🌍 |
putzwasser 👀 |
Moongazer 📖 |
Patryk Gruszka 📖 |
Emily 📖 |
John Wick 🐛 |
jagtapreshma 📖 |
Markus Heinilä 📖 |
CPweb 👀 |
Renato Heeb 📖 |
This project follows the all-contributors specification. Contributions of any kind welcome!