Skip to content

Commit fc0a167

Browse files
clean up the examples styles a little in line with #1655 (#1660)
1 parent a33890f commit fc0a167

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+181
-62
lines changed

_components/Navigation.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
top: 4rem;
3939
height: calc(100vh - 4rem);
4040
overflow-y: auto;
41+
min-width: 330px;
4142
}
4243
}

_includes/doc.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ export default function Doc(data: Lume.Data, helpers: Lume.Helpers) {
3232
return (
3333
<div
3434
id="content"
35-
class={isExampleScript ? "" : "content"}
35+
class={isExampleScript ? "examples-content" : "content"}
3636
>
3737
<div
3838
class={`px-4 sm:px-5 md:px-6 w-full mx-auto 2xl:px-0 ${
39-
isExampleScript ? "max-w-[75rem]" : "max-w-[40rem]"
39+
isExampleScript ? "max-w-[70rem]" : "max-w-[40rem]"
4040
}`}
4141
>
4242
<article class="mx-auto">

deno.lock

Lines changed: 105 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/_components/ExamplePage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ export default function ExamplePage({ example }: Props) {
4040
<CopyButton text={contentNoCommentary} />
4141
</div>
4242
{example.parsed.files.map((file) => (
43-
<div class="flex flex-col gap-4 md:gap-0" key={file.name}>
43+
<div
44+
class="flex flex-col gap-4 md:gap-0 example-content"
45+
key={file.name}
46+
>
4447
{file.snippets.map((snippet, i) => (
4548
<SnippetComponent
4649
key={i}

examples/_components/SnippetComponent.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ export default function SnippetComponent(props: {
1111
const html = Prism.highlight(props.snippet.code, Prism.languages.js, "js");
1212

1313
return (
14-
<div class="grid grid-cols-1 sm:grid-cols-10 gap-x-8">
14+
<div class="grid grid-cols-1 sm:grid-cols-10 gap-x-4 example-block">
1515
<div
16-
class={`select-none text-sm ${
17-
props.snippet.text ? "pb-4 mt-4 " : " "
18-
} ${
16+
class={`select-none text-sm ${props.snippet.text ? "pb-4" : " "} ${
1917
props.snippet.code
20-
? "italic text-balance col-span-5 sm:col-span-3 md:pb-0"
21-
: "mt-4 col-span-full"
18+
? "italic md:text-balance md:text-right col-span-5 sm:col-span-3 md:pb-0 snippet-comment"
19+
: "col-span-full mt-8"
2220
}`}
2321
>
2422
{props.snippet.text}
@@ -37,7 +35,7 @@ export default function SnippetComponent(props: {
3735
{props.filename}
3836
</span>
3937
)}
40-
<div class="-mx-4 h-full sm:mx-0 overflow-scroll sm:overflow-hidden relative gfm-highlight">
38+
<div class="-mx-4 h-full sm:mx-0 overflow-auto relative gfm-highlight">
4139
{props.snippet.code && (
4240
<div
4341
data-color-mode="light"

examples/scripts/checking_directory_existence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @title Checking for directory existence
33
* @difficulty beginner
44
* @tags cli, deploy
5-
* @run --allow-read --allow-write <url>
5+
* @run -R -W <url>
66
* @group File System
77
*
88
* When creating directories it can be useful to first ensure that

examples/scripts/checking_file_existence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @title Checking for file existence
33
* @difficulty beginner
44
* @tags cli, deploy
5-
* @run --allow-read --allow-write <url>
5+
* @run -R -W <url>
66
* @group File System
77
*
88
* When creating files it can be useful to first ensure that

examples/scripts/create_remove_directories.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @title Creating & removing directories
33
* @difficulty beginner
44
* @tags cli
5-
* @run --allow-write <url>
5+
* @run -W <url>
66
* @resource {https://docs.deno.com/api/deno/~/Deno.mkdir} Doc: Deno.mkdir
77
* @resource {https://docs.deno.com/api/deno/~/Deno.remove} Doc: Deno.remove
88
* @group File System

examples/scripts/data_processing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @difficulty intermediate
44
* @tags cli, deploy
55
* @group Data Processing
6-
* @run --allow-read data-processing.ts
6+
* @run -R data-processing.ts
77
*
88
* Demonstrates using Deno's @std/collections library for processing user data.
99
* This example uses pick, omit, and partition to manipulate data structures.

examples/scripts/dns_queries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @title Running DNS queries
33
* @difficulty beginner
44
* @tags cli, deploy
5-
* @run --allow-net <url>
5+
* @run -N <url>
66
* @resource {https://docs.deno.com/api/deno/~/Deno.resolveDns} Doc: Deno.resolveDns
77
* @resource {https://developer.mozilla.org/en-US/docs/Glossary/DNS} MDN: DNS
88
* @group Network

0 commit comments

Comments
 (0)