Skip to content

Commit 0a5c431

Browse files
committed
render images correctly in pdf and epub outputs
1 parent 290c814 commit 0a5c431

File tree

8 files changed

+28
-39
lines changed

8 files changed

+28
-39
lines changed

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
draft.markdown
8181
8282
- name: Save pdfs and epubs
83-
uses: actions/[email protected].0
83+
uses: actions/[email protected].4
8484
with:
8585
name: export-draft
8686
path: publish

.github/workflows/release.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
- v?.?.?*
88
workflow_dispatch:
99

10+
env:
11+
RESOURCE_PATH: release/assets/images:release/assets:release:assets/images:assets/images/logos:assets/images/logos/publish
12+
1013
# for security reasons the github actions are pinned to specific release versions
1114
jobs:
1215
create_artifacts:
@@ -31,34 +34,37 @@ jobs:
3134
find draft -name "*.md" -exec sed -i "/edit on GitHub/d" {} +
3235
find draft -name "*.md" -exec sed -i "/www-project-developer-guide\/issues\/new?labels/d" {} +
3336
find draft -name "*.md" -exec sed -i "/www-project-developer-guide\/blob\/main/d" {} +
37+
find draft -name "*.md" -exec sed -i "s/{: .image-right }/{height=180px}/g" {} +
3438
3539
- name: Combine markdown
3640
run: |
37-
tail --lines=+14 -q $(find draft -name "*[0-9]*.md" | sort) > release.markdown
38-
mkdir -p publish
41+
mkdir publish
42+
mkdir assets/images/logos/publish
43+
mkdir release/publish
44+
tail --lines=+14 -q $(find draft -name "*[0-9]*.md" | sort) > release/publish/draft.markdown
3945
4046
- name: Export to pdf
4147
uses: docker://pandoc/latex:3.1
4248
with:
4349
args: >-
4450
--from=markdown
4551
--output=publish/OWASP_Developer_Guide.pdf
46-
--resource-path="release/assets/images:release/assets:release"
52+
--resource-path=${{ env.RESOURCE_PATH }}
4753
release/title.pdf.yaml
48-
release.markdown
54+
release/publish/draft.markdown
4955
5056
- name: Export to epub
5157
uses: docker://pandoc/latex:3.1
5258
with:
5359
args: >-
5460
--from=markdown
5561
--output=publish/OWASP_Developer_Guide.epub
56-
--resource-path="release/assets/images:release/assets:release"
62+
--resource-path=${{ env.RESOURCE_PATH }}
5763
release/title.yaml
58-
release.markdown
64+
release/publish/draft.markdown
5965
6066
- name: Store pdf and epub assets
61-
uses: actions/[email protected].0
67+
uses: actions/[email protected].4
6268
with:
6369
name: export-docs
6470
path: publish

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,5 @@
7171
!assets/images/*.png
7272
!assets/images/logos/
7373
!assets/images/logos/*.png
74-
!assets/images/logos/*.svg
7574
!license.txt
7675

59.6 KB
Loading

assets/images/logos/securecodebox.svg

Lines changed: 0 additions & 25 deletions
This file was deleted.

contributing.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,21 @@ To run these checks locally before pushing a commit, run these commands from the
9797
1. Link checker: `lychee --max-retries 5 --exclude-path './_includes/*.html' './**/*.md'`
9898
2. Markdown linter: `markdownlint-cli2 **/*.md`
9999
3. Spell checker: `pyspelling --config .spellcheck.yaml`
100-
4. commands to create PDF and ePub outputs:
100+
4. commands to set up the environment for PDF and ePub export
101101

102102
```text
103-
tail -n +14 -q $(find draft -name "*[0-9]*.md" | sort) > draft.markdown
104-
pandoc -f markdown -o draft.pdf --resource-path="draft/assets/images:draft/assets:draft" draft/title.pdf.yaml draft.markdown
105-
pandoc -f markdown -o draft.epub --resource-path="draft/assets/images:draft/assets:draft" draft/title.yaml draft.markdown
103+
mkdir draft/publish
104+
mkdir assets/images/logos/publish
105+
export RESOURCE_PATH="draft/assets/images:draft/assets:draft:assets/images/logos:assets/images:assets/images/logos/publish"
106+
```
107+
108+
and the commands to create PDF and ePub outputs, a subset of those in `release.yaml` :
109+
110+
```text
111+
tail -n +14 -q $(find draft -name "*[0-9]*.md" | sort) > draft/publish/draft.markdown
112+
find draft -name "draft.markdown" -exec sed -i "s/{\: .image-right }/{height=180px}/g" {} +
113+
pandoc -f markdown -o draft.pdf --resource-path="$RESOURCE_PATH" draft/title.pdf.yaml draft/publish/draft.markdown
114+
pandoc -f markdown -o draft.epub --resource-path="$RESOURCE_PATH" draft/title.yaml draft/publish/draft.markdown
106115
```
107116

108117
Follow instructions to install the command line [lychee][lychee-install] and [pandoc][pandoc-install].

draft/08-verification/03-frameworks/01-secure-codebox.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ permalink: /draft/verification/frameworks/secure_codebox/
1212

1313
{% include breadcrumb.html %}
1414

15-
![SecureCodeBox logo](../../../../assets/images/logos/securecodebox.svg "OWASP SecureCodeBox"){: height="180px" }
15+
![SecureCodeBox logo](../../../../assets/images/logos/securecodebox.png "OWASP SecureCodeBox"){: height="180px" }
1616

1717
#### 6.3.1 secureCodeBox
1818

draft/assets/images/dg_wip.png

-16.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)