From bd977b789b1b6c9594e2cdc7634d90b7fc469798 Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Thu, 30 May 2024 18:19:01 +0200 Subject: [PATCH] docs: Add readme to doc.rs pages and fix doc lints --- pueue/README.md | 7 +++++++ pueue/src/client/cli.rs | 4 ++-- pueue/src/lib.rs | 2 +- pueue_lib/README.md | 21 ++++++++------------- pueue_lib/src/lib.rs | 12 +----------- pueue_lib/src/network/message.rs | 4 ++-- pueue_lib/src/network/mod.rs | 2 +- 7 files changed, 22 insertions(+), 30 deletions(-) create mode 100644 pueue/README.md diff --git a/pueue/README.md b/pueue/README.md new file mode 100644 index 00000000..cbfe5069 --- /dev/null +++ b/pueue/README.md @@ -0,0 +1,7 @@ +# Pueue + +These are the internal library files that **shouldn't** be used by anything but `pueue` itself. + +If you're looking for a way to install the `pueue` binaries, please refer to [Pueue's crates.io page](https://crates.io/crates/pueue) or the [Github repository](https://github.com/nukesor/pueue). + +If you're looking for a way to programatically interface with `pueue` via Rust code, please take a look at the [`pueue_lib`](https://docs.rs/pueue-lib/latest/pueue_lib/) diff --git a/pueue/src/client/cli.rs b/pueue/src/client/cli.rs index 323f71fd..10e2f98e 100644 --- a/pueue/src/client/cli.rs +++ b/pueue/src/client/cli.rs @@ -45,7 +45,7 @@ pub enum SubCommand { #[arg(short, long, conflicts_with = "immediate")] stashed: bool, - /// Prevents the task from being enqueued until elapses. See "enqueue" for accepted formats. + /// Prevents the task from being enqueued until 'delay' elapses. See "enqueue" for accepted formats. #[arg(name = "delay", short, long, conflicts_with = "immediate", value_parser = parse_delay_until)] delay_until: Option>, @@ -126,7 +126,7 @@ pub enum SubCommand { /// Enqueue these specific tasks. task_ids: Vec, - /// Delay enqueuing these tasks until elapses. See DELAY FORMAT below. + /// Delay enqueuing these tasks until 'delay' elapses. See DELAY FORMAT below. #[arg(name = "delay", short, long, value_parser = parse_delay_until)] delay_until: Option>, }, diff --git a/pueue/src/lib.rs b/pueue/src/lib.rs index 7b01d7b9..cf44ecbe 100644 --- a/pueue/src/lib.rs +++ b/pueue/src/lib.rs @@ -1,6 +1,6 @@ // This lint is generating way too many false-positives. // Ignore it for now. #![allow(clippy::assigning_clones)] - +#![doc = include_str!("../README.md")] pub mod client; pub mod daemon; diff --git a/pueue_lib/README.md b/pueue_lib/README.md index 77e3d6d5..4dd84cfd 100644 --- a/pueue_lib/README.md +++ b/pueue_lib/README.md @@ -1,23 +1,18 @@ # Pueue-lib -[![GitHub Actions Workflow](https://github.com/nukesor/pueue/workflows/Test%20build/badge.svg)](https://github.com/Nukesor/pueue/actions) +[![Test Build](https://github.com/Nukesor/pueue/actions/workflows/test.yml/badge.svg)](https://github.com/Nukesor/pueue/actions/workflows/test.yml) [![Crates.io](https://img.shields.io/crates/v/pueue-lib)](https://crates.io/crates/pueue-lib) [![docs](https://docs.rs/pueue-lib/badge.svg)](https://docs.rs/pueue-lib/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) - This is the shared library used by the [Pueue](https://github.com/nukesor/pueue/) client and daemon. -It can also be used by third-party software to, for instance, to communicate with the Pueue daemon. - -## Contributing - -Feature requests and pull requests are very much appreciated and welcome! - -Anyhow, please talk to me a bit about your ideas before you start hacking! -It's always nice to know what you're working on and I might have a few suggestions or tips :) - -There's also the [Architecture Guide](https://github.com/Nukesor/pueue/blob/main/ARCHITECTURE.md), which is supposed to give you a brief overview and introduction to the project. +It contains common components such as: -Copyright © 2019-2022 Arne Beer ([@Nukesor](https://github.com/Nukesor)) +- Everything about the [Task](task::Task), [TaskResult](task::TaskResult) etc. +- The [State](state::State), which represents the current state of the daemon. +- Network code. Everything you need to communicate with the daemon. +- Other helper code and structs. +Pueue-lib is a stand-alone crate, so it can be used by third-party applications to either +manipulate or monitor the daemon or to simply write your own front-end for the daemon. diff --git a/pueue_lib/src/lib.rs b/pueue_lib/src/lib.rs index ef7e1fef..1c4eee38 100644 --- a/pueue_lib/src/lib.rs +++ b/pueue_lib/src/lib.rs @@ -1,14 +1,4 @@ -//! Pueue-lib is a shared library used by the `pueue` and `pueued` binary. -//! -//! It contains common components such as: -//! -//! - Everything about the [Task](task::Task), [TaskResult](task::TaskResult) etc. -//! - The [State](state::State), which represents the current state of the daemon. -//! - Network code. Everything you need to communicate with the daemon. -//! - Other helper code and structs. -//! -//! Pueue-lib is a stand-alone crate, so it can be used by third-party applications to either -//! manipulate or monitor the daemon or to simply write your own front-end for the daemon. +#![doc = include_str!("../README.md")] /// Shared module for internal logic! /// Contains helper for command aliasing. diff --git a/pueue_lib/src/network/message.rs b/pueue_lib/src/network/message.rs index a62a1af6..910deabd 100644 --- a/pueue_lib/src/network/message.rs +++ b/pueue_lib/src/network/message.rs @@ -168,7 +168,7 @@ pub struct TaskToRestart { pub path: Option, /// Restart the task with an updated label. pub label: Option, - /// Cbor cannot represent Option> yet, which is why we have to utilize a + /// Cbor cannot represent `Option>` yet, which is why we have to utilize a /// boolean to indicate that the label should be released, rather than an `Some(None)`. pub delete_label: bool, /// Restart the task with an updated priority. @@ -236,7 +236,7 @@ pub struct EditMessage { pub command: Option, pub path: Option, pub label: Option, - /// Cbor cannot represent Option> yet, which is why we have to utilize a + /// Cbor cannot represent `Option>` yet, which is why we have to utilize a /// boolean to indicate that the label should be released, rather than an `Some(None)`. pub delete_label: bool, pub priority: Option, diff --git a/pueue_lib/src/network/mod.rs b/pueue_lib/src/network/mod.rs index 9ca2c7b5..15f8d5cc 100644 --- a/pueue_lib/src/network/mod.rs +++ b/pueue_lib/src/network/mod.rs @@ -21,7 +21,7 @@ //! serialization and deserialization for you. //! //! The payloads itself are defined via the `Message` enum that can be found in the -//! [message](crate::network::message) module. +//! crate::network::message module. //! //! The serialization/deserialization format that's used by `pueue_lib` is `cbor`. //!