diff --git a/bin/docs/Configuration_Guide.pdf b/bin/docs/Configuration_Guide.pdf index 4f1c1ae8a4..cadafc5827 100644 Binary files a/bin/docs/Configuration_Guide.pdf and b/bin/docs/Configuration_Guide.pdf differ diff --git a/pcsx2/Docs/Configuration_Guide/Configuration_Guide.md b/pcsx2/Docs/Configuration_Guide/Configuration_Guide.md index 61137f3301..5a2c439a0d 100644 --- a/pcsx2/Docs/Configuration_Guide/Configuration_Guide.md +++ b/pcsx2/Docs/Configuration_Guide/Configuration_Guide.md @@ -1,9 +1,9 @@ ---- + # PCSX2 First Time Setup and Configuration This guide will walk through the initial setup process of PCSX2 and the basics of configuration. diff --git a/pcsx2/Docs/Debugger.md b/pcsx2/Docs/Debugger.md index bce5a28ebf..2bed7f2249 100644 --- a/pcsx2/Docs/Debugger.md +++ b/pcsx2/Docs/Debugger.md @@ -1,9 +1,9 @@ ---- + # Debugger Key Bindings diff --git a/pcsx2/Docs/GameIndex.md b/pcsx2/Docs/GameIndex.md index ed64138ec7..5b6e83d597 100644 --- a/pcsx2/Docs/GameIndex.md +++ b/pcsx2/Docs/GameIndex.md @@ -1,9 +1,9 @@ ---- + # GameDB Documentation diff --git a/pcsx2/Docs/PCSX2_FAQ.md b/pcsx2/Docs/PCSX2_FAQ.md index d351273dd6..065459f9dc 100644 --- a/pcsx2/Docs/PCSX2_FAQ.md +++ b/pcsx2/Docs/PCSX2_FAQ.md @@ -1,9 +1,9 @@ ---- + # PCSX2 - Frequently Asked Questions diff --git a/pcsx2/Docs/gen-docs.sh b/pcsx2/Docs/gen-docs.sh index 92cda5039d..2dc18d7b95 100755 --- a/pcsx2/Docs/gen-docs.sh +++ b/pcsx2/Docs/gen-docs.sh @@ -5,25 +5,37 @@ LATEST_SEMVER=$(git -c 'versionsort.suffix=-' ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/PCSX2/pcsx2.git 'v*[0-9].*[0-9].*[0-9]' | tail --lines=1 | cut --delimiter='/' --fields=3) OUT_DIR=${OUT_DIR:-"../../bin/docs"} +GIT_TAG_PATTERN="{LATEST-GIT-TAG}" +PDF_METADATA_START_PATTERN="" ## Generate and Move Markdown->PDFs -### Configuration Guide +prepare_markdown_file() { + ORIG_FILE="$1".md + TEMP_FILE="$1".temp.md + TEMPLATE_FILE="$2" + OUTPUT_PDF_FILE="$1".pdf + cp "$ORIG_FILE" "$TEMP_FILE" + # Make PDF Metadata Visible + sed -i 's/'"$PDF_METADATA_START_PATTERN"'//' "$TEMP_FILE" + sed -i 's/'"$PDF_METADATA_END_PATTERN"'//' "$TEMP_FILE" + # Update Git Tag + sed -i 's/'"$GIT_TAG_PATTERN"'/'"$LATEST_SEMVER"'/' "$TEMP_FILE" + # Render PDF + pandoc --template "$TEMPLATE_FILE" --toc "$TEMP_FILE" -o "$OUTPUT_PDF_FILE" + # Delete Temp File + rm "$TEMP_FILE" +} + +### Configuration Guide, handled differently as it's in it's own folder pushd ./Configuration_Guide -cp Configuration_Guide.md Configuration_Guide.temp.md -sed -i 's/{LATEST-GIT-TAG}/'"$LATEST_SEMVER"'/' Configuration_Guide.temp.md -pandoc --template ../eisvogel.tex --toc Configuration_Guide.temp.md -o Configuration_Guide.pdf -rm Configuration_Guide.temp.md +prepare_markdown_file "Configuration_Guide" "../eisvogel.tex" popd mv -f ./Configuration_Guide/Configuration_Guide.pdf "$OUT_DIR" ### The rest! - find . -maxdepth 1 -name "*.md" -not -path "./README.md" | while read filename; do filename="${filename%.*}" - cp "$filename.md" "$filename.temp.md" - sed -i 's/{LATEST-GIT-TAG}/'"$LATEST_SEMVER"'/' "$filename.temp.md" - pandoc --template ./eisvogel.tex --toc "$filename.temp.md" -o "$filename.pdf" - mv -f "$filename.pdf" "$OUT_DIR" - rm "$filename.temp.md" + prepare_markdown_file "$filename" "eisvogel.tex" done