From db58f5d094d36202c597cf473108a3cf7035ed92 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Thu, 27 Jul 2023 20:25:07 +0300 Subject: [PATCH] code format --- www/html/document.html.tsx | 49 ++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/www/html/document.html.tsx b/www/html/document.html.tsx index d6a4b3d21..67f462a17 100644 --- a/www/html/document.html.tsx +++ b/www/html/document.html.tsx @@ -72,7 +72,7 @@ export default function* (doc: Doc): Operation { behavior: "append", properties: { className: - "opacity-0 group-hover:opacity-100 after:content-['#']", + "opacity-0 group-hover:opacity-100 after:content-['#']", }, }], [rehypeAddClasses, { @@ -80,7 +80,8 @@ export default function* (doc: Doc): Operation { }], [rehypeToc, { cssClasses: { - toc: "hidden text-sm tracking-wide leading-loose lg:block relative whitespace-nowrap", + toc: + "hidden text-sm tracking-wide leading-loose lg:block relative whitespace-nowrap", list: "fixed", }, }], @@ -102,23 +103,23 @@ function NextPrevLinks({ doc }: { doc: Doc }): JSX.Element { return ( {doc.previous - ? ( -
  • - Previous - - ‹‹{doc.previous.title} - -
  • - ) - : ""} + ? ( +
  • + Previous + + ‹‹{doc.previous.title} + +
  • + ) + : ""} {doc.next - ? ( -
  • - Next - {doc.next.title} -
  • - ) - : ""} + ? ( +
  • + Next + {doc.next.title} +
  • + ) + : ""}
    ); } @@ -130,10 +131,12 @@ import { Transform } from "./components/transform.tsx"; * of the article, not contained within it. */ function liftTOC(element: JSX.Element): JSX.Element { - if (element.type !== 'element') { + if (element.type !== "element") { return element; } - let nav = element.children.find(child => child.type === 'element' && child.tagName === "nav"); + let nav = element.children.find((child) => + child.type === "element" && child.tagName === "nav" + ); if (!nav) { return element; } @@ -142,9 +145,9 @@ function liftTOC(element: JSX.Element): JSX.Element { children: [ { ...element, - children: element.children.filter(child => child !== nav) + children: element.children.filter((child) => child !== nav), }, nav, - ] - } + ], + }; }