Skip to content

Commit 40cb3be

Browse files
committed
remove duplicate introduciton, describe the project layout.
1 parent 32a722a commit 40cb3be

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

README.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11

22
# Triangle From Scratch
33

4-
This is an educational series about drawing a triangle without using any outside crates.
4+
## This Is A Tutorial Repository
55

6-
Specifically, the rules are:
6+
Feel free to look at the source code,
7+
but the crate is not on crates.io,
8+
and the majority of the project's "value" is in the mdbook articles that explain what's going on.
79

8-
1) We can only put a crate into the `[dependencies]` section of `Cargo.toml` if it's a crate that we wrote ourselves, as part of this project.
9-
2) We **can** still use Rust's standard library. Since all Rust programs can import from the standard library without a `[dependencies]` entry, it's fair game.
10+
[You Can Read The Book On The GitHub Pages Site](https://rust-tutorials.github.io/triangle-from-scratch/)
1011

11-
Without any external crates, we'll have to write our own operating system bindings.
12-
It's not difficult code to write, there's just a lot of background details you need to understand first.
13-
That's where most of our focus will go, on learning how that works.
14-
There's a lot less focus spent on the literal "triangle drawing" part, which is usually fairly easy.
12+
## Project Organization
1513

16-
Expected subjects include:
14+
The `book_src/` contains the files to build the mdbook (`cargo install mdbook && mdbook build --open`).
1715

18-
* Reading OS documentation (which usually assumes you're programming in C).
19-
* Understanding the C header files that describe the OS's public API.
20-
* Writing appropriate "raw" Rust bindings to that public API.
21-
* Creating ergonomic wrapper functions to make the API easily used with the rest of Rust.
22-
* Having those wrapper functions be fully safe (in the Rust sense) when possible, or at least making them as error-proof as we can.
16+
The `examples/` folder is an "archive" of completed, runnable examples based on the mdbook chapters.
2317

24-
**Reminder:** The "absolutely no dependencies" thing is for demonstration purposes only.
25-
If you actually want to draw a triangle within a reasonable amount of development time, please do feel free to use dependencies.
26-
Depending on what you need to do, there's generally many good crates available.
18+
The crate's library portion (`src/lib.rs`, and sub-modules) contains the most easily reused code,
19+
based on work shown in the the mdbook chapters.
20+
21+
The crate's binary portion (`src/main.rs`) is just scratch space.
22+
This is so that you can most easily use `cargo run` to test things out when doing work.
23+
The actual content of `main.rs` at any given moment is unimportant.
24+
All the valuable code is kept as an `example/` file when a tutorial chapter is completed.
2725

2826
## Licensing and Contribution
2927

0 commit comments

Comments
 (0)