Ajout carte de profil cliquable pour les membres (graphe, matrice, equipe)

This commit is contained in:
syoul
2025-12-09 19:45:00 +01:00
parent cdd6e1c573
commit b8ec3f2828
2 changed files with 234 additions and 7 deletions

View File

@@ -15,11 +15,12 @@ function extractYaml(yamlContent, key) {
return match ? match[1].trim() : null;
}
// Extraire les compétences depuis le YAML
// Extraire les compétences depuis le YAML (avec details)
function extractSkills(yamlContent) {
const skills = [];
const lines = yamlContent.split('\n');
let inSkillsSection = false;
let currentSkill = null;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
@@ -30,6 +31,7 @@ function extractSkills(yamlContent) {
}
if (inSkillsSection && line.match(/^\w+:/) && !line.match(/^\s+/)) {
if (currentSkill) skills.push(currentSkill);
inSkillsSection = false;
continue;
}
@@ -37,12 +39,60 @@ function extractSkills(yamlContent) {
if (inSkillsSection) {
const nameMatch = line.match(/^\s+-\s+name:\s*["']?([^"'\n]+)["']?/);
if (nameMatch) {
skills.push(nameMatch[1]);
if (currentSkill) skills.push(currentSkill);
currentSkill = { name: nameMatch[1], level: 'beginner', years: 0 };
}
const levelMatch = line.match(/^\s+level:\s*["']?([^"'\n]+)["']?/);
if (levelMatch && currentSkill) currentSkill.level = levelMatch[1];
const yearsMatch = line.match(/^\s+years:\s*(\d+)/);
if (yearsMatch && currentSkill) currentSkill.years = parseInt(yearsMatch[1]);
}
}
if (currentSkill) skills.push(currentSkill);
return skills;
}
// Extraire une liste YAML simple (ex: interests, softSkills, projects)
function extractYamlList(yamlContent, key) {
const items = [];
const lines = yamlContent.split('\n');
let inSection = false;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// Debut de section
if (line.match(new RegExp(`^${key}:\\s*$`))) {
inSection = true;
continue;
}
// Fin de section (nouvelle cle au niveau racine)
if (inSection && line.match(/^\w+:/) && !line.match(/^\s+/)) {
inSection = false;
continue;
}
// Extraction des items
if (inSection) {
const itemMatch = line.match(/^\s+-\s*["']?([^"'\n]+)["']?/);
if (itemMatch) {
items.push(itemMatch[1].trim());
}
}
}
return skills;
return items;
}
// Extraire la bio (contenu apres le front matter YAML)
function extractBio(content) {
const parts = content.split(/^---\n[\s\S]*?\n---/m);
if (parts.length > 1) {
return parts[1].trim().replace(/\n/g, ' ').substring(0, 500);
}
return '';
}
// Charger les technologies depuis les blips
@@ -93,7 +143,7 @@ function loadTechnologies() {
return technologies;
}
// Charger les membres de l'équipe
// Charger les membres de l'équipe (avec profils complets)
function loadTeamMembers() {
const teamDir = path.join(__dirname, '../docs/data/team');
const members = [];
@@ -112,6 +162,8 @@ function loadTeamMembers() {
if (!yamlMatch) continue;
const yaml = yamlMatch[1];
const skillsData = extractSkills(yaml);
const member = {
id: extractYaml(yaml, 'name') || file.replace('.md', ''),
fullName: extractYaml(yaml, 'fullName') || extractYaml(yaml, 'name'),
@@ -119,7 +171,13 @@ function loadTeamMembers() {
availability: parseInt(extractYaml(yaml, 'availability') || '0'),
seniorityLevel: extractYaml(yaml, 'seniorityLevel') || 'beginner',
yearsExperience: parseInt(extractYaml(yaml, 'yearsExperience') || '0'),
skills: extractSkills(yaml)
joinDate: extractYaml(yaml, 'joinDate') || '',
skills: skillsData.map(s => typeof s === 'string' ? s : s.name),
skillsDetailed: skillsData,
interests: extractYamlList(yaml, 'interests'),
softSkills: extractYamlList(yaml, 'softSkills'),
projects: extractYamlList(yaml, 'projects'),
bio: extractBio(content)
};
members.push(member);
@@ -342,10 +400,30 @@ function main() {
console.log(`${technologies.length} technologies chargées`);
console.log(`${members.length} membres chargés`);
// Creer un index des profils membres pour acces rapide
const memberProfiles = {};
members.forEach(m => {
memberProfiles[m.id] = {
id: m.id,
fullName: m.fullName,
role: m.role,
availability: m.availability,
seniorityLevel: m.seniorityLevel,
yearsExperience: m.yearsExperience,
joinDate: m.joinDate,
skillsDetailed: m.skillsDetailed,
interests: m.interests,
softSkills: m.softSkills,
projects: m.projects,
bio: m.bio
};
});
const data = {
network: generateNetworkData(technologies, members),
congestionMatrix: generateCongestionMatrix(technologies, members),
genesisTeam: generateGenesisTeam(technologies, members),
memberProfiles: memberProfiles,
technologies: technologies,
members: members,
generatedAt: new Date().toISOString()