diff --git a/.github/workflows/docs-dev.yml b/.github/workflows/docs-dev.yml index 862d8f656..d752530f9 100644 --- a/.github/workflows/docs-dev.yml +++ b/.github/workflows/docs-dev.yml @@ -34,9 +34,7 @@ jobs: ./scripts/verify-docs.sh - name: Update docs/index.md with README.md - # This can be a simple copy if https://github.com/github/markup/issues/994 - # is solved. - run: ./scripts/generate-readme.sh + run: uv run ./scripts/generate-readme.py - name: Build site run: | @@ -61,7 +59,7 @@ jobs: run: uv sync --group docs - name: Update docs/index.md with README.md - run: ./scripts/generate-readme.sh + run: uv run ./scripts/generate-readme.py - name: Deploy site run: | diff --git a/.github/workflows/docs-release.yml b/.github/workflows/docs-release.yml index 18544d193..e24dc48ce 100644 --- a/.github/workflows/docs-release.yml +++ b/.github/workflows/docs-release.yml @@ -28,7 +28,7 @@ jobs: run: uv sync --group docs - name: Update docs/index.md with README.md - run: ./scripts/generate-readme.sh + run: uv run ./scripts/generate-readme.py - name: Deploy site run: | diff --git a/README.md b/README.md index 0b1f57ef1..cbf184fef 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ It has a boatload of features, see our [Features page](https://pwndbg.re/pwndbg/ and [CHEATSHEET][CHEATSHEET] (feel free to print it!). If you have any questions you may read the [documentation](https://pwndbg.re/pwndbg/latest/) or asks us in our [Discord server](https://discord.gg/x47DssnGwm). -[CHEATSHEET]: https://drive.google.com/file/d/16t9MV8KTFXK7oX_CzXhmDdaVnjT8IYM4/view?usp=drive_link +[CHEATSHEET]: https://pwndbg.re/pwndbg/latest/CHEATSHEET.pdf ## Why? diff --git a/docs/CHEATSHEET.pdf b/docs/CHEATSHEET.pdf new file mode 100644 index 000000000..1109d9798 Binary files /dev/null and b/docs/CHEATSHEET.pdf differ diff --git a/docs/assets/logo2.png b/docs/assets/logo2.png new file mode 100644 index 000000000..ed2e72c9f Binary files /dev/null and b/docs/assets/logo2.png differ diff --git a/docs/assets/videos/demo.mp4 b/docs/assets/videos/demo.mp4 new file mode 100644 index 000000000..f08c21941 Binary files /dev/null and b/docs/assets/videos/demo.mp4 differ diff --git a/docs/assets/videos/demo.tape b/docs/assets/videos/demo.tape new file mode 100644 index 000000000..5076ae8c9 --- /dev/null +++ b/docs/assets/videos/demo.tape @@ -0,0 +1,67 @@ +# https://github.com/charmbracelet/vhs + +Output demo.mp4 +Output demo.webm + +Set FontSize 20 +Set Width 1920 +Set Height 1080 +Set TypingSpeed 100ms + +Sleep 1s +Type "pwndbg /bin/sh" +Enter +Sleep 2s +Type "start" +Enter +Sleep 3s +Type "ni" +Sleep 2s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Type "nextcall" +Sleep 3s +Enter 1 +Sleep 10s +Type "b *$rdi" +Sleep 1s +Enter 1 +Sleep 2s +Type "continue" +Sleep 1s +Enter 1 +Sleep 4s +Type "nextcall" +Sleep 1s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Enter 1 +Sleep 1s +Type "stepsyscall" +Sleep 1s +Enter 1 +Sleep 10s +Type "checksec" +Sleep 1s +Enter 1 +Sleep 5s +Type "vmmap" +Sleep 1s +Enter 1 +Sleep 5s +Type "exit" +Sleep 1s +Enter +Sleep 2s diff --git a/docs/assets/videos/demo.webm b/docs/assets/videos/demo.webm new file mode 100644 index 000000000..44ae75628 Binary files /dev/null and b/docs/assets/videos/demo.webm differ diff --git a/mkdocs.yml b/mkdocs.yml index ababe1793..8e0779411 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -56,7 +56,7 @@ theme: - search.share # https://squidfunk.github.io/mkdocs-material/setup/adding-a-git-repository/#code-actions # Adds an edit button to every page that links to the repository. - - content.action.edit + # - content.action.edit # Extra # Sync the content tab selection across the whole site (based on label). - content.tabs.link diff --git a/scripts/generate-readme.py b/scripts/generate-readme.py new file mode 100755 index 000000000..c7205642b --- /dev/null +++ b/scripts/generate-readme.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +""" +Transform the README.md to look good on the +documentation page. +""" + +from __future__ import annotations + +hide_nav = """--- +hide: + - navigation +--- +""" + +gif = """ + +""" + + +def main(): + README_PATH = "README.md" + TARGET_PATH = "./docs/index.md" + + with open(README_PATH, "r") as readmefile: + readme = readmefile.read() + + assert ( + readme.splitlines()[0].startswith("![repository-open-graph](") + and "The first line of the README.md has changed. Is it still safe to replace it?" + ) + + # Delete the first line + readme = readme.split("\n", 1)[1] + + # Hide navigation on the doc page + preamble = hide_nav + # Add logo + preamble += "\n![logo](assets/logo2.png){ style='width: 100%'}\n" + + readme = preamble + readme + + # Add gif after first paragraph + assert "## Why?" in readme + readme = readme.replace("## Why?\n", gif + "\n## Why?\n") + + # Write to target file. + with open(TARGET_PATH, "w") as docsindex: + docsindex.write(readme) + + +if __name__ == "__main__": + main() diff --git a/scripts/generate-readme.sh b/scripts/generate-readme.sh deleted file mode 100755 index e84db46a1..000000000 --- a/scripts/generate-readme.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -rm ./docs/index.md -echo "--- -hide: - - navigation ---- -" > ./docs/index.md - -cat ./README.md >> ./docs/index.md