From 833c4325fc335ad99db4c3ec9bc9e9fc24f4d881 Mon Sep 17 00:00:00 2001 From: jon gadsden Date: Tue, 2 May 2023 16:35:32 +0100 Subject: [PATCH] create epub and pdf on commit and PR --- .github/workflows/ci.yaml | 35 +++++++++++++++++++++++++++++++++++ .gitignore | 9 +++++---- draft/title.pdf.yaml | 16 ++++++++++++++++ draft/title.yaml | 12 ++++++++++++ draft/toc.md | 1 - 5 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 draft/title.pdf.yaml create mode 100644 draft/title.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3a8760ff..9c8149e6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,3 +25,38 @@ jobs: fail: true env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + export_draft: + name: Export epub and pdf (Draft) + runs-on: ubuntu-22.04 + needs: [link_checker] + steps: + - name: Checkout markdown + uses: actions/checkout@v3.4.0 + + - name: Combine markdown + run: | + tail --lines=+14 --quiet draft/0*.md draft/0**/0*.md > draft.markdown + mkdir -p publish + + - name: Export to pdf + uses: docker://pandoc/latex:3.1 + with: + args: >- + --output=publish/OWASP_Developer_Guide.draft.pdf + draft/title.pdf.yaml + draft.markdown + + - name: Export to epub + uses: docker://pandoc/latex:3.1 + with: + args: >- + --output=publish/OWASP_Developer_Guide.draft.epub + draft/title.yaml + draft.markdown + + - name: Save pdfs and epubs + uses: actions/upload-artifact@master + with: + name: export-draft + path: publish diff --git a/.gitignore b/.gitignore index f804b7d5..bc0fa8b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ * # allow github, workflows and templates -!.github +!.github/ !.github/**/* !.gitignore !.lycheeignore @@ -10,13 +10,14 @@ # allow jekyll build files !404.html !_config.yml -!_data +!_data/ !_data/*.yaml -!_includes +!_includes/ !_includes/*.html # draft version -!draft +!draft/ +!draft/title*.yaml !draft/** !draft/**/*.md !draft/assets/images/*.png diff --git a/draft/title.pdf.yaml b/draft/title.pdf.yaml new file mode 100644 index 00000000..6de0a177 --- /dev/null +++ b/draft/title.pdf.yaml @@ -0,0 +1,16 @@ +--- +lang: en-US +author: Open Worldwide Application Security Project (OWASP) +version: Draft +date: February 2023 onwards +rights: Creative Commons Attribution ShareAlike 4.0 International (CC BY-SA 4.0) +geometry: "left=3cm,right=2.5cm,top=2cm,bottom=2cm" +header-includes: | + \usepackage{fancyhdr} + \pagestyle{fancy} + \fancyhead{} + \fancyhead[RE,RO]{February 2023 onwards} + \fancyfoot{} + \fancyfoot[LE,LO]{Draft version} + \fancyfoot[RE,RO]{\thepage} +... diff --git a/draft/title.yaml b/draft/title.yaml new file mode 100644 index 00000000..938f4b42 --- /dev/null +++ b/draft/title.yaml @@ -0,0 +1,12 @@ +--- +lang: en-US +title: +- type: main + text: Developer Guide +creator: +- role: author + text: Open Worldwide Application Security Project (OWASP) +version: Draft +date: February 2023 onwards +rights: Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) +... diff --git a/draft/toc.md b/draft/toc.md index d430cafb..bfb91506 100644 --- a/draft/toc.md +++ b/draft/toc.md @@ -3,7 +3,6 @@ title: Table of Contents layout: col-document tags: OWASP Developer Guide -author: contributors: document: OWASP Developer Guide order: 0