authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:58:06 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-04-18 15:58:06 -07:00
log1d2f8c2a90e8f725069c5ddddc1ee03dc3ea9863
treeb494652ac551e25494aefe7e86a77795101fb547
parenta7a440fd557ba5601a60c8d5a74d2a39e605149d

docs/tutorial- grammar fixes


1 files changed, 7 insertions(+), 5 deletions(-)

docs/tutorial.md+7-5
......@@ -45,11 +45,11 @@ dependencies:
4545 - src: git https://github.com/jecolon/ziglyph
4646```
4747
48Here I assume that you initialized your project with `zig init-exe` or `zig init-lib`, so your `build.zig` the `addExecutable()` or `addStaticLibrary()` call points to `src/main.zig`.
48Here I assume that you initialized your project with `zig init-exe` or `zig init-lib`, so in your `build.zig` the respective `addExecutable()` or `addStaticLibrary()` call points to `src/main.zig`.
4949
5050In this case you can `@import("ziglyph")` in `src/lib.zig`, but not in `src/main.zig`. However you can `@import("my-package")` in `src/main.zig`.
5151
52Please note, that using `zig init-exe` or `zig init-lib` for creating a project does not mean that you have to use `zigmod init` in application or library mode. Creating a `zigmod.yml` file with proper `name` and `main` only makes your package importable by other projects. This is usually not needed with applications, but quite useful in case of libraries; hence the name.
52> Note: using `zig init-exe` or `zig init-lib` for creating a project does not mean that you have to use `zigmod init` in application or library mode. Creating a `zigmod.yml` file with proper `name` and `main` only makes your package importable by other projects. This is usually not needed with applications, but quite useful in case of libraries; hence the name.
5353
5454### Zig and Zigmod package handling explained
5555
......@@ -66,7 +66,7 @@ root
6666
6767`root` can `@import` `A`, `B` and `D`, but `E` can be imported only from `D`. `B` can not import anything. (Everybody can import relative files, this limitation is only for packages.)
6868
69In library `zigmod.yml` example the tree looks like this:
69In the library `zigmod.yml` example from above, the tree looks like this:
7070
7171```
7272root (src/main.zig)
......@@ -78,9 +78,9 @@ root (src/main.zig)
7878
7979It is very important to understand, that `my-package` is _below_ `root`, as `name/main` in `zigmod.yml` will create a separate package (it will not be chained to `root`).
8080
81If you want to use the dependencies from `root`, then make sure that your `zigmod.yml` does _not_ contain a `main` line **and** use `root_dependencies` instead of `dependencies`. This is what `zigmod init` does in application mode.
81If you want to use the dependencies from `root`, then make sure that your `zigmod.yml` lists them under `root_dependencies` instead of `dependencies`.
8282
83On the other hand using `root_dependencies` and `dependencies` is not mutually exclusive, you can take advantage of using both, like zigmod does. Using `dependencies` requires a proper `main` field in your `zigmod.yml`.
83Note: Using `root_dependencies` and `dependencies` is not mutually exclusive, you can take advantage of using both like Zigmod itself does. Using `dependencies` requires a proper `main` field in your `zigmod.yml`.
8484
8585## Running `zigmod fetch`
8686This command will inspect your `zigmod.yml` and download any new dependencies as well as pulling updates for any ones already download. It will recursively do this for your entire tree until it is full constructed which will culminate in the generation of two output files: `deps.zig` and `zigmod.lock`.
......@@ -91,6 +91,8 @@ This command will inspect your `zigmod.yml` and download any new dependencies as
9191
9292Add `--no-update` if you do want it to fetch remote updates and only regenerate `deps.zig`.
9393
94Alternatively, if you want to download updates exactly as defined by the lockfile, use [`zigmod ci`](./commands/ci.md) instead of `zigmod fetch`.
95
9496> Ref: See [`zigmod fetch`](commands/fetch.md) reference for more info.
9597
9698---