Skip to content

Commit acc7989

Browse files
committed
Commit
1 parent 6510cdb commit acc7989

11 files changed

Lines changed: 184 additions & 8 deletions

File tree

docs/Message Commands/luig.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ hide_table_of_contents: true
66

77
# `;luig` Command
88

9-
:::info
10-
This command is a joke, it's meant to get people laughing or just a general funny thing.
9+
:::joke
1110
:::
1211

1312
:::info

docs/Message Commands/popcat.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
slug: /commands/popcat/
3+
title: ;popcat
4+
hide_table_of_contents: true
5+
---
6+
7+
# `;popcat` Command
8+
9+
:::joke
10+
:::
11+
12+
:::info
13+
This command is an owner-only command, only people with ownership can use this. (the room owner, and any promoted people)
14+
:::
15+
16+
:::info
17+
This command will or can block user interaction, or make it temporarily tough for the user to use Random Rants +.
18+
:::
19+
20+
This makes the sender's screen show the popcat meme (a white cat making pop noises with his mouth), and does it for the specified amount of seconds.
21+
22+
The maximum amount of seconds is 5.
23+
24+
# Usage
25+
26+
```messagecommand
27+
;popcat <Seconds>
28+
```
29+
30+
# Examples
31+
32+
```messagecommand
33+
;popcat 2
34+
```
35+
36+
```messagecommand
37+
;popcat 4
38+
```
39+
40+
```messagecommand
41+
;popcat 5
42+
```

docs/Message Commands/spin.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
slug: /commands/spin/
3+
title: ;spin
4+
hide_table_of_contents: true
5+
---
6+
7+
# `;spin` Command
8+
9+
:::info
10+
This command is a joke, it's meant to get people laughing or just a general funny thing.
11+
:::
12+
13+
:::info
14+
This command will or can block user interaction, or make it temporarily tough for the user to use Random Rants +.
15+
:::
16+
17+
This makes the sender's screen spin all the way around really fast.
18+
19+
# Usage
20+
21+
```messagecommand
22+
;spin
23+
```

docs/Message Commands/uh.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ hide_table_of_contents: true
66

77
# `;uh` Command
88

9-
:::info
10-
This command is a joke, it's meant to get people laughing or just a general funny thing.
9+
:::joke
1110
:::
1211

1312
:::info

docusaurus.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ module.exports = {
5353
sidebarPath: require.resolve("./sidebars.js"),
5454
routeBasePath: "/",
5555
breadcrumbs: false,
56+
57+
admonitions: {
58+
keywords: [
59+
"caution",
60+
"danger",
61+
"info",
62+
"joke",
63+
"note",
64+
"tip",
65+
"warning",
66+
],
67+
},
5668
},
5769
theme: {
5870
customCss: require.resolve("./src/css/custom.css"),

src/components/excited.svg

Lines changed: 1 addition & 0 deletions
Loading

src/css/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@
2626
background: #919191 !important;
2727
font-size: 20px;
2828
}
29+
30+
.alert--joke {
31+
--ifm-alert-background-color: #ac00db;
32+
--ifm-alert-background-color-highlight: rgba(212, 53, 28, 0.15);
33+
--ifm-alert-foreground-color: rgb(255, 255, 255);
34+
--ifm-alert-border-color: #5e0078;
35+
}

src/theme/Admonition/Type/Joke.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import React from "react";
22
import clsx from "clsx";
33
import Translate from "@docusaurus/Translate";
44
import AdmonitionLayout from "@theme/Admonition/Layout";
5-
import IconInfo from "@theme/Admonition/Icon/Info";
6-
const infimaClassName = "alert alert--info";
5+
import ExcitedIcon from "@site/src/components/excited.svg";
6+
const infimaClassName = "alert alert--joke";
77
const defaultProps = {
8-
icon: "🤣",
8+
icon: <ExcitedIcon />,
99
title: (
1010
<Translate
1111
id="theme.admonition.joke"
12-
description="The default label used for the joke admonition (:::joke)"
12+
description="The default label used for the Joke admonition (:::joke)"
1313
>
1414
joke
1515
</Translate>

src/theme/Admonition/Types.tsx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from "react";
2+
import AdmonitionTypeNote from "@theme/Admonition/Type/Note";
3+
import AdmonitionTypeTip from "@theme/Admonition/Type/Tip";
4+
import AdmonitionTypeInfo from "@theme/Admonition/Type/Info";
5+
import AdmonitionTypeCaution from "@theme/Admonition/Type/Caution";
6+
import AdmonitionTypeDanger from "@theme/Admonition/Type/Danger";
7+
import AdmonitionTypeJoke from "@theme/Admonition/Type/Joke";
8+
import type AdmonitionTypes from "@theme/Admonition/Types";
9+
import type { Props } from "@theme/Admonition";
10+
11+
const admonitionTypes: typeof AdmonitionTypes = {
12+
note: AdmonitionTypeNote,
13+
tip: AdmonitionTypeTip,
14+
info: AdmonitionTypeInfo,
15+
caution: AdmonitionTypeCaution,
16+
danger: AdmonitionTypeDanger,
17+
joke: AdmonitionTypeJoke,
18+
};
19+
20+
// Undocumented legacy admonition type aliases
21+
// Provide hardcoded/untranslated retrocompatible label
22+
// See also https://github.com/facebook/docusaurus/issues/7767
23+
const admonitionAliases: typeof AdmonitionTypes = {
24+
secondary: (props: Props) => (
25+
<AdmonitionTypeNote title="secondary" {...props} />
26+
),
27+
joke: (props: Props) => <AdmonitionTypeJoke title="joke" {...props} />,
28+
important: (props: Props) => (
29+
<AdmonitionTypeInfo title="important" {...props} />
30+
),
31+
success: (props: Props) => <AdmonitionTypeTip title="success" {...props} />,
32+
// TODO bad legacy mapping, warning is usually yellow, not red...
33+
warning: (props: Props) => (
34+
<AdmonitionTypeDanger title="warning" {...props} />
35+
),
36+
};
37+
38+
export default {
39+
...admonitionTypes,
40+
...admonitionAliases,
41+
};

src/theme/Admonition/index.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, { type ComponentType } from "react";
2+
import { processAdmonitionProps } from "@docusaurus/theme-common";
3+
import type { Props } from "@theme/Admonition";
4+
import AdmonitionTypes from "@theme/Admonition/Types";
5+
6+
function getAdmonitionTypeComponent(type: string): ComponentType<Props> {
7+
const component = AdmonitionTypes[type];
8+
if (component) {
9+
return component;
10+
}
11+
console.warn(
12+
`No admonition component found for admonition type "${type}". Using Info as fallback.`
13+
);
14+
return AdmonitionTypes.info!;
15+
}
16+
17+
export default function Admonition(unprocessedProps: Props): JSX.Element {
18+
const props = processAdmonitionProps(unprocessedProps);
19+
const AdmonitionTypeComponent = getAdmonitionTypeComponent(props.type);
20+
return <AdmonitionTypeComponent {...props} />;
21+
}

0 commit comments

Comments
 (0)