Skip to content
Merged

Test #20

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
45c0501
chore: add PR automation workflows and scripts from develop
mckeea Dec 1, 2025
ee79eab
Update LLM cache [skip ci]
actions-user Dec 1, 2025
34c4b1b
chore: add PR automation workflows and scripts from develop
mckeea Dec 1, 2025
b79f05e
Merge branch 'test' of https://github.com/eea/CLMS_documents into test
mckeea Dec 1, 2025
cf73c2e
feat(docs): update CLCplus Backbone, Coastal Zones, Copernicus Land D…
mckeea Dec 2, 2025
55839fd
Update LLM cache [skip ci]
actions-user Dec 2, 2025
1c33f0b
Hotfix
mckeea Dec 2, 2025
ee65a2c
Update LLM cache [skip ci]
actions-user Dec 2, 2025
36d04cf
fix: prevent duplicate changelog entries, sync versions, and enable m…
mckeea Dec 2, 2025
ad7159f
Update LLM cache [skip ci]
actions-user Dec 2, 2025
37d815a
fix: gitattributes update
mckeea Dec 2, 2025
d4f786c
fix: avoid duplicates in versions and changelogs
mckeea Dec 2, 2025
6e91690
[skip ci] fix: versions.json
mckeea Dec 2, 2025
a593579
fix: change_logs.json
mckeea Dec 2, 2025
c70d024
Update LLM cache [skip ci]
actions-user Dec 2, 2025
fad3c2c
fix: synchronize versions.json and change_logs.json [skip ci]
mckeea Dec 3, 2025
97c887f
Update LLM cache [skip ci]
actions-user Dec 3, 2025
7af4c9c
fix: normalize file paths in version/changelog updates [skip ci]
mckeea Dec 3, 2025
cf120e8
fix: versions.json and change_logs.json [skip ci]
mckeea Dec 3, 2025
9096a9b
Update LLM cache [skip ci]
actions-user Dec 3, 2025
b1e006c
fix: correct path normalization for vesion/changelog update [skip ci]
mckeea Dec 3, 2025
e555037
Update LLM cache [skip ci]
actions-user Dec 3, 2025
c5a4e09
fix: avoid duplicates in versions and changelogs
mckeea Dec 3, 2025
a82515d
Merge branch 'test' of https://github.com/eea/CLMS_documents into test
mckeea Dec 3, 2025
48c24f5
fix: versions.json and change_logs.json [skip ci]
mckeea Dec 3, 2025
6d6e7e9
fix: inject changelog correctly [skip ci]
mckeea Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
26 changes: 18 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
# .gitattributes for CLMS_documents

# Always keep the target branch's version of .llm_cache during merges
.llm_cache merge=ours
.llm_cache/** merge=ours linguist-generated

# Treat all shell scripts as text with LF endings
# Text files with LF line endings
*.sh text eol=lf
*.py text eol=lf
*.js text eol=lf
*.qmd text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.css text eol=lf
*.html text eol=lf
*.json text eol=lf
*.lua text eol=lf

# Treat images as binary (no diff)
# Images as binary (no diff, case-insensitive)
*.png binary
*.jpg binary
*.jpeg binary
*.svg binary
*.emf binary
*.wmf binary
*.JPG binary
*.PNG binary
*.SVG binary
*.gif binary

# Optional: treat docx/pdf as binary
# Documents as binary
*.docx binary
*.pdf binary

# Exclude secrets or temp files from export/archive
# Exclude from export/archive
*.env export-ignore
*.bak export-ignore
.llm_cache/ export-ignore
5 changes: 5 additions & 0 deletions .github/non_browsable_doc_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
"source": "products/CLDS_survey_evaluation_final.qmd",
"base": "ygwvotluybqwbma6gy8sgaqrfd9ndd8iu078aqn6q10boj016xkhjwegnirwigxb",
"url": "/ygwvotluybqwbma6gy8sgaqrfd9ndd8iu078aqn6q10boj016xkhjwegnirwigxb.html"
},
{
"source": "Copernicus_Land_Data_Store_CLDS/Survey_Evaluation_v1.qmd",
"base": "dr3yejtzxollhygq0lwfgjxf755jvzyly2lemmvpgiqrzf5own2074qpdivug54c",
"url": "/dr3yejtzxollhygq0lwfgjxf755jvzyly2lemmvpgiqrzf5own2074qpdivug54c.html"
}
]
}
11 changes: 9 additions & 2 deletions .github/scripts/build-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ python3 .github/scripts/update_url_mappings.py
echo "🔄 Grouping documents by category..."
python3 .github/scripts/group_docs_by_category.py


# Change to DOCS directory as it'll be the root of rendered content
cd DOCS

# Copy quarto configuration and meta files from _meta to DOCS
cp ../_meta/_quarto*.yml .
cp -r ../_meta .

# Link assets to origin_DOCS as these files need to be served from rendered content
ln -s ../assets assets


echo "🖼 Render all documents to HTML"
if [[ -n "$SKIP_DOCX" ]]; then
echo " (DOCX generation will be skipped)"
Expand All @@ -33,7 +38,9 @@ else
# _quarto.yml is already the default with headers - no copying needed
fi

QUARTO_CHROMIUM_HEADLESS_MODE=new quarto render --to html --no-clean
# Render all files together (changelog filter uses original-filename from YAML headers)
echo "🔄 Rendering all documents to HTML..."
QUARTO_CHROMIUM_HEADLESS_MODE=new quarto render --to html --no-clean

# Backup the correct sitemap as it may be overwritten by next operations
sleep 5
Expand Down
62 changes: 62 additions & 0 deletions .github/scripts/filters/inject_contact_info.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
-- inject_contact_info.lua
-- Quarto filter to automatically inject standard contact information
-- after the YAML header in documents

local filter_dir = debug.getinfo(1, "S").source:match("@?(.*/)") or ""
local template_path = filter_dir .. "../../templates/contact_template.md"

