mod argv;
mod client;
mod diagnostics;
mod error;
pub mod fingerprint;
mod gate;
mod git;
mod git_env;
mod git_signing;
mod lines;
mod nb_program;
mod output;
pub mod parser;
pub(crate) mod tokenizer;
mod transaction;
mod types;
mod validate;
#[cfg(feature = "testing")]
pub mod testing;
#[cfg(feature = "testing")]
pub use gate::registry_len;
pub use error::{IoError, IoErrorKind, NbError, ParseErrorKind};
pub use fingerprint::{Fingerprint, fingerprint as compute_fingerprint};
pub use git::{derive_git_notebook_name, git_rev_parse};
pub use git_env::{leaked_git_names, scrub_git_env, scrub_git_env_std};
pub use parser::{
BodyFragments, DocumentKind, NoteDocument, ParseContext,
SUPPORTED_DOCUMENT_EXTENSIONS, TagsIter, TagsStrIter, TodoState, parse,
};
pub use transaction::Transaction;
pub use types::{
BodyFragment, BoundaryAt, CommitOutcome, LineAnchor, LineEdit, LineEol,
LinePosition, LineRef, NoteLine, NoteLineHit, NoteTarget, Occurrence,
OpOutcome, SearchNoteLines, ShowNote, ShowNoteLines,
};
use serde::Deserialize;
use std::time::Duration;
#[derive(Clone, Debug)]
pub struct Config {
pub notebook: Option<String>,
pub create_notebook: bool,
pub allow_top_level_notes: bool,
pub disable_git_signing: bool,
pub gate_timeout: Duration,
}
impl Default for Config {
fn default() -> Self {
Self {
notebook: None,
create_notebook: true,
allow_top_level_notes: false,
disable_git_signing: false,
gate_timeout: gate::DEFAULT_GATE_TIMEOUT,
}
}
}
#[derive(Clone)]
pub struct NbClient {
default_notebook: Option<String>,
create_notebook: bool,
disable_git_signing: bool,
allow_top_level_notes: bool,
gate_timeout: Duration,
}
#[derive(Debug, Clone, Copy, Default, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(rename_all = "lowercase")]
pub enum SearchMode {
#[default]
Any,
All,
}
#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
#[serde(rename_all = "lowercase")]
pub enum TaskStatus {
Open,
Closed,
}