Skip to content

Commit ff0bbfc

Browse files
authored
[docs] Cherrypick latest docs for docs/oss-materials/ (#35953)
These are all the changes to the open-source Mojo docs intended for the release with 24.2. --------- Co-authored-by: Joe Loser <[email protected]> Co-authored-by: Jack Clayton <[email protected]> Co-authored-by: ematejska <[email protected]> Co-authored-by: Arthur Evans <[email protected]> modular-orig-commit: 64924205cdb683fe2083a5814bc3455047739e4f
1 parent 01ec9ce commit ff0bbfc

13 files changed

+584
-239
lines changed

CONTRIBUTING.md

+112-18
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Mojo Contributor Guide
1+
# Mojo contributor guide
22

33
Welcome to the Mojo community! 🔥 We’re very excited that you’re interested in
44
contributing to the project. To help you get started and ensure a smooth
@@ -8,7 +8,7 @@ There are many ways to contribute to the project, from joining the
88
[Discord community](https://www.discord.gg/modular), to filing bugs, to
99
contributing documentation, examples, or code.
1010

11-
## Submitting Bugs
11+
## Submitting bugs
1212

1313
Reporting issues is a great way to contribute to the project. Mojo uses GitHub
1414
Issues for tracking bugs.
@@ -21,25 +21,25 @@ Also, before opening a new issue, take a moment to search through the already
2121
submitted issues to avoid creating duplicate issues for the maintainers to
2222
address.
2323

24-
### Writing High-Quality Bugs
24+
### Writing high-quality bugs
2525

2626
We encourage you to provide as much information about the issue as practical.
2727
The more details you provide, the faster we can resolve the issue. The following
2828
is a template of the information that should accompany every submitted issue.
2929

30-
#### Issue Template
30+
#### Issue template
3131

3232
- **Summary.** A descriptive summary of the issue.
3333
- **Description.** A detailed account of the bug, including what was expected
3434
and what occurred.
35-
- **Environment Details.**
35+
- **Environment details.**
3636
- Mojo Compiler Version
3737
- Operating System version
3838
- Hardware Specifications
39-
- **Severity/Frequency.** An assessment of the impact ranging from inconvenience
39+
- **Severity/frequency.** An assessment of the impact ranging from inconvenience
4040
to a blocker.
4141

42-
## Contributing to Docs and Examples
42+
## Contributing to docs and examples
4343

4444
We’re happy to accept pull requests for the docs and examples.
4545
If your change is any one of the following, please create a pull request and we
@@ -67,7 +67,7 @@ require difficult reviews and rework, or that might get rejected.
6767
See [Pull Requests](#pull-requests) for information on creating your first pull
6868
request.
6969

70-
## Contributing to the Standard Library
70+
## Contributing to the standard library
7171

7272
The standard library team is dedicated to creating a vibrant technical community
7373
around the Mojo programming language. Our vision includes a diverse and
@@ -84,12 +84,12 @@ For more information on our priorities, see the following documents:
8484
For technical details on developing for the standard library, see the following
8585
documents:
8686

87-
- [Developing the Standard Library](./stdlib/docs/development.md) covers building,
87+
- [Developing the standard library](./stdlib/docs/development.md) covers building,
8888
testing, and other information you’ll need to work in the standard library.
8989
- [Coding Standards and Style Guide](./stdlib/docs/style-guide.md) provides
9090
guidelines for writing code for the standard library.
9191

92-
### Accepting Open Source PRs
92+
### Accepting open source PRs
9393

9494
To ensure a streamlined process, contributors are encouraged to focus on
9595
enhancements, bug fixes, and optimizations aligned with the library's
@@ -153,7 +153,7 @@ This process is heavily inspired by the process used by several other
153153
open-source projects. We’ll add more documentation in the future as we gain
154154
experience with the process.
155155

156-
## Pull Requests
156+
## Pull requests
157157

158158
You can use a pull request to propose a change or bug fix to the Mojo Standard
159159
Library, Mojo examples, or Mojo documentation. This page gives an overview of
@@ -162,28 +162,122 @@ the process, especially for first-time contributors.
162162
**Note:** Pull requests should be submitted against the `nightly` branch,
163163
which represents the most recent nightly build.
164164

165-
### Pull Request Process
165+
### Pull request process
166166

167-
#### 1. First-time checklist
167+
#### First-time checklist
168168

169169
Before you start your first pull request, please complete this checklist:
170170

171171
- Read this entire contributor guide.
172172
- Read the [Code of Conduct](./CODE_OF_CONDUCT.md).
173173

174-
#### 2. Evaluate and get buy-in on the change
174+
#### Evaluate and get buy-in on the change
175175

176176
We want to be sure that you spend your time efficiently and prepare changes that
177177
aren’t controversial and get stuck in long rounds of reviews. See the sections
178178
on [Contributing to Docs and Examples](#contributing-to-docs-and-examples) and
179-
[Contributing to the Standard Library](#contributing-to-the-standard-library)
179+
[Contributing to the standard library](#contributing-to-the-standard-library)
180180
for more details.
181181

182-
#### 3. Create a pull request
182+
#### Fork and clone the repo
183+
184+
Go to the [Mojo repo](https://github.com/modularml/mojo) and click the fork
185+
button:
186+
187+
![Create Fork](./images/create-fork.png)
188+
189+
Clone your forked repo locally with the command:
190+
191+
```bash
192+
git clone [email protected]:[your-username]/mojo.git
193+
cd mojo
194+
```
195+
196+
Add the upstream remote and fetch it:
197+
198+
```bash
199+
git remote add upstream [email protected]:modularml/mojo.git
200+
git fetch upstream
201+
```
202+
203+
#### Branching off nightly
204+
205+
Make sure to branch off `nightly` to work on your PR:
206+
207+
```bash
208+
git checkout upstream/nightly
209+
git checkout -b my-fix-pr
210+
```
211+
212+
You should periodically make sure you've synced the latest changes, especially
213+
before raising a PR:
214+
215+
```bash
216+
git fetch upstream
217+
git rebase upstream/nightly
218+
```
219+
220+
#### Getting the nightly Mojo compiler
221+
222+
Now that you're on the nightly branch, you need to install the latest nightly
223+
Mojo compiler:
224+
225+
```bash
226+
curl https://get.modular.com | sh -
227+
228+
modular auth
229+
230+
modular install nightly/mojo
231+
```
232+
233+
If you already have an older `nightly/mojo` compiler, replace
234+
`modular install nightly/mojo` with `modular update nightly/mojo`.
235+
236+
Then, follow the instructions from the `modular` tool in adding the `mojo`
237+
compiler to your `PATH` such as:
238+
239+
```bash
240+
echo export MODULAR_HOME="$HOME/.modular" >> ~/.zshrc
241+
echo 'export PATH="$HOME/.modular/pkg/packages.modular.com_nightly_mojo/bin:$PATH"' >> ~/.zshrc
242+
source ~/.zshrc
243+
```
244+
245+
If you're using bash, replace the three `~/.zshrc` above with `~/.bashrc`.
246+
247+
#### Mojo nightly vscode extension
248+
249+
Install the [Mojo nightly VS Code
250+
extension](https://marketplace.visualstudio.com/items?itemName=modular-mojotools.vscode-mojo-nightly):
251+
252+
<img src="./images/nightly-extension.png" width=350 />
253+
254+
You can only have one Mojo extension enabled at a time, remember to switch back
255+
when using the stable release!
256+
257+
#### Create a pull request
183258

184259
If your change is one of the improvements described above or it has been
185260
discussed and agreed upon by the project maintainers, please create a pull
186-
request into the `nightly` branch and include the following:
261+
request into the `nightly` branch.
262+
263+
First push your changes:
264+
265+
```bash
266+
git push -u [your-username] my-fix-pr
267+
```
268+
269+
You'll see a link to create a PR:
270+
271+
```plaintext
272+
remote: Create a pull request for 'my-fix-pr' on GitHub by visiting:
273+
remote: https://github.com/jackos/mojo/pull/new/my-fix-pr
274+
```
275+
276+
Make sure you point it to the `nightly` branch:
277+
278+
![Base Branch](images/base-branch.png)
279+
280+
Now fill out the details:
187281

188282
- A short commit title describing the change.
189283
- A detailed commit description that includes rationalization for the change
@@ -251,7 +345,7 @@ By making a contribution to this project, I certify that:
251345
this project or the open source license(s) involved.
252346
```
253347

254-
### Review Time SLA
348+
### Review time SLA
255349

256350
The team commits to reviewing submitted pull requests within a week of
257351
submission.

README.md

+39-25
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@ and production by combining Python syntax and ecosystem with systems
99
programming and metaprogramming features. Mojo is still young, but it is designed
1010
to become a superset of Python over time.
1111

12-
To use Mojo, you can install the MAX SDK or the standalone Mojo SDK:
13-
14-
- [Get the MAX SDK.](https://docs.modular.com/engine/get-started)
15-
- [Get the Mojo SDK.](https://docs.modular.com/mojo/manual/get-started/)
16-
17-
Then follow the docs to [write your first Mojo
18-
program](https://https://docs.modular.com/mojo/manual/get-started/hello-world).
19-
When you want to report issues or request features, [please create a GitHub
20-
issue here](https://github.com/modularml/mojo/issues). See the [Mojo
21-
Contributor Guide](https://www.notion.so/f527254bc46b4cd3ba4b34bd949d4e57?pvs=21)
22-
for guidelines on filing good bugs.
23-
2412
This repo includes source code for:
2513

2614
- Mojo examples
@@ -30,30 +18,56 @@ This repo includes source code for:
3018
This repo has two primary branches:
3119

3220
- The [`main`](https://github.com/modularml/mojo/tree/main) branch, which is in
33-
sync with the last released version of Mojo. Use the examples here if you’re
34-
using a release build of Mojo.
21+
sync with the last stable released version of Mojo. Use the examples here if you’re
22+
using a [release build of Mojo](#latest-released).
3523

3624
- The [`nightly`](https://github.com/modularml/mojo/tree/nightly) branch, which
3725
is in sync with the Mojo nightly build and subject to breakage. Use this branch
38-
for [contributions](./CONTRIBUTING.md).
26+
for [contributions](./CONTRIBUTING.md), or if you're using the latest
27+
[nightly build of Mojo](#latest-nightly).
28+
29+
To learn more about Mojo, see the
30+
[Mojo Manual](https://docs.modular.com/mojo/manual/).
31+
32+
## Installing Mojo
33+
34+
### Latest Released
35+
36+
To install the last released build of Mojo, you can install the MAX SDK
37+
or the standalone Mojo SDK:
3938

40-
This repo represents the Mojo open source effort. We are continuing to open
41-
parts of the Mojo codebase. The challenge is that we use Mojo pervasively
42-
inside Modular and we need to make sure that community contributions can
43-
proceed smoothly with good build and testing tools that will allow this repo to
44-
become the source of truth (right now it is not). We'll progressively improve
45-
the tools and add more source code over time.
39+
- [Get the MAX SDK](https://docs.modular.com/engine/get-started)
40+
- [Get the Mojo SDK](https://docs.modular.com/mojo/manual/get-started/)
4641

47-
If you’d like to contribute to Mojo, please first read our [Contributor
42+
Then follow the docs to [write your first Mojo
43+
program](https://https://docs.modular.com/mojo/manual/get-started/hello-world).
44+
45+
### Latest Nightly
46+
47+
The nightly Mojo builds are subject to breakage and provide an inside
48+
view of how the development of Mojo is progressing. Use at your own risk
49+
and be patient! Intall them using the instructions [here](./CONTRIBUTING.md).
50+
51+
## Contributing
52+
53+
When you want to report issues or request features, [please create a GitHub
54+
issue here](https://github.com/modularml/mojo/issues).
55+
See [here](./CONTRIBUTING.md) for guidelines on filing good bugs.
56+
57+
We welcome contributions to this repo on the
58+
[`nightly`](https://github.com/modularml/mojo/tree/nightly)
59+
branch. If you’d like to contribute to Mojo, please first read our [Contributor
4860
Guide](https://github.com/modularml/mojo/blob/main/CONTRIBUTING.md).
4961

5062
For more general questions or to chat with other Mojo developers, check out our
5163
[Discord](https://discord.gg/modular).
5264

53-
To learn more about Mojo, see the
54-
[Mojo Manual](https://docs.modular.com/mojo/manual/).
65+
## License
66+
67+
This repository is licensed under the Apache License v2.0 with LLVM Exceptions
68+
(see the LLVM [License](https://llvm.org/LICENSE.txt)).
5569

56-
## Thanks To Our Contributors
70+
## Thanks to our contributors
5771

5872
<a href="https://github.com/modularml/mojo/graphs/contributors">
5973
<img src="https://contrib.rocks/image?repo=modularml/mojo" />

docs/oss-material/CODE_OF_CONDUCT.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Code of Conduct
1+
# Code of conduct
22

33
In the interest of fostering an open and welcoming environment, we as
44
contributors and maintainers pledge to make participation in our project and
@@ -7,7 +7,7 @@ body size, disability, ethnicity, gender identity and expression, level of
77
experience, nationality, personal appearance, race, religion, or sexual
88
identity and orientation.
99

10-
## Our Standards
10+
## Our standards
1111

1212
All community forums and spaces are meant for professional interactions that
1313
are friendly, inclusive, helpful, and collaborative. Examples of behavior that
@@ -32,7 +32,7 @@ participants include:
3232
- Conduct which could reasonably be considered inappropriate for the forum in
3333
which it occurs.
3434

35-
## Our Responsibilities
35+
## Our responsibilities
3636

3737
Project maintainers are responsible for clarifying the standards of acceptable
3838
behavior and are expected to take appropriate and fair corrective action in
160 KB
Loading
175 KB
Loading
114 KB
Loading

stdlib/README.md

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Welcome to the Mojo Standard Library
1+
# Welcome to the Mojo standard library
22

3-
This folder contains the open-source Mojo Standard Library! 🔥
3+
This folder contains the open-source Mojo standard library! 🔥
44

55
We're thrilled to have you join our community of developers eager to build a
66
vibrant and supportive ecosystem. If you just want to *use* the Mojo Standard
@@ -10,7 +10,7 @@ standalone Mojo SDK:
1010
- [Get the MAX SDK.](https://docs.modular.com/engine/get-started)
1111
- [Get the Mojo SDK.](https://docs.modular.com/mojo/manual/get-started/)
1212

13-
## Vision and Roadmap
13+
## Vision and roadmap
1414

1515
We have written down the principles that inform our decisions about what
1616
features we work on and what bugs we prioritize. Before you consider making
@@ -22,28 +22,28 @@ guide our development efforts.
2222
- Our [Roadmap](./docs/roadmap.md) identifies concrete development goals as we
2323
work towards an even more robust and feature-rich standard library.
2424

25-
## Contributing to the Mojo Standard Library
25+
## Contributing to the Mojo standard library
2626

2727
As a contributor, your efforts and expertise are invaluable in driving the
28-
evolution of the Mojo Standard Library. The [Mojo Contributor
29-
Guide](../CONTRIBUTING.md) provides all the information necessary to make
28+
evolution of the Mojo standard library. The [Mojo contributor
29+
guide](../CONTRIBUTING.md) provides all the information necessary to make
3030
meaningful contributions—from understanding the submission process to
3131
adhering to best practices:
3232

33-
- [Mojo Contributor Guide](../CONTRIBUTING.md)
33+
- [Mojo contributor guide](../CONTRIBUTING.md)
3434

35-
## Getting Started
35+
## Getting started
3636

3737
Follow our provided documentation to prepare your environment for building the
3838
standard library, and then test your setup with our automated testing suite.
3939
For additional information, the FAQ page is your go-to resource.
4040

41-
- [Mojo Standard Library Development](./docs/development.md)
41+
- [Mojo standard library development](./docs/development.md)
4242
- [FAQ](./docs/faq.md)
4343

44-
## Code of Conduct
44+
## Code of conduct
4545

46-
[Code of Conduct](../CODE_OF_CONDUCT.md)
46+
[Code of conduct](../CODE_OF_CONDUCT.md)
4747

4848
## License
4949

@@ -55,5 +55,5 @@ See the license file in the repository for more details.
5555

5656
For any inquiries, bug reports, or feature requests, please [open an
5757
issue](https://github.com/modularml/mojo/issues) on the GitHub repository. See
58-
the [Mojo Contributor Guide](../CONTRIBUTING.md) for guidelines on filing good
58+
the [Mojo contributor guide](../CONTRIBUTING.md) for guidelines on filing good
5959
bugs.

0 commit comments

Comments
 (0)