-- Function to read the contact template
function read_contact_template()
local file = io.open(template_path, "r")
if not file then
return nil
end
local content = file:read("*all")
file:close()
return content
end

-- Function to check if contact should be injected
function should_inject_contact(meta)
-- Check if contact injection is explicitly disabled
if meta.contact and pandoc.utils.stringify(meta.contact) == "false" then
return false
end

-- Default: inject contact unless explicitly disabled
return true
end

-- Main filter function
function Pandoc(doc)
-- Check if we should inject contact info
if not should_inject_contact(doc.meta) then
return doc
end

-- Read the contact template
local contact_content = read_contact_template()
if not contact_content then
-- If template doesn't exist, skip injection
return doc
end

-- Parse the contact template as markdown
local contact_doc = pandoc.read(contact_content, "markdown")

-- Insert contact blocks at the beginning of the document
local new_blocks = {}

-- Add contact blocks first
for i, block in pairs(contact_doc.blocks) do
table.insert(new_blocks, block)
end

-- Add original document blocks
for i, block in pairs(doc.blocks) do
table.insert(new_blocks, block)
end

-- Return document with injected contact info
return pandoc.Pandoc(new_blocks, doc.meta)
end
94 changes: 0 additions & 94 deletions .github/scripts/filters/math2png.lua

This file was deleted.

36 changes: 0 additions & 36 deletions .github/scripts/filters/tex2png.js

This file was deleted.

49 changes: 49 additions & 0 deletions .github/scripts/generate_commit_message.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash
# Generate detailed commit message body from PR changed files
# Usage: generate_commit_message.sh <pr_number>

set -e

PR_NUMBER=$1

if [ -z "$PR_NUMBER" ]; then
echo "Usage: $0 <pr_number>"
exit 1
fi

# Get changed .qmd files only
changed_files=$(gh pr view "$PR_NUMBER" --json files -q '.files[].path' | grep '^DOCS/.*\.qmd$' || echo "")

if [ -z "$changed_files" ]; then
echo "No documentation files (.qmd) changed"
exit 0
fi

# Group files by category subdirectory
declare -A categories
while IFS= read -r file; do
[ -z "$file" ] && continue
# Extract category (first directory after DOCS/)
category=$(echo "$file" | sed 's|^DOCS/\([^/]*\)/.*|\1|')
# Extract filename without path and .qmd extension
filename=$(basename "$file" .qmd)

# Add to category array
if [ -n "${categories[$category]}" ]; then
categories[$category]="${categories[$category]}\n- ${filename}"
else
categories[$category]="- ${filename}"
fi
done <<< "$changed_files"

# Build message body, sorted by category name
body=""
for category in $(echo "${!categories[@]}" | tr ' ' '\n' | sort); do
# Format category name (replace underscores with spaces, title case)
formatted_category=$(echo "$category" | sed 's/_/ /g')
body="${body}\n\n${formatted_category}:"
body="${body}\n${categories[$category]}"
done

# Output the body
echo -e "$body"
2 changes: 1 addition & 1 deletion .github/scripts/generate_index_all.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { readdir, writeFile, access } from "fs/promises";
import { join, basename } from "path";

const DOCS_DIR = "../DOCS";
const IGNORED_FOLDERS = new Set(["theme", "templates", "includes", "assets", "_site", ".quarto", "non-browsable"]);
const IGNORED_FOLDERS = new Set(["assets", "_site", "_meta", ".quarto", "non-browsable"]);

function formatTitle(name) {
return name.replace(/[-_]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
Expand Down
10 changes: 9 additions & 1 deletion .github/scripts/generate_intros_and_keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@
ROOT_DIR = (SCRIPT_DIR / "../../").resolve()
CACHE_DIR = (SCRIPT_DIR / "../../.llm_cache").resolve()
CACHE_DIR.mkdir(exist_ok=True)
BLACKLISTED_DIRS = {"templates", "includes", "theme"}
BLACKLISTED_DIRS = {
"templates",
"includes",
"theme",
"_meta",
"assets",
"_site",
".quarto",
}

PROMPT = """You are an AI assistant helping to enrich technical documents for the Copernicus Land Monitoring Service (CLMS).

Expand Down
Loading