mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-25 01:58:51 +02:00
feat(config): reduce noise in jsonschema output
This commit is contained in:
4
justfile
4
justfile
@@ -50,3 +50,7 @@ deadlock $RUST_LOG="trace":
|
|||||||
docgen:
|
docgen:
|
||||||
komorebic docgen
|
komorebic docgen
|
||||||
Get-ChildItem -Path "docs/cli" -Recurse -File | ForEach-Object { (Get-Content $_.FullName) -replace 'Usage: ', 'Usage: komorebic.exe ' | Set-Content $_.FullName }
|
Get-ChildItem -Path "docs/cli" -Recurse -File | ForEach-Object { (Get-Content $_.FullName) -replace 'Usage: ', 'Usage: komorebic.exe ' | Set-Content $_.FullName }
|
||||||
|
|
||||||
|
schemagen:
|
||||||
|
komorebic static-config-schema > schema.json
|
||||||
|
generate-schema-doc .\schema.json --config template_name=js_offline --config minify=false .\static-config-docs\
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ use color_eyre::Result;
|
|||||||
use miow::pipe::connect;
|
use miow::pipe::connect;
|
||||||
use net2::TcpStreamExt;
|
use net2::TcpStreamExt;
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
|
use schemars::gen::SchemaSettings;
|
||||||
use schemars::schema_for;
|
use schemars::schema_for;
|
||||||
use uds_windows::UnixStream;
|
use uds_windows::UnixStream;
|
||||||
|
|
||||||
@@ -1311,7 +1312,14 @@ impl WindowManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
SocketMessage::StaticConfigSchema => {
|
SocketMessage::StaticConfigSchema => {
|
||||||
let socket_message = schema_for!(StaticConfig);
|
let settings = SchemaSettings::default().with(|s| {
|
||||||
|
s.option_nullable = false;
|
||||||
|
s.option_add_null_type = false;
|
||||||
|
s.inline_subschemas = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
let gen = settings.into_generator();
|
||||||
|
let socket_message = gen.into_root_schema_for::<StaticConfig>();
|
||||||
let schema = serde_json::to_string_pretty(&socket_message)?;
|
let schema = serde_json::to_string_pretty(&socket_message)?;
|
||||||
let socket = DATA_DIR.join("komorebic.sock");
|
let socket = DATA_DIR.join("komorebic.sock");
|
||||||
|
|
||||||
|
|||||||
@@ -231,6 +231,7 @@ impl From<&Monitor> for MonitorConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
|
#[derive(Debug, Serialize, Deserialize, JsonSchema)]
|
||||||
|
/// The `komorebi.json` static configuration file reference for `v0.1.20`
|
||||||
pub struct StaticConfig {
|
pub struct StaticConfig {
|
||||||
/// Dimensions of Windows' own invisible borders; don't set these yourself unless you are told to
|
/// Dimensions of Windows' own invisible borders; don't set these yourself unless you are told to
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
@@ -257,10 +258,12 @@ pub struct StaticConfig {
|
|||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub app_specific_configuration_path: Option<PathBuf>,
|
pub app_specific_configuration_path: Option<PathBuf>,
|
||||||
/// DEPRECATED from v0.1.19: use active_window_border_width instead
|
/// DEPRECATED from v0.1.19: use active_window_border_width instead
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[schemars(skip)]
|
||||||
|
#[serde(skip_serializing)]
|
||||||
pub border_width: Option<i32>,
|
pub border_width: Option<i32>,
|
||||||
/// DEPRECATED from v0.1.19: use active_window_border_offset instead
|
/// DEPRECATED from v0.1.19: use active_window_border_offset instead
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[schemars(skip)]
|
||||||
|
#[serde(skip_serializing)]
|
||||||
pub border_offset: Option<Rect>,
|
pub border_offset: Option<Rect>,
|
||||||
/// Width of the active window border (default: 20)
|
/// Width of the active window border (default: 20)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
@@ -283,8 +286,9 @@ pub struct StaticConfig {
|
|||||||
/// Monitor and workspace configurations
|
/// Monitor and workspace configurations
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub monitors: Option<Vec<MonitorConfig>>,
|
pub monitors: Option<Vec<MonitorConfig>>,
|
||||||
/// Always send the ALT key when using focus commands (default: false)
|
/// DEPRECATED from v0.1.20: no longer required
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[schemars(skip)]
|
||||||
|
#[serde(skip_serializing)]
|
||||||
pub alt_focus_hack: Option<bool>,
|
pub alt_focus_hack: Option<bool>,
|
||||||
/// Which Windows signal to use when hiding windows (default: minimize)
|
/// Which Windows signal to use when hiding windows (default: minimize)
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
|||||||
@@ -50,7 +50,8 @@ nav:
|
|||||||
- Getting started:
|
- Getting started:
|
||||||
- Installation: installation.md
|
- Installation: installation.md
|
||||||
- Example configurations: example-configurations.md
|
- Example configurations: example-configurations.md
|
||||||
- Configuration reference: https://komorebi.lgug2z.com/schema
|
- Configuration:
|
||||||
|
- JSONSchema reference: https://komorebi.lgug2z.com/schema
|
||||||
- CLI reference:
|
- CLI reference:
|
||||||
- cli/quickstart.md
|
- cli/quickstart.md
|
||||||
- cli/start.md
|
- cli/start.md
|
||||||
|
|||||||
1098
schema.json
1098
schema.json
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user