Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
700ed48
week 1
EnhancedJax Jan 25, 2025
d7f7078
new namespace
EnhancedJax Jan 25, 2025
a4064d0
Merge branch 'admonition' into COMP2120
EnhancedJax Jan 25, 2025
c0d5126
dev
EnhancedJax Jan 25, 2025
7d5d79d
quiz 1
EnhancedJax Jan 26, 2025
195f237
Custom search
EnhancedJax Jan 26, 2025
84655dd
correct ab-1
EnhancedJax Jan 26, 2025
61ceb82
Merge branch 'ECON1210' into IIMT2641
EnhancedJax Jan 27, 2025
7ed7863
week 1
EnhancedJax Jan 27, 2025
2027e7a
week 1 tutorial
EnhancedJax Jan 27, 2025
5e38598
Merge branch 'ECON1210'
EnhancedJax Jan 27, 2025
151b260
Merge branch 'main' into COMP2120
EnhancedJax Jan 28, 2025
1072cd1
week 2
EnhancedJax Feb 6, 2025
b394345
week 3
EnhancedJax Feb 6, 2025
26924ba
Merge branch 'IIMT2641'
EnhancedJax Feb 6, 2025
5c3d7ba
fix
EnhancedJax Feb 7, 2025
82a9a51
bayes' theorem
EnhancedJax Feb 7, 2025
7382f27
week 2
EnhancedJax Feb 8, 2025
ffecfe5
Merge branch 'ECON1210' into jax-content
EnhancedJax Feb 8, 2025
2c1c40c
IIMT2641
EnhancedJax Feb 8, 2025
839ee07
COMP2121
EnhancedJax Feb 8, 2025
fd865f6
COMP2120
EnhancedJax Feb 8, 2025
3d80c0d
fix notes meta
EnhancedJax Feb 8, 2025
4fb4714
removed comment build error
EnhancedJax Feb 8, 2025
38cfc62
COMP2120 - Week 3
EnhancedJax Feb 8, 2025
582e4ec
10/2
EnhancedJax Feb 10, 2025
2632254
11/2
EnhancedJax Feb 11, 2025
77ab0ae
12/2
EnhancedJax Feb 12, 2025
0894b84
fix path
EnhancedJax Feb 12, 2025
c6870e3
fix image path
EnhancedJax Feb 12, 2025
2f93948
16/2
EnhancedJax Feb 16, 2025
50a9cc2
20/2
EnhancedJax Feb 20, 2025
6e00f73
20/2 2
EnhancedJax Feb 20, 2025
0866888
3/3
EnhancedJax Mar 3, 2025
8361954
4/3
EnhancedJax Mar 4, 2025
2b4e995
6/3
EnhancedJax Mar 6, 2025
4c93ba4
11/3
EnhancedJax Mar 11, 2025
ae1043e
temp
EnhancedJax Mar 11, 2025
5eb1164
11/3
EnhancedJax Mar 11, 2025
ede4d05
21/3
EnhancedJax Mar 20, 2025
eb55cbf
4/4
EnhancedJax Apr 4, 2025
0a7409a
save
EnhancedJax Apr 22, 2025
c3ce451
24/4
EnhancedJax Apr 24, 2025
c284c89
25/4
EnhancedJax Apr 25, 2025
b4900cf
fix build issues with mermaid
EnhancedJax Apr 25, 2025
f53dd0f
26/4
EnhancedJax Apr 26, 2025
d5f16b2
27/4
EnhancedJax Apr 27, 2025
e78eca7
28/4
EnhancedJax Apr 29, 2025
ebddcde
fix capitalization
EnhancedJax Apr 29, 2025
625a8e8
fix meta
EnhancedJax Apr 29, 2025
843508f
30/4
EnhancedJax Apr 30, 2025
4ac054e
2/5
EnhancedJax May 2, 2025
8d0c794
2/5
EnhancedJax May 2, 2025
5beb718
9/5
EnhancedJax May 9, 2025
60c4ba3
13/5
EnhancedJax May 13, 2025
6656815
update ECON1210 wip
EnhancedJax May 13, 2025
93f3809
14/5
EnhancedJax May 14, 2025
b4cae90
17/5
EnhancedJax May 18, 2025
d674264
24/5
EnhancedJax May 24, 2025
efd5e0d
11/8
EnhancedJax Aug 11, 2025
45f1767
COMP3230 creation
Zcher-Kevin Sep 5, 2025
e17c845
update COMP3230
Zcher-Kevin Sep 5, 2025
89f51d2
update COMP3230
Zcher-Kevin Sep 5, 2025
0c2de6f
Merge branch 'master' into dev
Zcher-Kevin Sep 7, 2025
604b66d
created COMP3314, COMP3330, COMP3278, COMP3230 os files
Zcher-Kevin Sep 8, 2025
94678e4
created COMP3314, COMP3330, COMP3278, COMP3230 os files
Zcher-Kevin Sep 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions .vscode/dev-md-preview.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/* Common styles for all admonitions */
* {
font-family: Atkinson Hyperlegible;
}

