From b849f7bb33238b8d34fd5d29e41f7a7ed4872b2e Mon Sep 17 00:00:00 2001 From: shenhuan2021 <33363287+shenhuan2021@users.noreply.github.com> Date: Sun, 12 Jan 2025 21:04:14 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d15919..3029c1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,13 +18,20 @@ jobs: - name: Install pandoc and LaTeX run: | - sudo apt-get install -y pandoc texlive-xetex texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra - - - name: Merge Markdown files + sudo apt-get update + sudo apt-get install -y pandoc texlive-xetex texlive-fonts-recommended texlive-fonts-extra texlive-latex-extra tree imagemagick + + - name: Generate documentation tree image + run: | + tree doc -I 'node_modules|.git' -L 2 -o tree.txt + convert -density 150 tree.txt -trim tree.png + + - name: Merge Markdown files and insert tree image run: | touch combined.md - cat doc/readme.md > combined.md - find doc -type f -name "*.md" ! -name "readme.md" !-name "doc-tree.md" | sort | xargs -I {} sh -c 'cat "$@" >> combined.md' _ {} + echo "![](tree.png)" > combined.md + cat doc/readme.md >> combined.md + find doc -type f -name "*.md" ! -name "readme.md" ! -name "doc-tree.md" | sort | xargs -I {} sh -c 'cat "$@" >> combined.md' _ {} - name: Convert README.md to README.pdf run: pandoc combined.md -o README.pdf --pdf-engine=xelatex