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

[WIP] Documenting anathema #55

Merged
merged 16 commits into from
Aug 31, 2024
Merged

[WIP] Documenting anathema #55

merged 16 commits into from
Aug 31, 2024

Conversation

FishingHacks
Copy link
Contributor

I've taken up the task of documenting most of anathema. Any critique is welcomed. Note: I use everywhere rustdoc-style comments (///) except for internal api information on public api, as it is not very relevant. I use normal comments (//) for those.

@togglebyte togglebyte force-pushed the dev branch 3 times, most recently from 1671736 to 4e431e5 Compare August 31, 2024 19:22
fn clear(&mut self);

/// Finalizes the backend. This is called just before we start running the anathema main loop.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
/// Finalizes the backend. This is called just before we start running the anathema main loop.
/// Finalizes the backend. This is called when the runtime starts.

/// Finalizes the backend. This is called just before we start running the anathema main loop.
/// This should set the terminal in a state where its usable for the tui, for example by enabling events.
///
/// There is no guarantee that other functions will be called before this. They should not cause a panic.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
/// There is no guarantee that other functions will be called before this. They should not cause a panic.

fn clear(&mut self);

/// Finalizes the backend. This is called just before we start running the anathema main loop.
/// This should set the terminal in a state where its usable for the tui, for example by enabling events.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
/// This should set the terminal in a state where its usable for the tui, for example by enabling events.

@@ -38,25 +38,29 @@ pub struct TuiBackendBuilder {
}

impl TuiBackendBuilder {
/// Enable alt screen
// Note: This will only apply when TuiBackend::finalize is called.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
// Note: This will only apply when TuiBackend::finalize is called.

Comment on lines 48 to 49
// Note: This will only apply when TuiBackend::finalize is called.
/// Enable mouse support. This won't apply until Runtime::run is called.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
// Note: This will only apply when TuiBackend::finalize is called.
/// Enable mouse support. This won't apply until Runtime::run is called.
/// Enable mouse support.

anathema-backend/src/tui/screen.rs Outdated Show resolved Hide resolved
@@ -74,6 +77,10 @@ impl<T> RuntimeBuilder<T> {
Ok(id.into())
}

/// Registers a [Component] as a prototype to the [Runtime], which allows the usage of multiple instances of the component in the templates.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
/// Registers a [Component] as a prototype to the [Runtime], which allows the usage of multiple instances of the component in the templates.
/// Registers a [Component] as a prototype with the [Runtime], which allows the usage of multiple instances of the component in the templates.

@@ -74,6 +77,10 @@ impl<T> RuntimeBuilder<T> {
Ok(id.into())
}

/// Registers a [Component] as a prototype to the [Runtime], which allows the usage of multiple instances of the component in the templates.
/// This is useful if you want to reuse the component (Such as an input or button component) or if you use your component in if-blocks or for loops.
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
/// This is useful if you want to reuse the component (Such as an input or button component) or if you use your component in if-blocks or for loops.
/// This is useful for reuse of components.

anathema-runtime/src/lib.rs Outdated Show resolved Hide resolved
anathema-backend/src/lib.rs Outdated Show resolved Hide resolved
@togglebyte togglebyte merged commit 637c38d into togglebyte:dev Aug 31, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants