|
| 1 | +## Might Fail Docs |
| 2 | + |
| 3 | +### Blocks |
| 4 | + |
| 5 | +#### YouTube |
| 6 | + |
| 7 | +```mdx |
| 8 | +<YouTube videoId="PbkwqVZsUgs" startTime={230} /> |
| 9 | +``` |
| 10 | + |
| 11 | +#### Example Block |
| 12 | + |
| 13 | +```mdx |
| 14 | +<SideBySide ratio="3:5"> |
| 15 | +<ExampleCard> |
| 16 | +Return a single root element, div or empty tag `<>` |
| 17 | +</ExampleCard> |
| 18 | + \`\`\`some-component.jsx |
| 19 | + // focus(1:2) |
| 20 | + return ( |
| 21 | + <div> |
| 22 | + <h1 className="header">Hello</h1> |
| 23 | + <h2>World</h2> |
| 24 | + <img className="image" src="https://picsum.photos/200" alt="random"></img> |
| 25 | + </div> |
| 26 | + ) |
| 27 | + \`\`\` |
| 28 | +</SideBySide> |
| 29 | +``` |
| 30 | + |
| 31 | +#### Instruction Block |
| 32 | + |
| 33 | +```mdx |
| 34 | +<Instruction> |
| 35 | + <Instruction.Action step={1}> |
| 36 | + Add this code to your thing: |
| 37 | + </Instruction.Action> |
| 38 | + <Instruction.Implementation> |
| 39 | + |
| 40 | + ```App.js |
| 41 | + return ( |
| 42 | + <div className="App"> |
| 43 | + <h1 className="heading">Hello</h1> |
| 44 | + <h2>World</h2> |
| 45 | + <h3>{new Date().toString()}</h3> |
| 46 | + </div> |
| 47 | + ) |
| 48 | + ``` |
| 49 | + </Instruction.Implementation> |
| 50 | +</Instruction> |
| 51 | +``` |
| 52 | + |
| 53 | +```mdx |
| 54 | +<Instruction ratio=""> |
| 55 | +type Ratio = "1" | "1:1" | "2:3" | "3:2" | "3:5" | "5:3" | "4:7" | "1:2" | "1:0" | "0:1" |
| 56 | +``` |
| 57 | + |
| 58 | +#### Tabs |
| 59 | + |
| 60 | +``` |
| 61 | +<Tabs> |
| 62 | + <Tab name="npx"> |
| 63 | + ```sh |
| 64 | + npx create-next-app@latest |
| 65 | + ``` |
| 66 | + </Tab> |
| 67 | + <Tab name="yarn"> |
| 68 | + ```sh |
| 69 | + yarn create next-app |
| 70 | + ``` |
| 71 | + </Tab> |
| 72 | + <Tab name="pnpm"> |
| 73 | + ```sh |
| 74 | + pnpm create next-app |
| 75 | + ``` |
| 76 | + </Tab> |
| 77 | + <Tab name="bunx"> |
| 78 | + ```sh |
| 79 | + bunx create-next-app |
| 80 | + ``` |
| 81 | + </Tab> |
| 82 | +</Tabs> |
| 83 | +``` |
| 84 | + |
| 85 | +## Card |
| 86 | + |
| 87 | +``` |
| 88 | +<Card> |
| 89 | +</Card> |
| 90 | +``` |
| 91 | + |
| 92 | +## File Tree |
| 93 | + |
| 94 | +```mdx |
| 95 | +<Card> |
| 96 | +<FileTree focus={[{depth: number, item: number}]}> |
| 97 | + - src |
| 98 | + - app |
| 99 | + - page.tsx |
| 100 | +</FileTree> |
| 101 | +</Card> |
| 102 | +``` |
| 103 | + |
| 104 | +```mdx |
| 105 | +<Instruction ratio="1:1"> |
| 106 | + <Instruction.Action step={1}> |
| 107 | + Create a new file inside of `create-post` called `page.tsx`. |
| 108 | + </Instruction.Action> |
| 109 | + <Instruction.Implementation> |
| 110 | + <Card> |
| 111 | + <FileTree focus={[{depth: 4, item: 1}]}> |
| 112 | + - src |
| 113 | + - app |
| 114 | + - page.tsx |
| 115 | + - create-post (`/create-post` route) |
| 116 | + - page.tsx (UI) |
| 117 | + </FileTree> |
| 118 | + </Card> |
| 119 | + </Instruction.Implementation> |
| 120 | +</Instruction> |
| 121 | +``` |
| 122 | + |
| 123 | +## Code |
| 124 | + |
| 125 | +```mdx |
| 126 | +<CodeWithOutput> |
| 127 | + ```users.ts |
| 128 | + import { pgTable, text, varchar, timestamp } from "drizzle-orm/pg-core" |
| 129 | + |
| 130 | + export const users = pgTable("users", { |
| 131 | + id: text("id").primaryKey(), |
| 132 | + username: varchar("username", { length: 30 }).notNull(), |
| 133 | + firstName: varchar("first_name", { length: 50 }).notNull(), |
| 134 | + lastName: varchar("last_name", { length: 50 }).notNull(), |
| 135 | + avatar: text("avatar").notNull(), |
| 136 | + createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), |
| 137 | + }) |
| 138 | + ``` |
| 139 | + ```sql |
| 140 | + CREATE TABLE IF NOT EXISTS "users" ( |
| 141 | + "id" text PRIMARY KEY NOT NULL, |
| 142 | + "username" varchar(30) NOT NULL, |
| 143 | + "first_name" varchar(50) NOT NULL, |
| 144 | + "last_name" varchar(50) NOT NULL, |
| 145 | + "avatar" text NOT NULL, |
| 146 | + "created_at" timestamp with time zone DEFAULT now() NOT NULL |
| 147 | + ); |
| 148 | + ``` |
| 149 | +</CodeWithOutput> |
| 150 | +``` |
| 151 | + |
| 152 | + |
| 153 | +```mdx |
| 154 | +<CodeTabs> |
| 155 | + ```/home/ubuntu/index.html |
| 156 | + <!DOCTYPE html> |
| 157 | + <html lang="en"> |
| 158 | + <head> |
| 159 | + <meta charset="UTF-8"> |
| 160 | + <title>Hello World</title> |
| 161 | + </head> |
| 162 | + <body> |
| 163 | + <h1>Hello World</h1> |
| 164 | + <p>🌎</p> |
| 165 | + </body> |
| 166 | + </html> |
| 167 | + ``` |
| 168 | + ```/home/ubuntu/404.html |
| 169 | + <!DOCTYPE html> |
| 170 | + <html lang="en"> |
| 171 | + <head> |
| 172 | + <meta charset="UTF-8"> |
| 173 | + <title>404 - Page Not Found</title> |
| 174 | + </head> |
| 175 | + <body> |
| 176 | + <h1>404 - Page not found</h1> |
| 177 | + <p>🤷♀️</p> |
| 178 | + </body> |
| 179 | + </html> |
| 180 | + ``` |
| 181 | +</CodeTabs> |
| 182 | +``` |
| 183 | + |
| 184 | +**Not yet fully working:** |
| 185 | +```mdx |
| 186 | +<CodeSideBySide> |
| 187 | + ```users.ts |
| 188 | + // toolbar sql |
| 189 | + import { text, varchar, pgTable, timestamp } from "drizzle-orm/pg-core" |
| 190 | + |
| 191 | + export const users = pgTable("users", { |
| 192 | + id: text("id").primaryKey(), |
| 193 | + username: varchar("username", { length: 30 }).notNull(), |
| 194 | + firstName: varchar("first_name", { length: 50 }).notNull(), |
| 195 | + lastName: varchar("last_name", { length: 50 }).notNull(), |
| 196 | + avatar: text("avatar").notNull(), |
| 197 | + createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(), |
| 198 | + }) |
| 199 | + ``` |
| 200 | + ```schema.sql |
| 201 | + -- toolbar sql |
| 202 | + CREATE TABLE IF NOT EXISTS "users" ( |
| 203 | + "id" text PRIMARY KEY NOT NULL, |
| 204 | + "username" varchar(30) NOT NULL, |
| 205 | + "first_name" varchar(50) NOT NULL, |
| 206 | + "last_name" varchar(50) NOT NULL, |
| 207 | + "avatar" text NOT NULL, |
| 208 | + "created_at" timestamp with time zone DEFAULT now() NOT NULL |
| 209 | + ); |
| 210 | + ``` |
| 211 | +</CodeSideBySide> |
| 212 | +``` |
| 213 | + |
| 214 | +## Image |
| 215 | + |
| 216 | +The image path needs to be aboslute to where it is in the markdown system. |
| 217 | +append dark or light to the end of the image path to switch between the two. |
| 218 | + |
| 219 | +```md |
| 220 | +  |
| 221 | +``` |
0 commit comments