.markdown-body .admonition {
margin-bottom: 1em;
margin-top: 1em;
position: relative;
padding: 1em;
border-radius: 0;
}

.markdown-body .admonition-title {
font-weight: bold;
display: block;
padding: 0.25rem 0.75rem;
width: min-content;
text-wrap: nowrap;
color: white;
margin-left: -1em;
margin-top: -1em;
background-color: #888889;
}

.markdown-body .admonition.light .admonition-title {
background-color: #a0a0a0;
}

/* Unknown MkDocs displayed as info, unknown Docusaurus are not matched */
.markdown-body .admonition-title::before {
content: "";
}
.markdown-body .admonition {
background-color: #474748;
border-bottom: 1px solid #888889;
border-left: 8px solid #888889 !important;
}
.markdown-body .admonition.light {
background-color: #f0f0f0;
border-bottom: 1px solid #a0a0a0;
border-left: 8px solid #a0a0a0 !important;
}

/* Remove icons for admonition titles */
.markdown-body .note .admonition-title::before {
content: "";
}

.markdown-body .tip .admonition-title::before {
content: "";
}

.markdown-body .info .admonition-title::before {
content: "";
}

.markdown-body .warning .admonition-title::before {
content: "";
}

.markdown-body .danger .admonition-title::before {
content: "";
}

.markdown-body .abstract .admonition-title::before {
content: "";
}

.markdown-body .success .admonition-title::before {
content: "";
}

.markdown-body .question .admonition-title::before {
content: "";
}

.markdown-body .failure .admonition-title::before {
content: "";
}

.markdown-body .bug .admonition-title::before {
content: "";
}

.markdown-body .example .admonition-title::before {
content: "";
}

.markdown-body .quote .admonition-title::before {
content: "";
}

/* Background and border colors for dark theme */
.markdown-body .note {
background-color: #474748;
border-bottom: 1px solid #888889;
border-left: 8px solid #888889 !important;
}
.markdown-body .note .admonition-title {
background-color: #888889;
}

.markdown-body .tip {
background-color: #003100;
border-bottom: 1px solid #009400;
border-left: 8px solid #009400 !important;
}
.markdown-body .tip > .admonition-title {
background-color: #009400;
}

.markdown-body .info {
background-color: oklch(0.359 0.144 278.697);
border-bottom: 1px solid oklch(0.257 0.09 281.288);
border-left: 8px solid oklch(0.257 0.09 281.288) !important;
}
.markdown-body .info > .admonition-title {
background-color: oklch(0.257 0.09 281.288);
}

/* Background and border colors for light theme */
.markdown-body .note.light {
background-color: #f0f0f0;
border-bottom: 1px solid #a0a0a0;
border-left: 8px solid #a0a0a0 !important;
}
.markdown-body .note.light > .admonition-title {
background-color: #a0a0a0;
}
.markdown-body .tip.light {
background-color: #e0f2e0;
border-bottom: 1px solid #008000;
border-left: 8px solid #008000 !important;
}
.markdown-body .tip.light > .admonition-title {
background-color: #008000;
}

.markdown-body .info.light {
background-color: oklch(0.93 0.034 272.788);
border-bottom: 1px solid oklch(0.511 0.262 276.966);
border-left: 8px solid oklch(0.511 0.262 276.966) !important;
}
.markdown-body .info.light > .admonition-title {
background-color: oklch(0.511 0.262 276.966);
}
14 changes: 14 additions & 0 deletions .vscode/mdx.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"Admonition": {
"scope": "markdown,mdx",
"prefix": "!!",
"body": ["!!! $1 \"$2\"", "\t", "\t $3"],
"description": "Admonition"
},
"Equation": {
"scope": "markdown,mdx",
"prefix": "`eq",
"body": ["```math", "\\begin{align*}", "\t$1", "\\end{align*}", "```"],
"description": "Equation"
}
}
15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"markdown.styles": ["./.vscode/dev-md-preview.css"],
"workbench.colorCustomizations": {
"commandCenter.border": "#e7e7e799",
"titleBar.activeBackground": "#793600",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#79360099",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.color": "#793600",
"editor.fontSize": 18,
// "editor.fontFamily": "Arial Black",
"editor.lineHeight": 1.5,
"markdown.preview.fontSize": 16
}
24 changes: 11 additions & 13 deletions app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
font-size: 16px;
}

