Skip to content

Commit

Permalink
wip: tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Oct 24, 2023
1 parent 1048dc9 commit 97c5f23
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 28 deletions.
38 changes: 12 additions & 26 deletions site/docs/kitchen-sink/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -136,22 +136,22 @@ Inline `code` has `back-ticks around` it.

Inline [`code`]() with link.

### `heading3` heading
Inline `console.log("hello world"){:js}` highlighted code

#### `heading4` heading

##### `heading5` heading

###### `heading6` heading
```plaintext
wowee plain text!
```

Inline `console.log("hello world"){:js}` code
```bash [Terminal]
npm i vocs
```

```ts
```ts [example.ts]
type Example = string // [!code hl]
const example: Example = 'example'
```

```ts showLineNumbers {2,3,6-9}
```ts [Line Highlight & Numbers] showLineNumbers {2,3,6-9}
// 1. Import modules.
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
Expand All @@ -166,7 +166,7 @@ const client = createPublicClient({
const blockNumber = await client.getBlockNumber()
```

```ts /mainnet/1-2 /client/2-3
```ts [Word Focus] /mainnet/1-2 /client/2-3
// 1. Import modules.
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
Expand All @@ -181,7 +181,7 @@ const client = createPublicClient({
const blockNumber = await client.getBlockNumber()
```

```ts
```ts [Line Focus]
// 1. Import modules.
import { createPublicClient, http } from 'viem'
import { mainnet } from 'viem/chains'
Expand All @@ -196,7 +196,7 @@ const client = createPublicClient({
const blockNumber = await client.getBlockNumber() // [!code focus]
```

```ts
```ts [Diff]
// 1. Import modules.
import { createPublicClient } from 'viem' // [!code --]
import { createPublicClient, http } from 'viem' // [!code ++]
Expand All @@ -212,20 +212,6 @@ const client = createPublicClient({
const blockNumber = await client.getBlockNumber()
```

```ts twoslash
interface IdLabel {id: number, /* some fields */ }
interface NameLabel {name: string, /* other fields */ }
type NameOrId<T extends number | string> = T extends number ? IdLabel : NameLabel;
// This comment should not be included

// ---cut---
function createLabel<T extends number | string>(idOrName: T): NameOrId<T> {
throw "unimplemented"
}

let a = createLabel("typescript");
```

:::tip[Tip:]
Make sure to do the thing that does stuff.
:::
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/CodeTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ export function CodeTitle({ children, ...props }: { children: string }) {
<div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
{language === 'bash' ? (
<Terminal width={14} height={14} style={{ marginTop: 3 }} />
) : (
) : children.match(/\.(.*)$/) ? (
<File width={14} height={14} style={{ marginTop: 1 }} />
)}
) : null}
{children}
</div>
</div>
Expand Down

0 comments on commit 97c5f23

Please sign in to comment.