diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 56bdc2d0..33a4ba6b 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,14 +10,16 @@ on: jobs: check-manpage: runs-on: ubuntu-20.04 - name: Check manpage + name: Check docs steps: - uses: actions/checkout@v3 - name: Install build dependencies run: | + sudo add-apt-repository -y universe + sudo add-apt-repository -y ppa:inkscape.dev/stable sudo apt-get update - sudo apt-get -y install libunwind-dev binutils-dev libiberty-dev help2man + sudo apt-get -y install libunwind-dev binutils-dev libiberty-dev help2man inkscape - name: Compile Austin run: | @@ -25,10 +27,10 @@ jobs: ./configure make - - name: Generate manpage - run: bash doc/genman.sh + - name: Generate docs + run: bash doc/gen.sh - - name: Check manpage + - name: Check docs run: git diff -I".* DO NOT MODIFY.*" -I"[.]TH AUSTIN.*" --exit-code src/austin.1 cppcheck-linux: diff --git a/doc/cheatsheet.pdf b/doc/cheatsheet.pdf index e6a912ef..e63be2e9 100644 Binary files a/doc/cheatsheet.pdf and b/doc/cheatsheet.pdf differ diff --git a/doc/cheatsheet.png b/doc/cheatsheet.png index fecbd6fb..8c1bccd3 100644 Binary files a/doc/cheatsheet.png and b/doc/cheatsheet.png differ diff --git a/doc/gen.sh b/doc/gen.sh new file mode 100755 index 00000000..95270082 --- /dev/null +++ b/doc/gen.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +help2man \ + -n "Frame stack sampler for CPython" \ + -i doc/examples.troff \ + src/austin > src/austin.1 + +VERSION=$(cat src/austin.h | sed -r -n "s/^#define VERSION[ ]+\"([0-9]+[.][0-9]+).*\"/\1/p") + +# Update the version in the SVG file +if [[ $(uname) == "Darwin" ]]; then + sed -E -i '' "s/for version [0-9]+[.][0-9]+/for version $VERSION/g" "doc/cheatsheet.svg" +else + sed -i "s/for version [0-9]+[.][0-9]+/for version $VERSION/g" "doc/cheatsheet.svg" +fi + +inkscape \ + --export-type="png" \ + --export-filename="doc/cheatsheet.png" \ + --export-dpi=192 \ + doc/cheatsheet.svg + +inkscape \ + --export-type="pdf" \ + --export-filename="doc/cheatsheet.pdf" \ + doc/cheatsheet.svg diff --git a/doc/genman.sh b/doc/genman.sh deleted file mode 100755 index c6b9a8fd..00000000 --- a/doc/genman.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -help2man \ - -n "Frame stack sampler for CPython" \ - -i doc/examples.troff \ - src/austin > src/austin.1 diff --git a/src/austin.1 b/src/austin.1 index 5d1433b5..9882016e 100644 --- a/src/austin.1 +++ b/src/austin.1 @@ -1,5 +1,5 @@ .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3. -.TH AUSTIN "1" "February 2024" "austin 3.7.0" "User Commands" +.TH AUSTIN "1" "October 2024" "austin 3.7.0" "User Commands" .SH NAME austin \- Frame stack sampler for CPython .SH SYNOPSIS