diff --git a/components/Callout.tsx b/components/Callout.tsx new file mode 100644 index 0000000..b760815 --- /dev/null +++ b/components/Callout.tsx @@ -0,0 +1,17 @@ +// Wrapper around Nextra Callout to add "example" type for user documentation +import { Callout as NextraCallout } from 'nextra/components' + +type CalloutProps = React.ComponentProps & { + type?: 'default' | 'info' | 'warning' | 'error' | 'success' | 'example' +} + +export function Callout({ type, children, ...props }: CalloutProps) { + if (type === 'example') { + return ( + + Example: {children} + + ) + } + return {children} +} diff --git a/components/Terminal.tsx b/components/Terminal.tsx new file mode 100644 index 0000000..a6f0499 --- /dev/null +++ b/components/Terminal.tsx @@ -0,0 +1,25 @@ +// Module to help create terminal-like code blocks in user documentation. +import React from "react"; + +// It'd be cool if we colored lines beginning with $ differently, but I wasn't +// able to figure that out. +export function Terminal({ children }) { + return ( +
+      {children}
+    
+ ); +}