Skip to content

feat: auto-install pandoc in build.sh for Cloudflare Pages#139

Merged
pierzchala-m merged 2 commits intomasterfrom
feature/auto-install-pandoc
Mar 24, 2026
Merged

feat: auto-install pandoc in build.sh for Cloudflare Pages#139
pierzchala-m merged 2 commits intomasterfrom
feature/auto-install-pandoc

Conversation

@wreiske
Copy link
Member

@wreiske wreiske commented Mar 24, 2026

Problem

15 markdown files (synced from Google Drive via WikiGDrive) declare markup: 'pandoc' in their front matter. This tells Hugo to use pandoc as an external renderer — required for pandoc-specific features like lettered sub-lists (a., b., c.<ol type="a">).

Pandoc is not available in the Cloudflare Pages build environment, causing these pages to fail rendering.

Solution

Add an ensure_pandoc() function to build.sh that runs before Hugo:

  • Skips download if pandoc is already on $PATH (local dev, self-hosted runners)
  • Downloads pandoc 3.6.4 static binary from GitHub releases when not found
  • Detects OS/arch automatically: Linux amd64/arm64, macOS x86_64/arm64
  • Extracts to .pandoc/ and prepends to $PATH
  • $PANDOC_DIR env var allows CI to override the install location for caching

Also adds .pandoc/ to .gitignore.

Affected files with markup: 'pandoc'

15 files
  • content/resources/intro-to-the-system/system-anatomy.md
  • content/rapid-deployment/review-sessions/review-session-pre-placement.md
  • content/features/system-administration/interfaces/outbound-interface-install-instructions.md
  • content/features/system-administration/interfaces/query-odg-integration.md
  • content/features/system-administration/system-controls/new-provider-configuration-recommendations.md
  • content/features/document-management/scanning-and-indexing/scanner-cleaning.md
  • content/features/document-management/imaging/inbound-application-installation-dicomd.md
  • content/features/system-administration/system-controls/terminated-provider-configuration-recommendations.md
  • content/features/financial-functionality/viewing-expired-fee-schedules.md
  • content/features/quality-of-care/measures/quality-measure-specifications-and-recommended-workflows/cms-165-controlling-high-blood-pressure.md
  • content/features/document-management/send-document.md
  • content/features/quality-of-care/measures/quality-measure-specifications-and-recommended-workflows/cms-122-diabetes-hemoglobin-a1c-hba1c-poor-control-greater9.md
  • content/features/quality-of-care/measures/quality-measure-specifications-and-recommended-workflows/cms-124-cervical-cancer-screening.md
  • content/features/quality-of-care/measures/quality-measure-specifications-and-recommended-workflows/cms-2-preventive-care-and-screening-screening-for-depression-and-follow-up-plan-workflow.md
  • content/features/fax-manager/incoming-file-fax-q-set-up-and-documentation.md

Testing

  • Verified locally: ./build.sh eh completes successfully (1942 pages)
  • Confirmed pandoc-rendered pages produce correct HTML (e.g., <ol type="a"> for lettered sub-lists)
Screenshot 2026-03-24 at 11 08 40 AM

Some markdown files (from WikiGDrive) use markup: 'pandoc' in front matter
for pandoc-specific features like lettered sub-lists. Pandoc is not available
in the Cloudflare Pages build environment.

Add ensure_pandoc() to build.sh that:
- Skips download if pandoc is already on PATH
- Downloads pandoc 3.6.4 static binary from GitHub releases
- Detects OS/arch (Linux amd64/arm64, macOS x86_64/arm64)
- Extracts to .pandoc/ and prepends to PATH

Also adds .pandoc/ to .gitignore.
@github-actions
Copy link

👋 @wreiske, Your documentation has been pushed to https://docs-qa.med-web.com/139-merge/ for commit 3d7c6b6

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 24, 2026

Deploying eh-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f220eb9
Status: ✅  Deploy successful!
Preview URL: https://02fe18b9.eh-docs.pages.dev
Branch Preview URL: https://feature-auto-install-pandoc.eh-docs.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 24, 2026

Deploying wc-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f220eb9
Status: ✅  Deploy successful!
Preview URL: https://92b30353.wc-docs.pages.dev
Branch Preview URL: https://feature-auto-install-pandoc.wc-docs.pages.dev

View logs

@wreiske
Copy link
Member Author

wreiske commented Mar 24, 2026

Screenshot 2026-03-24 at 9 36 09 AM

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds automatic provisioning of the Pandoc binary during site builds so Hugo can render Markdown files that specify markup: 'pandoc' in front matter—addressing Cloudflare Pages environments where Pandoc isn’t preinstalled.

Changes:

  • Introduces ensure_pandoc() in build.sh to detect/download Pandoc and prepend it to PATH.
  • Adds .pandoc/ to .gitignore so downloaded artifacts aren’t committed.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 6 comments.

File Description
build.sh Adds an ensure_pandoc() bootstrap step that downloads Pandoc when missing to support Hugo’s pandoc-based rendering.
.gitignore Ignores the local .pandoc/ installation directory produced by the build script.

- Accept both aarch64 and arm64 for Linux ARM64 detection
- Use curl with wget fallback instead of hard wget dependency
- Add SHA256 checksum verification for downloaded binaries
- Only run ensure_pandoc when wc/eh target is specified
- Fix macOS ZIP nested directory extraction
- Check cached PANDOC_DIR before re-downloading
- Use case statement instead of declare -A for bash 3.2 compat
@github-actions
Copy link

👋 @wreiske, Your documentation has been pushed to https://docs-qa.med-web.com/139-merge/ for commit f4f5fc4

@pierzchala-m pierzchala-m enabled auto-merge (rebase) March 24, 2026 18:25
@pierzchala-m pierzchala-m merged commit 5cbeb3f into master Mar 24, 2026
5 checks passed
@pierzchala-m pierzchala-m deleted the feature/auto-install-pandoc branch March 24, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Published page Query ODG Integration is not what Google Drive version looks like and I cannot publish any edits to same page

3 participants