From f0ecaabd7dea79aaf1c8e116d95c1df793c97fba Mon Sep 17 00:00:00 2001 From: Piepmatz Date: Sat, 7 Dec 2024 14:28:14 +0100 Subject: [PATCH] Expose "to html" command (#14536) # Description In this PR I exposed the struct `ToHtml` that comes from `nu-cmd-extra`. I know this command isn't in a best state and should be changed in some way in the future but having the struct exposed makes transforming data to html way more simple for external tools as the `PipelineData` can easily be placed in the `ToHtml::run` method. # User-Facing Changes None. # Tests + Formatting I did `fmt` and `check` but not `test`, shouldn't break any tests regardless. # After Submitting For the demo page or my jupyter kernel would this make my life easiert. --- crates/nu-cmd-extra/src/extra/formats/mod.rs | 2 +- crates/nu-cmd-extra/src/extra/mod.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/nu-cmd-extra/src/extra/formats/mod.rs b/crates/nu-cmd-extra/src/extra/formats/mod.rs index 8c49349390..04c03dce49 100644 --- a/crates/nu-cmd-extra/src/extra/formats/mod.rs +++ b/crates/nu-cmd-extra/src/extra/formats/mod.rs @@ -2,4 +2,4 @@ mod from; mod to; pub(crate) use from::url::FromUrl; -pub(crate) use to::html::ToHtml; +pub use to::html::ToHtml; diff --git a/crates/nu-cmd-extra/src/extra/mod.rs b/crates/nu-cmd-extra/src/extra/mod.rs index 3936b94a0f..8204f1bd9a 100644 --- a/crates/nu-cmd-extra/src/extra/mod.rs +++ b/crates/nu-cmd-extra/src/extra/mod.rs @@ -9,6 +9,7 @@ mod strings; pub use bits::{ Bits, BitsAnd, BitsInto, BitsNot, BitsOr, BitsRol, BitsRor, BitsShl, BitsShr, BitsXor, }; +pub use formats::ToHtml; pub use math::{MathArcCos, MathArcCosH, MathArcSin, MathArcSinH, MathArcTan, MathArcTanH}; pub use math::{MathCos, MathCosH, MathSin, MathSinH, MathTan, MathTanH}; pub use math::{MathExp, MathLn}; @@ -54,7 +55,8 @@ pub fn add_extra_command_context(mut engine_state: EngineState) -> EngineState { strings::str_::case::StrTitleCase ); - bind_command!(formats::ToHtml, formats::FromUrl); + bind_command!(ToHtml, formats::FromUrl); + // Bits bind_command! { Bits,