Skip to content

Commit

Permalink
Fetch content from README
Browse files Browse the repository at this point in the history
  • Loading branch information
nikoshell committed Jan 22, 2025
1 parent f3d2d30 commit 6a570d9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 29 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"astro": "astro"
},
"dependencies": {
"astro": "^4.0.9"
}
"astro": "^4.0.9",
"marked": "^15.0.6"
},
"packageManager": "[email protected]+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a"
}
1 change: 1 addition & 0 deletions src/env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />
30 changes: 30 additions & 0 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,34 @@ const { title } = Astro.props;
Courier New,
monospace;
}


pre {
display: block;
width: auto;
overflow: auto;
word-wrap: normal;
}

pre > code {
display: block;
font-size: 1.0rem;

text-indent: 0;
white-space: inherit;
}


a{
color:#FC4E77;
}

a:hover{
color:#fd88c1;
}

a:visited{
color:#8A29BD;
}

</style>
40 changes: 13 additions & 27 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,27 @@ import Card from '../components/Card.astro';
const response = await fetch('https://api.github.com/repos/pwndbg/pwndbg/releases/latest');
const data = await response.json();
const latest_tag_name = data.tag_name;
import { marked } from 'marked';
const readme_content = await fetch('https://raw.githubusercontent.com/pwndbg/pwndbg/dev/README.md');
const markdown = await readme_content.text();
// Extract the content starting from "pwndbg" to the end
const startIndex = markdown.indexOf('`pwndbg`');
const extractedMarkdown = startIndex !== -1 ? markdown.slice(startIndex) : markdown;
// Parse the extracted Markdown content
const content = marked.parse(extractedMarkdown);
---

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

<p>
Pwndbg makes debugging with GDB and LLDB suck less. It improves debugging experience
for low-level developers, hardware hackers, reverse engineers, and exploit developers.
It is useful for security research and provides features crucial for efficient debugging
in the world of low-level programming.
</p>

<img src="/demo.gif" alt="Demo pwndbg" />

<h2>Getting started</h2>
<pre><code>
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh
</code></pre>
<article set:html={content} />

<p class="instructions">
We supports various Linux distributions.<br />
Expand Down Expand Up @@ -130,17 +129,4 @@ cd pwndbg
}


pre {
display: block;
width: auto;
overflow: auto;
word-wrap: normal;
}

pre > code {
display: block;
font-size: 1.0rem;
text-indent: 0;
white-space: inherit;
}
</style>

0 comments on commit 6a570d9

Please sign in to comment.