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:...@@ -45,11 +45,11 @@ dependencies:
45 - src: git https://github.com/jecolon/ziglyph45 - src: git https://github.com/jecolon/ziglyph
46```46```
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
50In 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`.50In 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
54### Zig and Zigmod package handling explained54### Zig and Zigmod package handling explained
5555
...@@ -66,7 +66,7 @@ root...@@ -66,7 +66,7 @@ root
6666
67`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.)67`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
71```71```
72root (src/main.zig)72root (src/main.zig)
...@@ -78,9 +78,9 @@ root (src/main.zig)...@@ -78,9 +78,9 @@ root (src/main.zig)
7878
79It 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`).79It 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
85## Running `zigmod fetch`85## Running `zigmod fetch`
86This 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`.86This 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...@@ -91,6 +91,8 @@ This command will inspect your `zigmod.yml` and download any new dependencies as
9191
92Add `--no-update` if you do want it to fetch remote updates and only regenerate `deps.zig`.92Add `--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
94> Ref: See [`zigmod fetch`](commands/fetch.md) reference for more info.96> Ref: See [`zigmod fetch`](commands/fetch.md) reference for more info.
9597
96---98---