Owez / torro

A correct and easy-to-use BitTorrent library
MIT License
9 stars 0 forks source link

Beginner-friendly docs #18

Open Owez opened 4 years ago

Owez commented 4 years ago

More needs to be added to give an introduction for a new user of torro, other than a still quite cryptic First Steps doc.

No time rush for this, just before first public version

Owez commented 4 years ago

Prehaps something like this for the barebones README.md usage subheading:


Usage

use std::path::PathBuf;
use torro::torrent::Torrent;

fn main() {
    let file_path = PathBuf::from("example.torrent");
    let my_torrent = Torrent::from_file(file_path).unwrap();

    // TODO: add more as becomes available
}
Owez commented 4 years ago

Could also make a mdbook-like thing or an extended top-level docs for displaying usages. Need a formalised note on how torrent::Torrent is the reccomended usage but all functions of torro can be done directly with parts like torro::bencode

Owez commented 4 years ago

Prehaps something like this for the barebones README.md usage subheading:

Usage

use std::path::PathBuf;
use torro::torrent::Torrent;

fn main() {
    let file_path = PathBuf::from("example.torrent");
    let my_torrent = Torrent::from_file(file_path).unwrap();

    // TODO: add more as becomes available
}

9dfe7d4d957d3194f3e481748bca77c6f32abeda Added a slightly modified version of this as an example of Torrent::new

Owez commented 4 years ago

Also removed "First Steps" from docs now, was outdated and useless