Skip to main content

Mojo documentation code examples

This directory includes code examples used in the Mojo Manual and related documentation at docs.modular.com/mojo. Reference solutions for Mojo tutorials can be found in the /examples/mojo directory. The primary purpose of this directory is to enable automated testing of code examples.

Note: Code examples in the API reference documentation for the Mojo Standard Library and other Modular open source libraries are embedded in the source files for those libraries and are not included here.

Contributing

If you see something in the documentation or the code examples that is incorrect or could be improved, we'd love to accept your contributions. At this time, code from this directory is not automatically included in the corresponding documentation file. If you contribute a change to a code example, please be sure to make a corresponding change to the copy of the code in the related documentation, as well as any explanatory text.

Be aware that we don't provide tools to generate a preview of the website, because the Mojo docs are built along with other content that's not included in this repo. As such, we recommend you preview your edits in an IDE that can render Markdown and MDX files, such as VS Code, including the VS Code environment in GitHub.

For more information about how to contribute, see the Contributor Guide.

Was this page helpful?