pub struct AppSettings {Show 26 fields
pub port_mode: PortMode,
pub port: u16,
pub host: String,
pub theme: String,
pub language: String,
pub web_theme: String,
pub web_language: String,
pub db_path: Option<String>,
pub salt: String,
pub workspaces: Vec<WorkspaceSettings>,
pub tray_resident: bool,
pub default_search: bool,
pub default_viewed: bool,
pub default_live: bool,
pub default_edit: bool,
pub default_chat: bool,
pub default_chat_mode: String,
pub default_shared_annotation: bool,
pub print_collapsed_content: bool,
pub chat: ChatSettings,
pub web_styles: HashMap<String, String>,
pub shortcuts: HashMap<String, Value>,
pub auto_update: bool,
pub update_channel: String,
pub window_width: Option<u32>,
pub window_height: Option<u32>,
}Fields§
§port_mode: PortMode§port: u16§host: String§theme: String§language: String§web_theme: String§web_language: String§db_path: Option<String>§salt: StringPer-install random salt for workspace-id hashing. Empty on first run;
load() lazily generates one and persists it. Keeping it stable across
restarts means bookmarked workspace URLs survive; randomizing per install
means the URL is not derivable from the file path alone.
workspaces: Vec<WorkspaceSettings>§tray_resident: bool§default_search: bool§default_viewed: bool§default_live: bool§default_edit: bool§default_chat: bool§default_chat_mode: StringDefault chat surface form: “in_page” (floating panel embedded in the markdown view) or “popout” (a standalone window opened via window.open). Drives: • sphere click → expand panel vs spawn popout • selection chat button → quote into in-page chat vs popout • TOGGLE_CHAT shortcut In every case Shift inverts the choice for that single click/press.
print_collapsed_content: boolWhen false (default), <details>-style collapsed sections are hidden
in print and replaced by a small placeholder; when true the collapsed
content is forced visible so it shows up in the printed output.
chat: ChatSettings§web_styles: HashMap<String, String>§shortcuts: HashMap<String, Value>§auto_update: bool§update_channel: String§window_width: Option<u32>§window_height: Option<u32>Implementations§
Source§impl AppSettings
impl AppSettings
pub fn load() -> Self
pub fn save(&self) -> Result<(), String>
pub fn to_server_config(&self, port: u16) -> ServerConfig
pub fn effective_web_language(&self) -> Option<String>
Sourcepub fn persist_hook(settings: Arc<Mutex<AppSettings>>) -> PersistHook
pub fn persist_hook(settings: Arc<Mutex<AppSettings>>) -> PersistHook
Build a registry persist-hook that mirrors every registry mutation
back into the shared AppSettings and writes to disk. CLI daemon and
GUI both wire this so workspace changes initiated from either side
end up with the same persistent state.
pub fn render_shortcuts_json(&self) -> Option<String>
Sourcepub fn render_styles_css(&self) -> Option<String>
pub fn render_styles_css(&self) -> Option<String>
Render web_styles (GUI-supplied overrides) as a complete CSS block
targeting the --markon-* design tokens defined in editor.css.
Storage convention from the GUI panel (STYLE_DEFS in index.html):
• duo-color entries are keyed <base>.light / <base>.dark
(e.g. primary.light, muted.dark)
• single-value entries are keyed by the bare token name
(ui-font, ui-font-size, panel-opacity)
Routing rules:
• <base>.light → :root as --markon-<base>
• <base>.dark → html[data-theme="dark"] as --markon-<base>
• bare key → :root as --markon-<key>
• unknown suffix (anything other than .light/.dark) is treated
as a single value and routed to :root so malformed/legacy
storage doesn’t panic.
Selector blocks are emitted in a fixed order — :root first, then
the dark override — so callers/tests get stable framing even though
HashMap iteration over individual properties is unordered.
Returns None when neither selector would have any content.
Trait Implementations§
Source§impl Clone for AppSettings
impl Clone for AppSettings
Source§fn clone(&self) -> AppSettings
fn clone(&self) -> AppSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AppSettings
impl Debug for AppSettings
Source§impl Default for AppSettings
impl Default for AppSettings
Source§impl<'de> Deserialize<'de> for AppSettingswhere
AppSettings: Default,
impl<'de> Deserialize<'de> for AppSettingswhere
AppSettings: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AppSettings
impl RefUnwindSafe for AppSettings
impl Send for AppSettings
impl Sync for AppSettings
impl Unpin for AppSettings
impl UnsafeUnpin for AppSettings
impl UnwindSafe for AppSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more