Don't rely on relative path for docs preprocessor (#16883)

Reapplies #16700 with a corrected command. Now it no longer relies on a
relative path.

Thanks @maxdeviant for the quick help 🙏 

Release Notes:

- N/A
This commit is contained in:
Nate Butler 2024-08-26 11:43:13 -04:00 committed by GitHub
parent a87076e815
commit 7a964ff91a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 639 additions and 24 deletions

View file

@ -22,10 +22,34 @@ pub struct KeymapBlock {
bindings: BTreeMap<String, KeymapAction>,
}
impl KeymapBlock {
pub fn context(&self) -> Option<&str> {
self.context.as_deref()
}
pub fn bindings(&self) -> &BTreeMap<String, KeymapAction> {
&self.bindings
}
}
#[derive(Debug, Deserialize, Default, Clone)]
#[serde(transparent)]
pub struct KeymapAction(Value);
impl ToString for KeymapAction {
fn to_string(&self) -> String {
match &self.0 {
Value::String(s) => s.clone(),
Value::Array(arr) => arr
.iter()
.map(|v| v.to_string())
.collect::<Vec<_>>()
.join(", "),
_ => self.0.to_string(),
}
}
}
impl JsonSchema for KeymapAction {
fn schema_name() -> String {
"KeymapAction".into()
@ -135,6 +159,10 @@ impl KeymapFile {
serde_json::to_value(root_schema).unwrap()
}
pub fn blocks(&self) -> &[KeymapBlock] {
&self.0
}
}
fn no_action() -> Box<dyn gpui::Action> {