From 65ad407cd0bd8a347f0ae68fbe5bf5259449977e Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 20 Mar 2026 11:44:15 +0800 Subject: [PATCH] style: improve documentation formatting for layouts --- layouts/_partials/init/index.html | 2 +- layouts/_partials/plugin/admonition.html | 14 ++--- layouts/_partials/plugin/alert.html | 10 ++-- layouts/_shortcodes/details.html | 71 ++++++++++++------------ 4 files changed, 48 insertions(+), 49 deletions(-) diff --git a/layouts/_partials/init/index.html b/layouts/_partials/init/index.html index 7733942d..73dc8141 100644 --- a/layouts/_partials/init/index.html +++ b/layouts/_partials/init/index.html @@ -1,4 +1,4 @@ -{{- hugo.Store.Set "version" "v0.4.5-20260319071939-1db7fbde" -}} +{{- hugo.Store.Set "version" "v0.4.5-20260320034416-9e384b66" -}} {{- .Store.Set "this" dict -}} {{- partial "init/detection-env.html" . -}} diff --git a/layouts/_partials/plugin/admonition.html b/layouts/_partials/plugin/admonition.html index 43ca3984..a7156473 100644 --- a/layouts/_partials/plugin/admonition.html +++ b/layouts/_partials/plugin/admonition.html @@ -1,12 +1,12 @@ {{- /* - * The extended syntax of alert is compatible with Obsidian and FixIt admonition shortcode. - * @param {String} .Text the content of the admonition box - * @param {String} [.Type] the type of the admonition box - * @param {String} [.Title] the title of the admonition box - * @param {Boolean} [.Open] whether the admonition box is open, default is true - * @param {Boolean} [.Foldable] whether the admonition box is foldable, default is true - * For custom admonitions, see https://fixit.lruihao.cn/documentation/content-management/shortcodes/extended/admonition/#customize-admonitions + The extended syntax of alert is compatible with Obsidian and FixIt admonition shortcode. + @param {String} .Text the content of the admonition box + @param {String} [.Type] the type of the admonition box + @param {String} [.Title] the title of the admonition box + @param {Boolean} [.Open] whether the admonition box is open, default is true + @param {Boolean} [.Foldable] whether the admonition box is foldable, default is true + For custom admonitions, see https://fixit.lruihao.cn/documentation/content-management/shortcodes/extended/admonition/#customize-admonitions */ -}} {{- $iconMap := dict diff --git a/layouts/_partials/plugin/alert.html b/layouts/_partials/plugin/alert.html index 07a65e58..e2e7c16e 100644 --- a/layouts/_partials/plugin/alert.html +++ b/layouts/_partials/plugin/alert.html @@ -1,9 +1,9 @@ {{- /* - * The basic syntax of alert is compatible with GitHub, Obsidian, and Typora. - * @param {String} .Type the type of the alert box - * @param {String} .Text the content of the alert box - * @param {Map} [.Attributes] the attributes of the alert box - * @example {{- dict "Text" .Text "Type" .AlertType "Attributes" .Attributes | partial "plugin/alert.html" -}} + The basic syntax of alert is compatible with GitHub, Obsidian, and Typora. + @param {String} .Type the type of the alert box + @param {String} .Text the content of the alert box + @param {Map} [.Attributes] the attributes of the alert box + @example {{- dict "Text" .Text "Type" .AlertType "Attributes" .Attributes | partial "plugin/alert.html" -}} */ -}} {{- $iconMap := dict diff --git a/layouts/_shortcodes/details.html b/layouts/_shortcodes/details.html index a32fd65e..f41f9036 100644 --- a/layouts/_shortcodes/details.html +++ b/layouts/_shortcodes/details.html @@ -1,54 +1,53 @@ {{- /* -Renders an HTML details element. + Renders an HTML details element. -@param {string} [class] The value of the element's class attribute. -@param {string} [name] The value of the element's name attribute. -@param {string} [summary] The content of the child summary element. -@param {string} [title] The value of the element's title attribute. -@param {bool} [open=false] Whether to initially display the content of the details element. + @param {string} [class] The value of the element's class attribute. + @param {string} [name] The value of the element's name attribute. + @param {string} [summary] The content of the child summary element. + @param {string} [title] The value of the element's title attribute. + @param {bool} [open=false] Whether to initially display the content of the details element. -@reference https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details + @reference https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details -@examples + @examples - {{< details >}} - A basic collapsible section. - {{< /details >}} + {{< details >}} + A basic collapsible section. + {{< /details >}} - {{< details summary="Custom Summary Text" >}} - Showing custom `summary` text. - {{< /details >}} + {{< details summary="Custom Summary Text" >}} + Showing custom `summary` text. + {{< /details >}} - {{< details summary="Open Details" open=true >}} - Contents displayed initially by using `open`. - {{< /details >}} + {{< details summary="Open Details" open=true >}} + Contents displayed initially by using `open`. + {{< /details >}} - {{< details summary="Styled Content" class="my-custom-class" >}} - Content can be styled with CSS by specifying a `class`. + {{< details summary="Styled Content" class="my-custom-class" >}} + Content can be styled with CSS by specifying a `class`. - Target details element: + Target details element: - ```css - details.my-custom-class { } - ``` + ```css + details.my-custom-class { } + ``` - Target summary element: + Target summary element: - ```css - details.my-custom-class > summary > * { } - ``` + ```css + details.my-custom-class > summary > * { } + ``` - Target inner content: + Target inner content: - ```css - details.my-custom-class > :not(summary) { } - ``` - {{< /details >}} - - {{< details summary="Grouped Details" name="my-details" >}} - Specifying a `name` allows elements to be connected, with only one able to be open at a time. - {{< /details >}} + ```css + details.my-custom-class > :not(summary) { } + ``` + {{< /details >}} + {{< details summary="Grouped Details" name="my-details" >}} + Specifying a `name` allows elements to be connected, with only one able to be open at a time. + {{< /details >}} */}} {{- /* Get arguments. */}}