Welcome to Bnd
+Bnd is a swiss army knife for OSGi development.
+Features
+-
+
- Build tool for OSGi bundles +
- Manifest generation +
- Dependency management +
From 568e67e12849527552674f3deedad49906fdf262 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Feb 2026 08:45:34 +0000 Subject: [PATCH 1/6] Add HTML and PDF export scripts for documentation Co-authored-by: peterkir <250545+peterkir@users.noreply.github.com> --- docs/EXPORT_README.md | 240 +++++++++++++++++++++ docs/README.md | 18 ++ docs/bnd-docs.html | 196 +++++++++++++++++ docs/export-pdf.sh | 171 +++++++++++++++ docs/export-single-html.sh | 431 +++++++++++++++++++++++++++++++++++++ docs/test-output.html | 196 +++++++++++++++++ docs/test-output.pdf | Bin 0 -> 68417 bytes 7 files changed, 1252 insertions(+) create mode 100644 docs/EXPORT_README.md create mode 100644 docs/bnd-docs.html create mode 100755 docs/export-pdf.sh create mode 100755 docs/export-single-html.sh create mode 100644 docs/test-output.html create mode 100644 docs/test-output.pdf diff --git a/docs/EXPORT_README.md b/docs/EXPORT_README.md new file mode 100644 index 0000000000..c3653decc4 --- /dev/null +++ b/docs/EXPORT_README.md @@ -0,0 +1,240 @@ +# Exporting Documentation + +This directory contains scripts to export the Bnd documentation to single HTML or PDF files for offline viewing, archiving, or distribution. + +## Quick Start + +### Prerequisites + +1. **Build the documentation first:** + ```bash + ./build.sh + ``` + This generates the static HTML site in the `_site` directory. + +2. **For PDF export, install a PDF generation tool (optional):** + - **wkhtmltopdf** (recommended): `sudo apt-get install wkhtmltopdf` + - **weasyprint**: `pip install weasyprint` + - **Chromium/Chrome**: Available on most systems + - Or use browser's "Print to PDF" feature + +## Usage + +### Export to Single HTML + +Create a single, self-contained HTML file with all documentation: + +```bash +# Export master branch documentation +./export-single-html.sh + +# Export specific version +./export-single-html.sh 7.0.0 + +# Export with custom output filename +./export-single-html.sh master my-docs.html +``` + +**Output:** `bnd-docs-{version}.html` + +Features: +- Complete table of contents with clickable links +- All documentation in a single file +- Print-friendly CSS styles +- Works offline +- Can be opened in any web browser + +### Export to PDF + +Create a PDF file from the documentation: + +```bash +# Export master branch documentation +./export-pdf.sh + +# Export specific version +./export-pdf.sh 7.0.0 + +# Export with custom output filename +./export-pdf.sh master my-docs.pdf +``` + +**Output:** `bnd-docs-{version}.pdf` + +The script will: +1. Auto-detect available PDF generation tools +2. Create a single HTML file (temporary) +3. Convert it to PDF +4. Clean up temporary files + +If no PDF tool is installed, the script will create an HTML file with instructions for manual PDF conversion. + +## Exporting Specific Versions + +To export documentation for a specific release version: + +1. **Switch to the release branch or tag:** + ```bash + cd .. # Go to repository root + git checkout 7.0.0 # Or any version tag + cd docs + ``` + +2. **Build the documentation for that version:** + ```bash + ./build.sh + ``` + +3. **Export:** + ```bash + ./export-single-html.sh 7.0.0 + ./export-pdf.sh 7.0.0 + ``` + +## Exporting Release Documentation + +For archived releases in the `releases/` folder: + +```bash +# If you want to export a specific archived release +# You need to adjust the scripts to point to releases/{version} folder +# Or manually navigate to that folder's HTML +``` + +## Manual PDF Generation + +If you prefer to create PDFs manually: + +1. Create the HTML file: + ```bash + ./export-single-html.sh + ``` + +2. Open the HTML file in your browser: + ```bash + open bnd-docs-master.html # macOS + xdg-open bnd-docs-master.html # Linux + ``` + +3. Use your browser's Print function: + - Press `Ctrl+P` (or `Cmd+P` on macOS) + - Select "Save as PDF" as the destination + - Adjust page settings if needed + - Save the PDF + +## Advanced Options + +### Installing PDF Tools + +**wkhtmltopdf (recommended):** +```bash +# Ubuntu/Debian +sudo apt-get install wkhtmltopdf + +# macOS +brew install wkhtmltopdf + +# From source +https://wkhtmltopdf.org/downloads.html +``` + +**WeasyPrint:** +```bash +# Using pip +pip install weasyprint + +# Ubuntu/Debian (with dependencies) +sudo apt-get install python3-pip python3-cffi python3-brotli libpango-1.0-0 libpangoft2-1.0-0 +pip install weasyprint +``` + +**Chromium/Chrome:** +```bash +# Ubuntu/Debian +sudo apt-get install chromium-browser + +# macOS +brew install --cask google-chrome +``` + +### Customizing the Export + +The export scripts use Python to process HTML files. You can customize: + +1. **Styling:** Edit the CSS in `export-single-html.sh` (look for the ` + +
+Bnd is a swiss army knife for OSGi development.
+This chapter provides an overview of bnd.
+Bnd is a powerful build tool for OSGi bundles.
+bnd build
+