Skip to content

Commit

Permalink
create epub and pdf on commit and PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jon gadsden committed May 2, 2023
1 parent 01a3df6 commit 833c432
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 5 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
*

# allow github, workflows and templates
!.github
!.github/
!.github/**/*
!.gitignore
!.lycheeignore

# 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
Expand Down
16 changes: 16 additions & 0 deletions draft/title.pdf.yaml
Original file line number Diff line number Diff line change
@@ -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}
...
12 changes: 12 additions & 0 deletions draft/title.yaml
Original file line number Diff line number Diff line change
@@ -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)
...
1 change: 0 additions & 1 deletion draft/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
title: Table of Contents
layout: col-document
tags: OWASP Developer Guide
author:
contributors:
document: OWASP Developer Guide
order: 0
Expand Down

0 comments on commit 833c432

Please sign in to comment.