Try to fix the docs.rs build (#682)

* Exclude the clipboard feature for docs.rs builds

The 0.27.0 docs.rs build failed as the `xcb` crate build.rs failed in
the docs.rs sandbox.

Exclude the clipboard feature for now and only enable:
- `bashisms`
- `external_printer`
- `sqlite` (should be pretty similar to `sqlite-dynlib`)

* Fix hyperlink formatting

* Manually mention required features
This commit is contained in:
Stefan Holderbach 2023-12-14 18:38:13 +01:00 committed by GitHub
parent 63139b84fc
commit ea83904b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 8 deletions

View File

@ -56,4 +56,5 @@ required-features = ["external_printer"]
[package.metadata.docs.rs]
# Whether to pass `--all-features` to Cargo (default: false)
all-features = true
all-features = false
features = ["bashisms", "external_printer", "sqlite"]

View File

@ -67,7 +67,7 @@ impl ParsedViSequence {
///
/// ### Note:
///
/// https://github.com/vim/vim/blob/140f6d0eda7921f2f0b057ec38ed501240903fc3/runtime/doc/motion.txt#L64-L70
/// <https://github.com/vim/vim/blob/140f6d0eda7921f2f0b057ec38ed501240903fc3/runtime/doc/motion.txt#L64-L70>
fn total_multiplier(&self) -> usize {
self.multiplier.unwrap_or(1) * self.count.unwrap_or(1)
}

View File

@ -254,7 +254,7 @@ impl Reedline {
/// You can check for that with [`crate::kitty_protocol_available`]
/// `Reedline` will perform this check internally
///
/// Read more: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
/// Read more: <https://sw.kovidgoyal.net/kitty/keyboard-protocol/>
pub fn use_kitty_keyboard_enhancement(mut self, enable: bool) -> Self {
self.kitty_protocol.set(enable);
self
@ -1697,6 +1697,9 @@ impl Reedline {
}
/// Adds an external printer
///
/// ## Required feature:
/// `external_printer`
#[cfg(feature = "external_printer")]
pub fn with_external_printer(mut self, printer: ExternalPrinter<String>) -> Self {
self.external_printer = Some(printer);

View File

@ -17,6 +17,9 @@ pub const EXTERNAL_PRINTER_DEFAULT_CAPACITY: usize = 20;
/// An ExternalPrinter allows to print messages of text while editing a line.
/// The message is printed as a new line, the line-edit will continue below the
/// output.
///
/// ## Required feature:
/// `external_printer`
#[cfg(feature = "external_printer")]
#[derive(Debug, Clone)]
pub struct ExternalPrinter<T>

View File

@ -98,8 +98,9 @@ pub struct HistoryItem<ExtraInfo: HistoryItemExtraInfo = IgnoreAllExtraInfo> {
/// the exit status of the command
pub exit_status: Option<i64>,
/// arbitrary additional information that might be interesting
/// NOTE: this attribute is required because of https://github.com/rust-lang/rust/issues/41617
/// (see https://github.com/serde-rs/serde/issues/1296#issuecomment-394056188 for the fix)
/// NOTE: this attribute is required because of
/// <https://github.com/rust-lang/rust/issues/41617>
/// (see <https://github.com/serde-rs/serde/issues/1296#issuecomment-394056188> for the fix)
#[serde(deserialize_with = "Option::<ExtraInfo>::deserialize")]
pub more_info: Option<ExtraInfo>,
}

View File

@ -14,6 +14,9 @@ const SQLITE_APPLICATION_ID: i32 = 1151497937;
/// A history that stores the values to an SQLite database.
/// In addition to storing the command, the history can store an additional arbitrary HistoryEntryContext,
/// to add information such as a timestamp, running directory, result...
///
/// ## Required feature:
/// `sqlite` or `sqlite-dynlib`
pub struct SqliteBackedHistory {
db: rusqlite::Connection,
session: Option<HistorySessionId>,

View File

@ -2,7 +2,7 @@ use crossterm::{event, execute};
/// Helper managing proper setup and teardown of bracketed paste mode
///
/// https://en.wikipedia.org/wiki/Bracketed-paste
/// <https://en.wikipedia.org/wiki/Bracketed-paste>
#[derive(Default)]
pub(crate) struct BracketedPasteGuard {
enabled: bool,

View File

@ -11,7 +11,7 @@ use crossterm::{event, execute};
/// * [kakoune text editor](https://github.com/mawww/kakoune/issues/4103)
/// * [dte text editor](https://gitlab.com/craigbarnes/dte/-/issues/138)
///
/// Refer to https://sw.kovidgoyal.net/kitty/keyboard-protocol/ if you're curious.
/// Refer to <https://sw.kovidgoyal.net/kitty/keyboard-protocol/> if you're curious.
#[derive(Default)]
pub(crate) struct KittyProtocolGuard {
enabled: bool,

View File

@ -3,7 +3,7 @@ pub(crate) mod kitty;
/// Return if the terminal supports the kitty keyboard enhancement protocol
///
/// Read more: https://sw.kovidgoyal.net/kitty/keyboard-protocol/
/// Read more: <https://sw.kovidgoyal.net/kitty/keyboard-protocol/>
///
/// SIDE EFFECT: Touches the terminal file descriptors
pub fn kitty_protocol_available() -> bool {