.katex {
font-size: 1em !important;
}

.katex-display > .katex {
overflow-x: scroll;
overflow-x: auto;
overflow-y: hidden;
}

Expand Down Expand Up @@ -40,10 +44,6 @@ article {
}
}

#radix-\:r0\: > div.mt-auto.flex.flex-col.border-t.p-3 > div {
flex-wrap: wrap;
}

@layer base {
:root {
--background: 0 0% 100%;
Expand Down Expand Up @@ -141,11 +141,9 @@ details summary::-webkit-details-marker {
display: none;
}

/* @layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
} */
/* invert images in dark mode */

.dark img,
.dark picture {
filter: invert(1) hue-rotate(180deg);
}
8 changes: 8 additions & 0 deletions app/layout.client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"use client";

import { useParams } from "next/navigation";

export function useMode(): string | undefined {
const { slug } = useParams();
return Array.isArray(slug) && slug.length > 0 ? slug[0] : undefined;
}
24 changes: 21 additions & 3 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import CustomSearchDialog from "@/components/Search";
import getSortedFiles from "@/lib/getSortedFiles";
import { baseUrl, createMetadata } from "@/lib/metadata";
import { RootProvider } from "fumadocs-ui/provider";
Expand All @@ -11,7 +12,7 @@ const font = GeistSans;
export const metadata = createMetadata({
title: {
template: "%s Notes@HKU",
default: "Notes@HKU by Jax",
default: "NotesAtHKU",
},
description:
"Notes at HKU is the home to hand-typed notes by students, for students.",
Expand All @@ -22,16 +23,33 @@ export default function Layout({ children }: { children: ReactNode }) {
const sortedFiles = getSortedFiles();
const tags = sortedFiles.map((file) => ({
name: file.title,
value: file.title, // assuming file has a value property
value: file.title,
icon: file.icon,
}));
const jsonLd = {
"@context": "https://schema.org",
"@type": "WebSite",
name: "NotesAtHKU by Jax",
alternateName: [
"Notes@HKU",
"NotesATHKU",
"Notes at HKU by Jax",
"Notes@HKU by Jax",
],
url: "https://notes.jaxtam.dev",
};

return (
<html lang="en" className={font.className} suppressHydrationWarning>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
<body className="flex flex-col min-h-screen">
<RootProvider
search={{
SearchDialog: CustomSearchDialog,
options: {
defaultTag: "",
tags,
},
}}
Expand Down
95 changes: 95 additions & 0 deletions components/Search.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
"use client";

import { useMode } from "@/app/layout.client";
import { useDocsSearch } from "fumadocs-core/search/client";
import { type ReactNode, useEffect, useState } from "react";
import {
SearchDialog,
type SharedProps,
type TagItem,
TagsList,
} from "./ui/search-dialog";

export interface CustomSearchDialogProps extends SharedProps {
/**
* @defaultValue 'fetch'
*/
type?: "fetch" | "static";

tags?: TagItem[];

/**
* Search API URL
*/
api?: string;

/**
* The debounced delay for performing a search.
*/
delayMs?: number;

footer?: ReactNode;

/**
* Allow to clear tag filters
*
* @defaultValue false
*/
allowClear?: boolean;
}

export default function CustomSearchDialog({
tags,
api,
delayMs,
type = "fetch",
allowClear = false,
...props
}: CustomSearchDialogProps): ReactNode {
const mode = useMode();
const [tag, setTag] = useState<string | undefined>(mode || "");

useEffect(() => {
setTag(mode || "");
}, [mode]);

const { search, setSearch, query } = useDocsSearch(
type === "fetch"
? {
type: "fetch",
api,
}
: {
type: "static",
from: api,
},
undefined,
tag,
delayMs
);

return (
<SearchDialog
search={search}
onSearchChange={setSearch}
isLoading={query.isLoading}
results={query.data ?? []}
{...props}
footer={
tags ? (
<>
<TagsList
tag={tag}
onTagChange={setTag}
items={tags}
allowClear={allowClear}
/>
{props.footer}
</>
) : (
props.footer
)
}
/>
);
}
Loading