1mod argv;
16mod client;
17mod diagnostics;
18mod error;
19pub mod fingerprint;
20mod gate;
21mod git;
22mod git_env;
23mod git_signing;
24mod lines;
25mod native;
26mod nb_program;
27mod output;
28pub mod parser;
29pub(crate) mod scope;
30pub(crate) mod tokenizer;
31mod transaction;
32mod types;
33mod validate;
34
35#[cfg(feature = "testing")]
36pub mod testing;
37
38#[cfg(feature = "testing")]
39pub use gate::registry_len;
40
41pub use error::{IoError, IoErrorKind, NbError, ParseErrorKind};
42pub use fingerprint::{Fingerprint, fingerprint as compute_fingerprint};
43pub use git::{derive_git_notebook_name, git_rev_parse};
44pub use git_env::{leaked_git_names, scrub_git_env, scrub_git_env_std};
45pub use parser::{
46 BodyFragments, DocumentKind, NoteDocument, ParseContext,
47 SUPPORTED_DOCUMENT_EXTENSIONS, TagsIter, TagsStrIter, TodoState, parse,
48};
49pub use transaction::Transaction;
50pub use types::{
51 BodyFragment, BoundaryAt, Classify, CommitOutcome, EntityKind, KindSet,
52 LineAnchor, LineEdit, LineEol, LinePosition, LineRef, ListEntry, NoteLine,
53 NoteLineHit, NoteTarget, Occurrence, OpOutcome, SearchNoteLines, ShowNote,
54 ShowNoteLines, TodoSummary,
55};
56
57use serde::Deserialize;
58use std::time::Duration;
59
60#[derive(Clone, Debug)]
65pub struct Config {
66 pub notebook: Option<String>,
68 pub create_notebook: bool,
70 pub allow_top_level_notes: bool,
72 pub disable_git_signing: bool,
74 pub gate_timeout: Duration,
76}
77
78impl Default for Config {
79 fn default() -> Self {
80 Self {
81 notebook: None,
82 create_notebook: true,
83 allow_top_level_notes: false,
84 disable_git_signing: false,
85 gate_timeout: gate::DEFAULT_GATE_TIMEOUT,
86 }
87 }
88}
89
90#[derive(Clone)]
92pub struct NbClient {
93 default_notebook: Option<String>,
95 create_notebook: bool,
97 disable_git_signing: bool,
99 allow_top_level_notes: bool,
101 gate_timeout: Duration,
103}
104
105#[derive(Debug, Clone, Copy, Default, Deserialize, PartialEq, Eq)]
107#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
108#[serde(rename_all = "lowercase")]
109pub enum SearchMode {
110 #[default]
112 Any,
113 All,
115}
116
117#[derive(Debug, Clone, Copy, Deserialize, PartialEq, Eq)]
119#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
120#[serde(rename_all = "lowercase")]
121pub enum TaskStatus {
122 Open,
124 Closed,
126}