From 24ee381fea9e4d58b20d769f5f1af85f7b8ba60f Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Wed, 15 Mar 2023 13:21:48 +0100 Subject: [PATCH] Fix xml docs (#8462) See https://github.com/nushell/nushell.github.io/pull/828 --- crates/nu-command/src/formats/from/xml.rs | 8 ++++---- crates/nu-command/src/formats/to/xml.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/nu-command/src/formats/from/xml.rs b/crates/nu-command/src/formats/from/xml.rs index 8dd5c1949f..0fb80f6e0b 100644 --- a/crates/nu-command/src/formats/from/xml.rs +++ b/crates/nu-command/src/formats/from/xml.rs @@ -35,10 +35,10 @@ impl Command for FromXml { fn extra_usage(&self) -> &str { r#"Every XML entry is represented via a record with tag, attribute and content fields. To represent different types of entries different values are written to this fields: -1. Tag entry: {tag: attrs: {: "" ...} content: []} -2. Comment entry: {tag: '!' attrs: null content: ""} -3. Processing instruction (PI): {tag: '?' attrs: null content: ""} -4. Text: {tag: null attrs: null content: ""}. +1. Tag entry: `{tag: attrs: {: "" ...} content: []}` +2. Comment entry: `{tag: '!' attrs: null content: ""}` +3. Processing instruction (PI): `{tag: '?' attrs: null content: ""}` +4. Text: `{tag: null attrs: null content: ""}`. Unlike to xml command all null values are always present and text is never represented via plain string. This way content of every tag is always a table and is easier to parse"# diff --git a/crates/nu-command/src/formats/to/xml.rs b/crates/nu-command/src/formats/to/xml.rs index 105549ecca..a17a709757 100644 --- a/crates/nu-command/src/formats/to/xml.rs +++ b/crates/nu-command/src/formats/to/xml.rs @@ -34,10 +34,10 @@ impl Command for ToXml { fn extra_usage(&self) -> &str { r#"Every XML entry is represented via a record with tag, attribute and content fields. To represent different types of entries different values must be written to this fields: -1. Tag entry: {tag: attrs: {: "" ...} content: []} -2. Comment entry: {tag: '!' attrs: null content: ""} -3. Processing instruction (PI): {tag: '?' attrs: null content: ""} -4. Text: {tag: null attrs: null content: ""}. Or as plain "" instead of record. +1. Tag entry: `{tag: attrs: {: "" ...} content: []}` +2. Comment entry: `{tag: '!' attrs: null content: ""}` +3. Processing instruction (PI): `{tag: '?' attrs: null content: ""}` +4. Text: `{tag: null attrs: null content: ""}`. Or as plain "" instead of record. Additionally any field which is: empty record, empty list or null, can be omitted."# }