Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(iroh): Expand module level documentation in iroh #2463

Merged
merged 8 commits into from
Jul 5, 2024
Merged

Conversation

rklaehn
Copy link
Contributor

@rklaehn rklaehn commented Jul 5, 2024

Description

  • Actually export the second stage buider.
  • Expand the module level docs for iroh and the various client modules.

Breaking Changes

None, I am going to do those in a separate PR

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@rklaehn rklaehn changed the title Documentation fixes docs(iroh): Expand module level documentation in iroh Jul 5, 2024
@rklaehn rklaehn marked this pull request as ready for review July 5, 2024 11:27
Copy link
Member

@Frando Frando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you @rklaehn!

//! There are several ways to export data from the local blob store:
//!
//! - [`read_to_bytes`](Client::read_to_bytes) reads data into memory.
//! - [`read`](Client::read) creates a reader to read data from.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link "reader" to AsyncRead?

//!
//! - [`download`](Client::download) downloads data from a remote node.
//! - [`share`](Client::share)
//! allows creating a ticket to share data with a remote node.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove linebreak

iroh/src/lib.rs Show resolved Hide resolved
iroh/src/client/blobs.rs Show resolved Hide resolved
iroh/src/lib.rs Outdated Show resolved Hide resolved
iroh/src/lib.rs Outdated Show resolved Hide resolved
iroh/src/lib.rs Outdated Show resolved Hide resolved
iroh/src/node.rs Outdated Show resolved Hide resolved
@rklaehn rklaehn enabled auto-merge July 5, 2024 12:37
@rklaehn rklaehn added this pull request to the merge queue Jul 5, 2024
Merged via the queue into main with commit 74e8a6a Jul 5, 2024
25 checks passed
@rklaehn rklaehn deleted the rk/doc-fixes branch July 5, 2024 13:01
//!
//! The main entry point is the [`Client`].
//!
//! ## Interacting with the local blob store
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you supposed to skip the top-level header? I think I've always seen # as the first header indentation.

//!
//! There are several ways to import data into the local blob store:
//!
//! - [`add_bytes`](Client::add_bytes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have written this as `[`Client::add_bytes`]` directly. The style guide is also not really in favour of writing the links inline and prefers them via references.

//! There are several ways to export data from the local blob store:
//!
//! - [`read_to_bytes`](Client::read_to_bytes) reads data into memory.
//! - [`read`](Client::read) creates a [reader](Reader) to read data from.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
//! - [`read`](Client::read) creates a [reader](Reader) to read data from.
//! - [`read`](Client::read) creates a [`Reader`] to read data from.

This would make more clear that you're linking directly to a type which I usually prefer. That's just my personal preference though, no written rule.


//!
//! The purpose of tags is to mark information as important. Currently this is
//! used for blobs.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it described anywhere how this is used for blobs? Why not give a short description here as an example that gives a general idea of how tags are used?

//! available over the network.
//!
//! ```rust
//! # async fn run() -> anyhow::Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wait, what? We can just write async fn in doc tests and it'll work? How did I now know that?

//!
//! ### Iroh node
//!
//! To create an iroh [Node](crate::node::Node), you use the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style-guide prefers reference-style links rather than inline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants