Skip to content

Commit 6a570d9

Browse files
committed
Fetch content from README
1 parent f3d2d30 commit 6a570d9

File tree

4 files changed

+48
-29
lines changed

4 files changed

+48
-29
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"astro": "astro"
1111
},
1212
"dependencies": {
13-
"astro": "^4.0.9"
14-
}
13+
"astro": "^4.0.9",
14+
"marked": "^15.0.6"
15+
},
16+
"packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
1517
}

src/env.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/// <reference path="../.astro/types.d.ts" />
12
/// <reference types="astro/client" />

src/layouts/Layout.astro

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,34 @@ const { title } = Astro.props;
4747
Courier New,
4848
monospace;
4949
}
50+
51+
52+
pre {
53+
display: block;
54+
width: auto;
55+
overflow: auto;
56+
word-wrap: normal;
57+
}
58+
59+
pre > code {
60+
display: block;
61+
font-size: 1.0rem;
62+
63+
text-indent: 0;
64+
white-space: inherit;
65+
}
66+
67+
68+
a{
69+
color:#FC4E77;
70+
}
71+
72+
a:hover{
73+
color:#fd88c1;
74+
}
75+
76+
a:visited{
77+
color:#8A29BD;
78+
}
79+
5080
</style>

src/pages/index.astro

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,27 @@ import Card from '../components/Card.astro';
55
const response = await fetch('https://api.github.com/repos/pwndbg/pwndbg/releases/latest');
66
const data = await response.json();
77
const latest_tag_name = data.tag_name;
8+
9+
import { marked } from 'marked';
10+
11+
const readme_content = await fetch('https://raw.githubusercontent.com/pwndbg/pwndbg/dev/README.md');
12+
const markdown = await readme_content.text();
13+
14+
// Extract the content starting from "pwndbg" to the end
15+
const startIndex = markdown.indexOf('`pwndbg`');
16+
const extractedMarkdown = startIndex !== -1 ? markdown.slice(startIndex) : markdown;
17+
18+
// Parse the extracted Markdown content
19+
const content = marked.parse(extractedMarkdown);
820
---
921

1022
<Layout title="Welcome to pwndbg.">
1123
<main>
1224
<h1>Make Debugging Great Again!</h1>
1325
<img id="logo" src="/logo.png" alt="Logo pwndbg" />
1426

15-
<p>
16-
Pwndbg makes debugging with GDB and LLDB suck less. It improves debugging experience
17-
for low-level developers, hardware hackers, reverse engineers, and exploit developers.
18-
It is useful for security research and provides features crucial for efficient debugging
19-
in the world of low-level programming.
20-
</p>
21-
2227
<img src="/demo.gif" alt="Demo pwndbg" />
23-
24-
<h2>Getting started</h2>
25-
<pre><code>
26-
git clone https://github.com/pwndbg/pwndbg
27-
cd pwndbg
28-
./setup.sh
29-
</code></pre>
28+
<article set:html={content} />
3029

3130
<p class="instructions">
3231
We supports various Linux distributions.<br />
@@ -130,17 +129,4 @@ cd pwndbg
130129
}
131130

132131

133-
pre {
134-
display: block;
135-
width: auto;
136-
overflow: auto;
137-
word-wrap: normal;
138-
}
139-
140-
pre > code {
141-
display: block;
142-
font-size: 1.0rem;
143-
text-indent: 0;
144-
white-space: inherit;
145-
}
146132
</style>

0 commit comments

Comments
 (0)