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