Skip to content

Commit 0432416

Browse files
committed
If PDF file is too small, return error; add workaround for problematic warning
When generating PDF of the docs site, if a warning admonition spreads from one page to the next one, pdf conversion silently crashes. After pdf generation, let's check the PDF file size. As a short-term workaround in our documentation, let's split the problematic warning admonition in two paragraphs.
1 parent dc31138 commit 0432416

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
beautifulsoup4
3939
- run: make home
4040
- run: make pdf
41+
- run: make pdf-test
4142
- run: make zip
4243
#- run: make test
4344
- run: mkdocs gh-deploy --force

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ TAGS=content/developer/ejabberd-api/admin-tags.md
3434
PDFNAME=ejabberd-docs-$(VERSION).pdf
3535
PDF=content/ejabberd-docs.pdf
3636
PDFV=content/$(PDFNAME)
37+
PDF_SIZE=$(shell stat -c %s $(PDFV))
3738

3839
ZIPNAME=ejabberd-docs-$(VERSION).zip
3940
ZIP=content/ejabberd-docs.zip
@@ -55,6 +56,7 @@ help:
5556
@echo ""
5657
@echo " site Generate site as HTML files"
5758
@echo " pdf Generate PDF file of the offline site"
59+
@echo " pdf-test Test the PDF file size (more than 3MB)"
5860
@echo " zip Generate ZIP file of the offline site"
5961
@echo ""
6062
@echo " serve Start MkDocs web server"
@@ -300,12 +302,15 @@ site:
300302
OFFLINE=true mkdocs build
301303
find site/* -type f \! -exec sed -i 's/href="\(.*\)" \(title="ejabberd Docs"\)/href="\1\/index.html" \2/g' {} \;
302304

303-
pdf: $(PDF)
305+
pdf: $(PDFV)
304306

305-
$(PDF):
307+
$(PDFV):
306308
WITH_PDF=1 mkdocs build
307309
mv $(PDF) $(PDFV)
308310

311+
pdf-test: $(PDFV)
312+
[ $(PDF_SIZE) -gt 3000000 ] || exit 1
313+
309314
zip: $(ZIP)
310315

311316
$(ZIP): site

content/admin/configuration/modules.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3134,7 +3134,11 @@ identity verification based on DNS.
31343134

31353135
DNS-based verification is vulnerable to [DNS cache
31363136
poisoning](https://en.wikipedia.org/wiki/DNS_spoofing), so modern
3137-
servers rely on verification based on PKIX certificates. Thus this
3137+
servers rely on verification based on PKIX certificates.
3138+
3139+
!!! warning
3140+
3141+
This
31383142
module is only recommended for backward compatibility with servers
31393143
running outdated software or non-TLS servers, or those with invalid
31403144
certificates (as long as you accept the risks, e.g. you assume that

0 commit comments

Comments
 (0)