|
1 | | -# Copernicus Land Monitoring Service (CLMS) |
| 1 | +# 📚 Document Compilation & AI-Open Portal (Quarto Platform) |
2 | 2 |
|
3 | | -This repository contains technical documents for the CLMS, such as ATBD's, PUM's, or nomenclature guidelines. |
| 3 | +An enterprise-grade, highly automated, and AI-ready document hosting and compilation stack built on **Quarto**. |
4 | 4 |
|
5 | | -The CLMS documents library is deployed [here](https://library.land.copernicus.eu) |
| 5 | +This repository provides a complete, modern CI/CD compiler pipeline designed to transform raw technical documents, product user manuals, and specifications into beautiful, structured, and search-optimized output formats. It is fully modular—**any organization can fork this repository** to immediately establish their own automated online technical library. |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## 🚀 Core Features |
| 10 | + |
| 11 | +* **Multi-Format Compilation:** Compiles raw Markdown (`.qmd`) source files into three target outputs in a single pass: |
| 12 | + * **Responsive Web HTML:** Clean, mobile-friendly design featuring sidebar navigation and search. |
| 13 | + * **Typst-Engine PDFs:** Gorgeous, publication-quality printable PDF manuals compiled using the ultra-fast Typst layout tool. |
| 14 | + * **Companion GFM (.llms.md):** Stripped-down, plain-markdown files designed specifically for ingestion by LLM/RAG systems. |
| 15 | +* **LLM/RAG Optimization:** |
| 16 | + * *Table Linearization:* A custom Lua-based Pandoc filter parses complex spatial, metadata, and grid-tables into flat text hierarchies that spatial AI models (like Onyx) can retrieve and read without fragmentation. |
| 17 | + * *AI Vision Image Descriptions:* Automatically extracts image hashes and generates context-rich visual alt-text dynamically, saving on repetitive API consumption using an MD5-hashed cache window (`.llm_cache`). |
| 18 | +* **Privacy & Hiding Layers (Non-Browsable):** Allows documents flagged as `category: non-browsable` to compile using persistent, cryptographically secure 64-character hashes. It purges these files completely from static indices, `robots.txt`, and standard crawling `sitemap.xml` entries, keeping them accessible strictly via direct link. |
| 19 | +* **Automatic Captions & Fixing:** Formats, sanitizes unknown YAML headers, balances table column widths automatically, and promotes loose title markers into formal native figure/table elements. |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## 📂 Repository Structure |
| 24 | + |
| 25 | +The documentation files are maintained in the following directory layout: |
| 26 | + |
| 27 | +``` |
| 28 | +├── DOCS/ # Active compiled content (generated during build) |
| 29 | +├── _meta/ # Quarto configurations, layouts, CSS, and typst styles |
| 30 | +├── assets/ # Global repository logos, icons, and graphic elements |
| 31 | +├── tools/ |
| 32 | +│ └── pdf_to_qmd/ # Batch PDF-to-Quarto conversion utilities |
| 33 | +└── .github/ |
| 34 | + └── scripts/build/ # The automated build and cleaning scripts |
| 35 | +``` |
| 36 | + |
| 37 | +--- |
| 38 | + |
| 39 | +## 🛠️ Step-by-Step Guide for Forking |
| 40 | + |
| 41 | +This repository is designed to be fully customizable. If you wish to fork this project to host your own technical documents library, follow these steps: |
| 42 | + |
| 43 | +### 1. Structure Your Documents |
| 44 | +1. Clean your repository structure and place your Markdown (`.qmd`) document files under `DOCS/`. |
| 45 | +2. Give your files a version-controlling suffix (e.g., `My_Manual_v1.qmd`). |
| 46 | +3. Set your document metadata categories by adding headers at the top of your `.qmd` files: |
| 47 | + ```yaml |
| 48 | + --- |
| 49 | + title: "Technical Specification" |
| 50 | + category: "products" # can be products, guidelines, or non-browsable |
| 51 | + --- |
| 52 | + ``` |
| 53 | + |
| 54 | +### 2. Configure Your Brand Assets |
| 55 | +* Go to `assets/` and replace the logo files (`copernicus-logo.svg`, `lms_logo.svg`) with your own organization logos. |
| 56 | +* Open `_meta/` to adjust global theme variables, colors, or page headers/footers in the stylesheet variables (`styles.css` / `main.css`). |
| 57 | + |
| 58 | +### 3. Set Up GitHub Actions |
| 59 | +To enable automated updates and web deployment: |
| 60 | +1. Enable **GitHub Pages** under your forked repository settings and target the `gh-pages` branch. |
| 61 | +2. In your repository Secrets, add: |
| 62 | + * `GEMINI_API_KEY` (Required if you wish to use the AI-vision description and metadata auto-generation features during deployment). |
| 63 | + |
| 64 | +--- |
| 65 | + |
| 66 | +## 💻 Local Compilation & Conversion |
| 67 | + |
| 68 | +### Batch Convert Legacy PDF manuals to QMD |
| 69 | +To easily import existing documents, use the bundled converter script: |
| 70 | +```bash |
| 71 | +python3 -m pip install -r tools/pdf_to_qmd/requirements.txt |
| 72 | +python3 tools/pdf_to_qmd/pdf2qmd.py --out Files_to_convert/processed_documents/output Files_to_convert/processed_documents/inbox |
| 73 | +``` |
| 74 | + |
| 75 | +### Compile Locally |
| 76 | +To run and test the complete cleaning, renaming, and compilation sequence locally on your machine, launch the build script: |
| 77 | +```bash |
| 78 | +./.github/scripts/build/build-docs.sh |
| 79 | +``` |
| 80 | +*Tip: The script safely creates a pristine copy of your working files (`source_DOCS`). You can completely roll back any experimental render states at any time by running:* |
| 81 | +```bash |
| 82 | +rm -rf DOCS origin_DOCS && mv source_DOCS DOCS |
| 83 | +``` |
0 commit comments