Skip to content

Commit d5fb7e4

Browse files
Merge pull request #32 from php-debugger/quick-start-steps
replace the quick start snippet with steps
2 parents 2efbf58 + 419b27c commit d5fb7e4

2 files changed

Lines changed: 44 additions & 37 deletions

File tree

‎src/components/HomeCards/index.js‎

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,12 @@
1-
import {useEffect, useState} from 'react';
21
import Link from '@docusaurus/Link';
3-
import CodeBlock from '@theme/CodeBlock';
4-
import {PLATFORMS, detectPlatform} from '@site/src/lib/installer';
52
import styles from './styles.module.css';
63

7-
function quickStartSnippet(command) {
8-
return `# Install\n${command}\n\n# Debug\nphp your-script.php`;
9-
}
10-
11-
/* Shows the command for the visitor's own OS. The page is prerendered without
12-
knowing it, so this starts on the Unix command and corrects itself after
13-
mounting -- detecting in an effect rather than during render keeps the first
14-
client render identical to the server's, which is what hydration compares. */
15-
function QuickStartSnippet() {
16-
const [platform, setPlatform] = useState('macos');
17-
18-
useEffect(() => {
19-
const detected = detectPlatform();
20-
if (detected) {
21-
setPlatform(detected);
22-
}
23-
}, []);
24-
25-
const active = PLATFORMS.find((p) => p.id === platform) ?? PLATFORMS[0];
26-
27-
return (
28-
<CodeBlock language={active.language}>
29-
{quickStartSnippet(active.command)}
30-
</CodeBlock>
31-
);
32-
}
4+
const quickStartSteps = [
5+
'Install it with one command',
6+
'Start your editor listening',
7+
'Set a breakpoint',
8+
'Run your code as usual',
9+
];
3310

3411
const keyFeatures = [
3512
'Always on — no trigger to set',
@@ -65,9 +42,15 @@ export default function HomeCards() {
6542
title="Quick Start"
6643
linkTo="/getting-started/quick-start"
6744
linkLabel="View quick start guide">
68-
<p>Install it. There is nothing to configure.</p>
69-
<QuickStartSnippet />
70-
<p>Start your editor listening, set a breakpoint, run your code.</p>
45+
<p>Four steps, and nothing to configure.</p>
46+
<ol className={styles.stepList}>
47+
{quickStartSteps.map((step, i) => (
48+
<li key={step}>
49+
<span className={styles.step}>{i + 1}</span>
50+
{step}
51+
</li>
52+
))}
53+
</ol>
7154
</Card>
7255
<Card
7356
icon={

‎src/components/HomeCards/styles.module.css‎

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,33 @@
9898
}
9999
}
100100

101-
/* The installer URL is longer than the card is wide. Wrapping keeps the whole
102-
command visible and copyable rather than clipping it at the card edge. */
103-
.cardBody :global(.theme-code-block) code {
104-
white-space: pre-wrap;
105-
overflow-wrap: anywhere;
101+
/* Numbered steps in the Quick Start card, mirroring the check badges beside the
102+
Key Features list so the two cards read as a pair. */
103+
.stepList {
104+
list-style: none;
105+
padding: 0;
106+
margin: 0;
107+
}
108+
109+
.stepList li {
110+
display: flex;
111+
align-items: baseline;
112+
gap: 0.5rem;
113+
padding: 0.25rem 0;
114+
}
115+
116+
.step {
117+
display: inline-flex;
118+
align-items: center;
119+
justify-content: center;
120+
width: 1.1rem;
121+
height: 1.1rem;
122+
flex-shrink: 0;
123+
border-radius: 50%;
124+
background-color: var(--ifm-color-primary);
125+
color: #fff;
126+
font-size: 0.7rem;
127+
font-weight: 700;
128+
position: relative;
129+
top: 0.15rem;
106130
}

0 commit comments

Comments
 (0)