Contribute

Edit this documentation

Translate the documentation or open the complete project on your computer.

Nothing is published until you choose to submit your work.

Contribute from a published page

Move from a published documentation page to a safe local checkout, then submit a reviewed change.

Site owners can let readers start a contribution from any published page. The reader does not need to find the source repository or the matching Markdown file.

Start from the page

  1. Select the edit icon in the documentation navbar.
  2. Select Edit this page locally, or Translate documentation to start with a translation.
  3. Copy the command selected for your operating system.
  4. Run the command in a terminal.

The generated script already contains this site’s repository, branch, and translation goal. The translation command needs no arguments. Edit this page locally adds just the source filename, which selects the page editor instead.

If M-Press is installed, the command runs it directly. Otherwise, the generated shell or PowerShell script downloads the matching release and verifies its checksum before it starts.

Choose the contribution

The local site opens the editing or translation workflow you selected. Use Back from the editing screen to choose another contribution:

  • Improve this page opens the exact source file for the published page.
  • Translate documentation opens the guided translation workflow.
  • Improve the site setup opens the project configuration.
  • Check the project validates the current checkout before you edit.

If the project contains a configured contributor guide, M-Press shows it before you start editing.

Improve the selected page

M-Press shows the relative source path and the local checkout. Copy the path, open it in your editor, and save the Markdown file. The development server rebuilds the site and reloads the browser when the changed page is ready.

If the site has other languages, the editing screen shows Update this page in other languages? when translations need attention. Even a one-line source change can make a translated passage stale.

  1. Select Review update beside a language.
  2. Keep Everything that needs attention to translate only missing or stale passages on this page. Leave Replace passages changed by a person off.
  3. Select Review the plan and check the page, passage count, and provider.
  4. Select Start translation. Read the translated page before approving it.
  5. After approval, choose the next language from Translations of this page. You can also select Other languages for this page from the result before approval.

Saving a source file never starts translation automatically. Existing human edits are preserved. If the screen reports missing tracking or migration, resolve that state first; see Translation state and review. You can also leave translations for another contributor and submit the source change on its own.

Select Run checks when finished. M-Press rebuilds every page and validates internal links and generated assets.

Submit the contribution

After validation, select Review changes. M-Press shows the changed files and the source diff before it runs any Git command.

  1. Write a short commit message and select Commit changes.
  2. Select Push contribution branch.
  3. Select Open draft pull request.

M-Press first tries the configured origin. If that repository rejects the push and GitHub CLI is authenticated, M-Press prepares the contributor’s fork and pushes the branch there. If automatic submission is unavailable, the wizard shows exact commands that the contributor can copy.

Safety and authentication

The published page contains the repository URL, source branch, page route, and source path. It does not contain credentials.

Public repositories clone without authentication. Private repositories use the reader’s existing Git credential helper or GitHub CLI login. M-Press refuses to reuse an unrelated directory. It also refuses a dirty existing checkout unless that checkout is already on an M-Press contribution branch.

Commits, pushes, and pull requests are separate explicit actions. A validation run never uploads work.

Configure contributor instructions

Add contribution settings to mpress.yaml:

yaml
contribution:
  enabled: true
  repository: https://github.com/example/docs.git
  branch: main
  guide: CONTRIBUTING.md

The guide path must stay inside the project. If guide is not set, M-Press looks for CONTRIBUTING.md, CONTRIBUTORS.md, and .github/CONTRIBUTING.md.

You can also configure these values in development mode. Open the M-Press project editor, select Navigation and links, and enable reader contributions.

Generated installation scripts

The production build includes /contribute.sh and /contribute.ps1. Each script contains the configured repository and branch and opens the translation workflow by default. These are ordinary static files generated during the build.

For a site published at https://docs.example.com, the commands are:

sh
# Translate the documentation
curl -fsSL https://docs.example.com/contribute.sh | sh

# Edit one source page
curl -fsSL https://docs.example.com/contribute.sh | sh -s -- docs/guide.md

The filename is relative to the repository root, including its content directory and language directory when applicable. The site’s copy button supplies and quotes the correct filename automatically.

The POSIX script supports Linux and macOS on AMD64 and ARM64. It tries curl and then wget, downloads the matching archive from the latest GitHub release, and verifies it against checksums.txt. The Windows script uses PowerShell and applies the same SHA-256 check.

Both scripts use mpress directly when it is already available on the path.

The macOS and Linux command shown to readers uses curl only to fetch this script; release selection, download retries, verification, and setup happen inside the script. If curl is unavailable, save the script using the View the macOS and Linux script link under What this command does and run it with sh as shown below. The script can use wget for release downloads.

After saving the generated script locally, run:

sh
sh contribute.sh
sh contribute.sh docs/guide.md --checkout "../docs contributions"

On Windows:

PowerShell
./contribute.ps1
./contribute.ps1 docs/guide.md

Options go after the optional source filename or page URL. The scripts forward contributor options such as --checkout, --port, --no-open, and --draft-file to M-Press. The older positional page, draft filename, and goal arguments from published pages still work, and the old mpress-contribute.sh and mpress-contribute.ps1 URLs remain available. Run the script with --help for usage without downloading anything.

Git must be installed before running the script. Downloaded release files are temporary and are removed when M-Press exits, including when setup fails. The contribution checkout remains available for your next session. Provider configuration and translation review happen in the local translation workflow; opening it does not start paid translation requests.

Last updated: