Exports PPL documentation to the OpenSearch documentation website. Auto-injects Jekyll front-matter, converts SQL CLI tables to markdown, fixes relative links, and adds copy buttons.
sql/
├── docs/user/ppl/ <-- SOURCE
├── scripts/docs_exporter/ <-- THIS TOOL
documentation-website/ <-- MUST BE SIBLING OF sql/
└── _sql-and-ppl/ppl/ <-- DESTINATION
cd /path/to/sql/../
git clone https://github.com/opensearch-project/documentation-website.gitcd documentation-website
git fetch origin
git rebase origin/mainAs of Dec 17 2025, the migration to auto-export for documentation-website is ongoing.
Currently select directories (e.g. docs/user/ppl/cmd) are only exported to documentation-website.
# Export only cmd/
./export_to_docs_website.py --only-dirs cmd
# Export cmd/ and functions/
./export_to_docs_website.py --only-dirs cmd,functionscd sql/scripts/docs_exporter
./export_to_docs_website.pycd documentation-website
git diff
git add -A
git commit -m "Update PPL documentation"Example: opensearch-project/documentation-website#11688
- Injects Jekyll front-matter (title, parent, nav_order, etc.)
- Converts SQL CLI table output to markdown tables
- Removes empty tables and their surrounding whitespace
- Escapes angle brackets and asterisks in table cells for Jekyll compatibility
- Converts
docs.opensearch.orglinks to Jekyll site variables - Fixes relative links to use
{{site.url}}{{site.baseurl}} - Handles anchor normalization (removes dots)
- Converts
pplcode fences tosql - Converts
bash ignorecode blocks tojsonwith curl copy buttons - Adds copy buttons to code blocks
- Converts markdown emphasis (Note, Warning, Important) to Jekyll attribute syntax
- Rolls up third-level directories to avoid Jekyll rendering limitations
