mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Auto-generate markdown command docs (#4451)
* Finish updating * a couple improvements * Update renames * cleanup examples
This commit is contained in:
@ -894,6 +894,29 @@ pub fn eval_variable(
|
||||
span,
|
||||
});
|
||||
|
||||
cols.push("examples".to_string());
|
||||
vals.push(Value::List {
|
||||
vals: decl
|
||||
.examples()
|
||||
.into_iter()
|
||||
.map(|x| Value::Record {
|
||||
cols: vec!["description".into(), "example".into()],
|
||||
vals: vec![
|
||||
Value::String {
|
||||
val: x.description.to_string(),
|
||||
span,
|
||||
},
|
||||
Value::String {
|
||||
val: x.example.to_string(),
|
||||
span,
|
||||
},
|
||||
],
|
||||
span,
|
||||
})
|
||||
.collect(),
|
||||
span,
|
||||
});
|
||||
|
||||
cols.push("is_binary".to_string());
|
||||
vals.push(Value::Bool {
|
||||
val: decl.is_binary(),
|
||||
|
Reference in New Issue
Block a user