From b5f064d0b870c157f904a88641d8719c7074cbd8 Mon Sep 17 00:00:00 2001 From: Florian Dieminger Date: Mon, 16 Dec 2024 13:21:10 +0100 Subject: [PATCH] chore(templ): rename embeds --- ...mbedghlivesample.rs => embed_gh_live_sample.rs} | 0 ...tiveexample.rs => embed_interactive_example.rs} | 0 .../embeds/{livesample.rs => embed_live_sample.rs} | 2 +- .../embeds/{embedyoutube.rs => embed_youtube.rs} | 0 .../embeds/{jsfiddleembed.rs => jsfiddle_embed.rs} | 0 .../{livesamplelink.rs => live_sample_link.rs} | 1 - crates/rari-doc/src/templ/templs/embeds/mod.rs | 12 ++++++------ crates/rari-doc/src/templ/templs/mod.rs | 14 ++++++++------ 8 files changed, 15 insertions(+), 14 deletions(-) rename crates/rari-doc/src/templ/templs/embeds/{embedghlivesample.rs => embed_gh_live_sample.rs} (100%) rename crates/rari-doc/src/templ/templs/embeds/{embedinteractiveexample.rs => embed_interactive_example.rs} (100%) rename crates/rari-doc/src/templ/templs/embeds/{livesample.rs => embed_live_sample.rs} (98%) rename crates/rari-doc/src/templ/templs/embeds/{embedyoutube.rs => embed_youtube.rs} (100%) rename crates/rari-doc/src/templ/templs/embeds/{jsfiddleembed.rs => jsfiddle_embed.rs} (100%) rename crates/rari-doc/src/templ/templs/embeds/{livesamplelink.rs => live_sample_link.rs} (91%) diff --git a/crates/rari-doc/src/templ/templs/embeds/embedghlivesample.rs b/crates/rari-doc/src/templ/templs/embeds/embed_gh_live_sample.rs similarity index 100% rename from crates/rari-doc/src/templ/templs/embeds/embedghlivesample.rs rename to crates/rari-doc/src/templ/templs/embeds/embed_gh_live_sample.rs diff --git a/crates/rari-doc/src/templ/templs/embeds/embedinteractiveexample.rs b/crates/rari-doc/src/templ/templs/embeds/embed_interactive_example.rs similarity index 100% rename from crates/rari-doc/src/templ/templs/embeds/embedinteractiveexample.rs rename to crates/rari-doc/src/templ/templs/embeds/embed_interactive_example.rs diff --git a/crates/rari-doc/src/templ/templs/embeds/livesample.rs b/crates/rari-doc/src/templ/templs/embeds/embed_live_sample.rs similarity index 98% rename from crates/rari-doc/src/templ/templs/embeds/livesample.rs rename to crates/rari-doc/src/templ/templs/embeds/embed_live_sample.rs index 7e3687ad..37390525 100644 --- a/crates/rari-doc/src/templ/templs/embeds/livesample.rs +++ b/crates/rari-doc/src/templ/templs/embeds/embed_live_sample.rs @@ -9,7 +9,7 @@ use crate::utils::dedup_whitespace; #[allow(clippy::too_many_arguments)] #[rari_f] -pub fn live_sample( +pub fn embed_live_sample( id: String, width: Option, height: Option, diff --git a/crates/rari-doc/src/templ/templs/embeds/embedyoutube.rs b/crates/rari-doc/src/templ/templs/embeds/embed_youtube.rs similarity index 100% rename from crates/rari-doc/src/templ/templs/embeds/embedyoutube.rs rename to crates/rari-doc/src/templ/templs/embeds/embed_youtube.rs diff --git a/crates/rari-doc/src/templ/templs/embeds/jsfiddleembed.rs b/crates/rari-doc/src/templ/templs/embeds/jsfiddle_embed.rs similarity index 100% rename from crates/rari-doc/src/templ/templs/embeds/jsfiddleembed.rs rename to crates/rari-doc/src/templ/templs/embeds/jsfiddle_embed.rs diff --git a/crates/rari-doc/src/templ/templs/embeds/livesamplelink.rs b/crates/rari-doc/src/templ/templs/embeds/live_sample_link.rs similarity index 91% rename from crates/rari-doc/src/templ/templs/embeds/livesamplelink.rs rename to crates/rari-doc/src/templ/templs/embeds/live_sample_link.rs index cf67d5cb..20215eed 100644 --- a/crates/rari-doc/src/templ/templs/embeds/livesamplelink.rs +++ b/crates/rari-doc/src/templ/templs/embeds/live_sample_link.rs @@ -4,7 +4,6 @@ use rari_utils::concat_strs; use crate::error::DocError; use crate::templ::api::RariApi; -#[allow(clippy::too_many_arguments)] #[rari_f] pub fn live_sample_link(id: String, display: String) -> Result { let id = RariApi::anchorize(&id); diff --git a/crates/rari-doc/src/templ/templs/embeds/mod.rs b/crates/rari-doc/src/templ/templs/embeds/mod.rs index d0ff52ee..a2f34bdb 100644 --- a/crates/rari-doc/src/templ/templs/embeds/mod.rs +++ b/crates/rari-doc/src/templ/templs/embeds/mod.rs @@ -1,6 +1,6 @@ -pub mod embedghlivesample; -pub mod embedinteractiveexample; -pub mod embedyoutube; -pub mod jsfiddleembed; -pub mod livesample; -pub mod livesamplelink; +pub mod embed_gh_live_sample; +pub mod embed_interactive_example; +pub mod embed_live_sample; +pub mod embed_youtube; +pub mod jsfiddle_embed; +pub mod live_sample_link; diff --git a/crates/rari-doc/src/templ/templs/mod.rs b/crates/rari-doc/src/templ/templs/mod.rs index 30b83eda..0b44ad6b 100644 --- a/crates/rari-doc/src/templ/templs/mod.rs +++ b/crates/rari-doc/src/templ/templs/mod.rs @@ -99,14 +99,16 @@ pub fn invoke( "next" => previous_menu_next::next_any, // embeds - "embedinteractiveexample" => embeds::embedinteractiveexample::embed_interactive_example_any, - "embedghlivesample" => embeds::embedghlivesample::embed_gh_live_sample_any, - "embedlivesample" => embeds::livesample::live_sample_any, - "embedyoutube" => embeds::embedyoutube::embed_youtube_any, - "jsfiddleembed" => embeds::jsfiddleembed::embded_jsfiddle_any, + "embedinteractiveexample" => { + embeds::embed_interactive_example::embed_interactive_example_any + } + "embedghlivesample" => embeds::embed_gh_live_sample::embed_gh_live_sample_any, + "embedlivesample" => embeds::embed_live_sample::embed_live_sample_any, + "embedyoutube" => embeds::embed_youtube::embed_youtube_any, + "jsfiddleembed" => embeds::jsfiddle_embed::embded_jsfiddle_any, // live sample link - "livesamplelink" => embeds::livesamplelink::live_sample_link_any, + "livesamplelink" => embeds::live_sample_link::live_sample_link_any, // badges "experimentalbadge" | "experimental_inline" => badges::experimental_any,