Skip to content

Commit

Permalink
add docs build commands
Browse files Browse the repository at this point in the history
  • Loading branch information
TroyKomodo committed Jan 13, 2025
1 parent 4459e5e commit 0b7a08b
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 38 deletions.
12 changes: 11 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
mod? local


# By default we use the nightly toolchain, however you can override this by setting the RUST_TOOLCHAIN environment variable.
export RUST_TOOLCHAIN := env_var_or_default('RUST_TOOLCHAIN', 'nightly')

Expand Down Expand Up @@ -29,8 +30,17 @@ test *args:
cargo +{{RUST_TOOLCHAIN}} llvm-cov report --lcov --output-path ./lcov.info
cargo +{{RUST_TOOLCHAIN}} llvm-cov report --html

alias docs := doc
doc *args:
cargo +{{RUST_TOOLCHAIN}} doc --no-deps --all-features {{args}}
# `--cfg docsrs` enables us to write feature hints in the form of `#[cfg_attr(docsrs, doc(cfg(feature = "some-feature")))]`
# `--enable-index-page` makes the command generate an index page which lists all crates (unstable)
# `-D warnings` disallow all warnings
# `-Zunstable-options` enables unstable options (for the `--enable-index-page` flag)
RUSTDOCFLAGS="-D warnings --cfg docsrs --enable-index-page -Zunstable-options" cargo +{{RUST_TOOLCHAIN}} doc --no-deps --all-features {{args}}

alias docs-serve := doc-serve
doc-serve: doc
miniserve target/doc --index index.html --port 3000

deny *args:
cargo +{{RUST_TOOLCHAIN}} deny {{args}} --all-features check
Expand Down
2 changes: 1 addition & 1 deletion crates/av1/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use scuffle_bytes_util::{BitReader, BitWriter, BytesCursorExt};

#[derive(Debug, Clone, PartialEq)]
/// AV1 Codec Configuration Record
/// https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax
/// <https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-syntax>
pub struct AV1CodecConfigurationRecord {
pub seq_profile: u8,
pub seq_level_idx_0: u8,
Expand Down
7 changes: 3 additions & 4 deletions crates/bootstrap/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,15 @@ pub trait Service<Global>: Send + Sync + 'static + Sized {
/// service should stop as soon as the provided context is done.
///
/// Note: Adding the
/// [`scuffle_signal::SignalSvc`](../../scuffle_signal/struct.SignalSvc.
/// html) service to the list of services when calling
/// <a href="../../scuffle_signal/struct.SignalSvc.html">`scuffle_signal::SignalSvc`</a>
/// service to the list of services when calling
/// [`main`](crate::main) will cancel the context as soon as a shutdown
/// signal is received.
///
/// # See Also
///
/// - [`Context`](scuffle_context::Context)
/// - [`scuffle_signal::SignalSvc`](../../scuffle_signal/struct.SignalSvc.
/// html)
/// - <a href="../../scuffle_signal/struct.SignalSvc.html">`scuffle_signal::SignalSvc`</a>
fn run(
self,
global: Arc<Global>,
Expand Down
2 changes: 0 additions & 2 deletions crates/ffmpeg/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

pub mod codec;
pub mod consts;
pub mod decoder;
Expand Down
4 changes: 2 additions & 2 deletions crates/future-ext/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// The [`FutureExt`] trait is a trait that provides a more ergonomic way to
/// extend futures with additional functionality. Similar to the [`IteratorExt`]
/// trait, but for futures.
/// extend futures with additional functionality. Similar to the `IteratorExt`
/// trait from the `itertools` crate, but for futures.
pub trait FutureExt {
/// Attach a timeout to the future.
///
Expand Down
3 changes: 1 addition & 2 deletions crates/h3-webtransport/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
//! # Relevant Links
//! WebTransport: <https://www.w3.org/TR/webtransport/#biblio-web-transport-http3>
//! WebTransport over HTTP/3: <https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3/>
#![deny(missing_docs)]
#![doc = include_str!("../README.md")]
// #![deny(missing_docs)]

/// A WebTransport server
pub mod server;
Expand Down
18 changes: 9 additions & 9 deletions crates/h3-webtransport/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,15 @@ where
},
}

/// A WebTransport server that allows incoming requests to be upgraded to
/// `WebTransportSessions`
///
/// The [`WebTransportServer`] struct manages a connection from the side of the
/// HTTP/3 server
///
/// Create a new Instance with [`WebTransportServer::new()`].
/// Accept incoming requests with [`WebTransportServer::accept()`].
/// And shutdown a connection with [`WebTransportServer::shutdown()`].
// A WebTransport server that allows incoming requests to be upgraded to
// `WebTransportSessions`
//
// The [`WebTransportServer`] struct manages a connection from the side of the
// HTTP/3 server
//
// Create a new Instance with [`WebTransportServer::new()`].
// Accept incoming requests with [`WebTransportServer::accept()`].
// And shutdown a connection with [`WebTransportServer::shutdown()`].
pub struct Connection<C, B>
where
C: quic::Connection<B>,
Expand Down
2 changes: 0 additions & 2 deletions crates/http/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

pub mod backend;
pub mod body;
pub mod builder;
Expand Down
2 changes: 0 additions & 2 deletions crates/metrics/derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

use enum_impl::metric_enum_impl;
use metrics_impl::metrics_impl;
use proc_macro::TokenStream;
Expand Down
2 changes: 0 additions & 2 deletions crates/metrics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

#[cfg(feature = "prometheus")]
/// A copy of the opentelemetry-prometheus crate, updated to work with the
/// latest version of opentelemetry.
Expand Down
2 changes: 1 addition & 1 deletion crates/mp4/src/boxes/types/av01.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::codec::VideoCodec;

#[derive(Debug, Clone, PartialEq)]
/// AV1 Codec Box
/// https://aomediacodec.github.io/av1-isobmff/#av1sampleentry-section
/// <https://aomediacodec.github.io/av1-isobmff/#av1sampleentry-section>
pub struct Av01 {
pub header: BoxHeader,
pub visual_sample_entry: SampleEntry<VisualSampleEntry>,
Expand Down
2 changes: 1 addition & 1 deletion crates/mp4/src/boxes/types/av1c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::boxes::traits::BoxType;

#[derive(Debug, Clone, PartialEq)]
/// AV1 Configuration Box
/// https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-section
/// <https://aomediacodec.github.io/av1-isobmff/#av1codecconfigurationbox-section>
pub struct Av1C {
pub header: BoxHeader,
pub av1_config: AV1CodecConfigurationRecord,
Expand Down
6 changes: 3 additions & 3 deletions crates/mp4/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use scuffle_aac::AudioObjectType;

#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum VideoCodec {
/// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter
/// <https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter>
Avc { profile: u8, constraint_set: u8, level: u8 },
/// There is barely any documentation on this.
/// http://hevcvideo.xp3.biz/html5_video.html
/// <https://hevcvideo.xp3.biz/html5_video.html>
Hevc {
general_profile_space: u8,
profile_compatibility: u32,
Expand All @@ -17,7 +17,7 @@ pub enum VideoCodec {
tier: bool,
constraint_indicator: u64,
},
/// https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#av1
/// <https://developer.mozilla.org/en-US/docs/Web/Media/Formats/codecs_parameter#av1>
Av1 {
profile: u8,
level: u8,
Expand Down
2 changes: 0 additions & 2 deletions crates/postcompile/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

use std::borrow::Cow;
use std::ffi::{OsStr, OsString};
use std::os::unix::ffi::OsStrExt;
Expand Down
2 changes: 0 additions & 2 deletions crates/pprof/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

mod cpu;

#[derive(Debug, thiserror::Error)]
Expand Down
2 changes: 0 additions & 2 deletions crates/settings/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![doc = include_str!("../README.md")]

use std::path::Path;

#[derive(Debug, thiserror::Error)]
Expand Down

0 comments on commit 0b7a08b

Please sign in to comment.