~/nails-pptx/build_nails.js
const pptxgen = require("pptxgenjs");
const fs = require("fs");
const path = require("path");
const pres = new pptxgen();
pres.layout = "LAYOUT_WIDE"; // 13.3 x 7.5 inches
pres.title = "Nail Anatomy & Disorders — Dermatology Resident Study";
pres.author = "Dermatology Study";
// ── COLOUR PALETTE ──────────────────────────────────────────
const C = {
navy: "1A2F5A",
teal: "1ABC9C",
gold: "F0A500",
white: "FFFFFF",
light: "F2F6FC",
dark: "1C2833",
red: "C0392B",
purple: "6C3483",
green: "1E8449",
orange: "A04000",
gray: "566573",
lblue: "2E86C1",
pearl: "FFF8E7",
};
// ── HELPER: image as base64 ──────────────────────────────────
function imgData(filename) {
const p = path.join("/home/daytona/workspace/nails-pptx/", filename);
if (!fs.existsSync(p)) return null;
const buf = fs.readFileSync(p);
const ext = path.extname(filename).slice(1).toLowerCase();
const mime = ext === "jpg" || ext === "jpeg" ? "image/jpeg" : "image/png";
return `${mime};base64,${buf.toString("base64")}`;
}
// ── HELPER: section header slide ────────────────────────────
function sectionSlide(title, subtitle, bgColor) {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: bgColor || C.navy} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.15, h:7.5, fill:{color: C.teal} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: C.gold} });
sl.addText(title, { x:0.5, y:2.5, w:12.3, h:1.2, fontSize:40, bold:true, color:C.white, align:"center" });
if (subtitle) {
sl.addText(subtitle, { x:0.5, y:3.9, w:12.3, h:0.8, fontSize:20, color:C.teal, align:"center", italic:true });
}
return sl;
}
// ── HELPER: content slide with image on right ───────────────
function contentSlide(opts) {
// opts: {title, bullets, img, imgX, imgY, imgW, imgH, accentColor, pearl}
const sl = pres.addSlide();
const ac = opts.accentColor || C.navy;
// background
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.light} });
// top bar
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.75, fill:{color: ac} });
// accent strip left
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.75, w:0.08, h:6.75, fill:{color: C.gold} });
// bottom bar
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: ac} });
// title
sl.addText(opts.title, {
x:0.2, y:0.1, w:13, h:0.58,
fontSize:22, bold:true, color:C.white, align:"left", valign:"middle", margin:6
});
// image
if (opts.img) {
const d = imgData(opts.img);
if (d) {
sl.addImage({
data: d,
x: opts.imgX || 7.8, y: opts.imgY || 0.85,
w: opts.imgW || 5.2, h: opts.imgH || 5.5,
});
// image border
sl.addShape(pres.shapes.RECTANGLE, {
x: opts.imgX || 7.8, y: opts.imgY || 0.85,
w: opts.imgW || 5.2, h: opts.imgH || 5.5,
fill:{type:"none"}, line:{color: ac, width:1.5}
});
}
}
// bullets
const bw = opts.img ? 7.4 : 12.8;
if (opts.bullets && opts.bullets.length) {
const items = opts.bullets.map(b => {
if (b.type === "heading") {
return [
{ text: b.text, options:{ bold:true, color: ac, fontSize:13, breakLine:true } }
];
} else if (b.type === "sub") {
return [
{ text: " " + b.text, options:{ color: C.gray, fontSize:11, breakLine:true, indent:20 } }
];
} else {
return [
{ text: "• ", options:{ color: ac, bold:true, fontSize:12 } },
{ text: b.text, options:{ color: C.dark, fontSize:12, breakLine:true } }
];
}
}).flat();
sl.addText(items, {
x:0.25, y:0.88, w:bw, h:6.1,
fontSize:12, fontFace:"Calibri", valign:"top", margin:8,
wrap:true
});
}
// clinical pearl box
if (opts.pearl) {
const py = opts.pearlY || 6.15;
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x:0.25, y:py, w:bw, h:1.0,
fill:{color: C.pearl}, line:{color: C.gold, width:1.5}, rectRadius:0.08,
shadow:{type:"outer", color:"000000", blur:4, offset:2, angle:135, opacity:0.1}
});
sl.addText([
{ text:"💎 Clinical Pearl: ", options:{bold:true, color: C.orange, fontSize:11} },
{ text: opts.pearl, options:{color: C.dark, fontSize:11} }
], { x:0.4, y:py+0.05, w:bw-0.3, h:0.9, valign:"middle", wrap:true });
}
return sl;
}
// ── HELPER: two-column content slide ────────────────────────
function twoColSlide(opts) {
const sl = pres.addSlide();
const ac = opts.accentColor || C.navy;
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.light} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.75, fill:{color: ac} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.75, w:0.08, h:6.75, fill:{color: C.gold} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: ac} });
sl.addText(opts.title, { x:0.2, y:0.1, w:13, h:0.58, fontSize:22, bold:true, color:C.white, align:"left", valign:"middle", margin:6 });
// col divider
sl.addShape(pres.shapes.LINE, { x:6.75, y:0.9, w:0, h:6.2, line:{color:ac, width:1, dashType:"dash"} });
// left col
if (opts.left && opts.left.length) {
const items = opts.left.map(b => {
if (b.type==="heading") return [{text:b.text, options:{bold:true, color:ac, fontSize:13, breakLine:true}}];
if (b.type==="sub") return [{text:" "+b.text, options:{color:C.gray, fontSize:11, breakLine:true}}];
return [{text:"• ", options:{color:ac, bold:true, fontSize:12}},{text:b.text, options:{color:C.dark, fontSize:12, breakLine:true}}];
}).flat();
sl.addText(items, { x:0.25, y:0.9, w:6.3, h:6.0, fontSize:12, fontFace:"Calibri", valign:"top", margin:8, wrap:true });
}
// right col
if (opts.right && opts.right.length) {
const items = opts.right.map(b => {
if (b.type==="heading") return [{text:b.text, options:{bold:true, color:ac, fontSize:13, breakLine:true}}];
if (b.type==="sub") return [{text:" "+b.text, options:{color:C.gray, fontSize:11, breakLine:true}}];
return [{text:"• ", options:{color:ac, bold:true, fontSize:12}},{text:b.text, options:{color:C.dark, fontSize:12, breakLine:true}}];
}).flat();
sl.addText(items, { x:6.9, y:0.9, w:6.2, h:6.0, fontSize:12, fontFace:"Calibri", valign:"top", margin:8, wrap:true });
}
return sl;
}
// ── HELPER: full-image diagram slide ─────────────────────────
function diagramSlide(title, imgFile, caption, accentColor) {
const sl = pres.addSlide();
const ac = accentColor || C.navy;
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.dark} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.7, fill:{color: ac} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: C.gold} });
sl.addText(title, { x:0.2, y:0.1, w:13, h:0.55, fontSize:20, bold:true, color:C.white, align:"center", valign:"middle", margin:4 });
const d = imgData(imgFile);
if (d) {
sl.addImage({ data:d, x:0.5, y:0.8, w:12.3, h:6.15 });
}
if (caption) {
sl.addText(caption, { x:0.5, y:7.05, w:12.3, h:0.4, fontSize:10, color:C.teal, align:"center", italic:true });
}
return sl;
}
// ── HELPER: mechanism flow slide ─────────────────────────────
function mechanismSlide() {
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color:"1C1C2E"} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.7, fill:{color: C.purple} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: C.gold} });
sl.addText("MECHANISM OF NAIL CHANGES IN PSORIASIS", {
x:0.2, y:0.1, w:13, h:0.55, fontSize:21, bold:true, color:C.white, align:"center", valign:"middle"
});
const steps = [
{ x:0.3, y:0.85, w:3.7, h:1.2, bg:"6C3483", text:"① TRIGGER\nGenetic susceptibility\n(HLA-Cw6 NEGATIVE)\n+ Microtrauma / Koebner" },
{ x:4.5, y:0.85, w:3.7, h:1.2, bg:"1A5276", text:"② DC ACTIVATION\nmDC release IL-23\nStressed keratinocytes\nrelease LL-37, hβD-2/3" },
{ x:8.7, y:0.85, w:4.3, h:1.2, bg:"1E8449", text:"③ Th17 DIFFERENTIATION\nIL-17A, IL-17F, IL-22\nTNF-α, NF-κB activation\nMast cell recruitment" },
{ x:0.3, y:2.4, w:3.7, h:1.3, bg:"B7950B", text:"④ MATRIX INFLAMMATION\nParakeratosis in\nproximal matrix\n→ PITTING" },
{ x:4.5, y:2.4, w:3.7, h:1.3, bg:"922B21", text:"⑤ NAIL BED PSORIASIS\nPsoriasiform hyperplasia\nMicrovascular changes\n→ OIL-SPOT / ONYCHOLYSIS" },
{ x:8.7, y:2.4, w:4.3, h:1.3, bg:"1F618D", text:"⑥ ENTHESITIS @ DIP\nCytokine spread to\nsynovio-entheseal complex\n→ PSORIATIC ARTHRITIS risk" },
];
steps.forEach(s => {
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x:s.x, y:s.y, w:s.w, h:s.h,
fill:{color:s.bg}, line:{color:C.gold, width:1}, rectRadius:0.1,
shadow:{type:"outer",color:"000000",blur:8,offset:3,angle:135,opacity:0.3}
});
sl.addText(s.text, {
x:s.x+0.1, y:s.y+0.05, w:s.w-0.2, h:s.h-0.1,
fontSize:11, bold:false, color:C.white, align:"center", valign:"middle", wrap:true, margin:4
});
});
// Arrows between boxes (row 1)
[[4.0,1.45,0.4,0.15],[8.2,1.45,0.4,0.15]].forEach(([x,y,w,h])=>{
sl.addShape(pres.shapes.RIGHT_ARROW, {x,y,w,h,fill:{color:C.gold},line:{color:C.gold}});
});
// summary box
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x:0.3, y:4.05, w:12.7, h:1.3,
fill:{color:"2D2D4E"}, line:{color:C.teal, width:1.5}, rectRadius:0.12
});
sl.addText([
{text:"KEY CYTOKINE AXIS: ", options:{bold:true, color:C.gold, fontSize:13}},
{text:"IL-23 → Th17 → IL-17A/F + TNF-α → Nail matrix & nail bed inflammation\n", options:{color:C.white, fontSize:12}},
{text:"VEGF ↑ ", options:{bold:true, color:C.teal, fontSize:12}},
{text:"→ dilated tortuous capillaries (onychoscopy finding: 90%)\n", options:{color:"#BBBBBB", fontSize:12}},
{text:"Onychodermal band breach ", options:{bold:true, color:C.gold, fontSize:12}},
{text:"→ progressive onycholysis (difficult to reverse)", options:{color:"#BBBBBB", fontSize:12}},
], {x:0.5, y:4.1, w:12.3, h:1.2, valign:"middle", wrap:true, margin:6});
// nail changes legend
sl.addShape(pres.shapes.RECTANGLE, {x:0.3, y:5.55, w:12.7, h:1.55, fill:{color:"252540"}, line:{color:C.purple, width:1}});
sl.addText("ZAIAS CLASSIFICATION — Nail Changes by Site", {
x:0.4, y:5.58, w:12.5, h:0.35, fontSize:12, bold:true, color:C.gold, align:"center"
});
const zaias = [
["PROXIMAL MATRIX","Pitting (parakeratosis foci)\nTransverse furrows\nLeukonychia (rough surface)"],
["DISTAL MATRIX / LUNULA","Red spots in lunula\nFocal onycholysis\nErythema of lunula"],
["NAIL BED","Salmon/oil-drop patch\nSubungual hyperkeratosis\nSplinter haemorrhages\nOnycholysis (irregular margin)"],
["NAIL FOLD","Periungual psoriasis\nCutaneous psoriasis\n(PsA association ↑↑)"],
];
const cols = [0.4, 3.7, 7.0, 10.3];
zaias.forEach((z,i) => {
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x:cols[i], y:5.98, w:3.1, h:1.0,
fill:{color:"3A3A5E"}, line:{color:C.teal, width:0.8}, rectRadius:0.07
});
sl.addText([
{text:z[0]+"\n", options:{bold:true, color:C.teal, fontSize:9}},
{text:z[1], options:{color:C.white, fontSize:9}}
], {x:cols[i]+0.05, y:5.99, w:3.0, h:0.95, valign:"top", wrap:true, margin:3});
});
return sl;
}
// ── HELPER: quiz slide ───────────────────────────────────────
function quizSlide(qas, title, accentColor) {
const sl = pres.addSlide();
const ac = accentColor || C.navy;
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.light} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.7, fill:{color: ac} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: C.gold} });
sl.addText(title, { x:0.2, y:0.1, w:13, h:0.55, fontSize:20, bold:true, color:C.white, align:"center", valign:"middle" });
// table header
sl.addShape(pres.shapes.RECTANGLE, {x:0.3, y:0.78, w:12.7, h:0.4, fill:{color:ac}});
sl.addText("QUESTION", {x:0.35, y:0.78, w:7.5, h:0.4, fontSize:11, bold:true, color:C.white, valign:"middle"});
sl.addText("ANSWER", {x:8.0, y:0.78, w:4.8, h:0.4, fontSize:11, bold:true, color:C.white, valign:"middle"});
qas.forEach((qa, i) => {
const yy = 1.22 + i * 0.78;
const bg = i % 2 === 0 ? "FFFFFF" : "EBF5FB";
sl.addShape(pres.shapes.RECTANGLE, {x:0.3, y:yy, w:12.7, h:0.75, fill:{color:bg}});
sl.addShape(pres.shapes.LINE, {x:0.3, y:yy+0.75, w:12.7, h:0, line:{color:"CCCCCC", width:0.5}});
sl.addShape(pres.shapes.LINE, {x:8.0, y:yy, w:0, h:0.75, line:{color:"CCCCCC", width:0.5}});
sl.addText(qa[0], {x:0.4, y:yy+0.05, w:7.5, h:0.65, fontSize:10, color:C.dark, valign:"middle", wrap:true});
sl.addText(qa[1], {x:8.1, y:yy+0.05, w:4.8, h:0.65, fontSize:10, color:ac, bold:true, valign:"middle", wrap:true});
});
return sl;
}
// ────────────────────────────────────────────────────────────
// BUILD ALL SLIDES
// ────────────────────────────────────────────────────────────
// ── TITLE SLIDE ──────────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.navy} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:5.8, w:13.3, h:1.7, fill:{color:"0F1F3D"} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:0.25, h:7.5, fill:{color: C.teal} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:5.6, w:13.3, h:0.12, fill:{color: C.gold} });
sl.addText("NAIL ANATOMY & DISORDERS", {
x:0.5, y:1.2, w:12.3, h:1.2, fontSize:44, bold:true, color:C.white, align:"center",
shadow:{type:"outer", color:"000000", blur:8, offset:3, angle:135, opacity:0.4}
});
sl.addText("Dermatology Resident Study Note", {
x:0.5, y:2.6, w:12.3, h:0.7, fontSize:24, color:C.teal, align:"center", italic:true
});
sl.addText("Nail Unit • Nail Signs • Psoriasis • Onychomycosis • Lichen Planus • Tumours • Clinical Pearls", {
x:0.5, y:3.4, w:12.3, h:0.55, fontSize:14, color:"AABBCC", align:"center"
});
sl.addText([
{text:"Sources: ", options:{bold:true, color:C.gold, fontSize:12}},
{text:"Rook's Dermatology Ch.93 • Fitzpatrick's Ch.91 • Bolivnia 5e • Andrews' Ch.33 • JAAD 2024/2025", options:{color:"AABBCC", fontSize:12}}
], { x:0.5, y:6.05, w:12.3, h:0.5, align:"center" });
sl.addText("With Enhanced Clinical Pearls • Mechanism of Nail Changes • Psoriasis Pathway", {
x:0.5, y:6.65, w:12.3, h:0.45, fontSize:11, color:C.teal, align:"center", italic:true
});
}
// ── SECTION 1 HEADER ────────────────────────────────────────
sectionSlide("PART 1 — ANATOMY OF THE NAIL UNIT", "Gross anatomy • Microscopy • Blood supply • Growth • Immunology", C.navy);
// ── ANATOMY OVERVIEW ─────────────────────────────────────────
contentSlide({
title: "1.1 — NAIL UNIT COMPONENTS",
img: "img_anatomy.png", imgX:7.5, imgY:0.85, imgW:5.5, imgH:5.5,
accentColor: C.navy,
bullets: [
{type:"heading", text:"NAIL PLATE"},
{text:"Trilaminar: dorsal (from ventral PNF), intermediate (germinal matrix), ventral (nail bed ~21%)"},
{text:"Hard hair-type keratins in sulfur-rich proteins (high cysteine, glycine, tyrosine)"},
{type:"heading", text:"NAIL MATRIX (Germinal)"},
{text:"Proximal matrix → dorsal 80% of nail plate"},
{text:"Distal matrix (lunula) → ventral 20% of nail plate"},
{text:"Keratinization along oblique upward-distal axis"},
{type:"heading", text:"NAIL BED (Sterile Matrix)"},
{text:"Epidermis 2-3 cells thick, NO granular layer in health"},
{text:"Granular layer = PATHOLOGICAL (psoriasis, onychomycosis)"},
{text:"Collagen tightly apposed to periosteum → rapid osteomyelitis risk"},
{type:"heading", text:"HYPONYCHIUM & ONYCHODERMAL BAND"},
{text:"Onychodermal band = nail isthmus = most distal nail-bed attachment"},
{text:"Breach → progressive onycholysis (difficult to reverse)"},
],
pearl: "No granular layer in healthy nail bed. Its appearance signals disease — think psoriasis or onychomycosis when you see parakeratosis on biopsy."
});
// ── KERATINS + GROWTH ────────────────────────────────────────
twoColSlide({
title: "1.2 — NAIL KERATINS, GROWTH RATES & IMMUNOLOGY",
accentColor: C.lblue,
left: [
{type:"heading", text:"KERATINS"},
{text:"K5/K14 — basal layer of nail matrix AND nail bed"},
{text:"K1/K10 — suprabasal nail matrix (absent in HEALTHY nail bed)"},
{text:"K1/K10 in nail bed = pathological → psoriasis, onychomycosis"},
{text:"K6/K16 — various subungual locations (development)"},
{type:"heading", text:"GROWTH RATES"},
{text:"Fingernails: ~3 mm/month"},
{text:"Toenails: ~1 mm/month"},
{type:"heading", text:"FACTORS — FASTER GROWTH"},
{text:"Daytime, youth, dominant hand, summer, male sex"},
{text:"Psoriasis, pityriasis rubra pilaris, hyperthyroidism, HIV"},
{text:"Drugs: levodopa, itraconazole"},
{type:"heading", text:"FACTORS — SLOWER GROWTH"},
{text:"Beau lines, yellow nail syndrome, hypothyroidism"},
{text:"Drugs: methotrexate, azathioprine, targeted therapies"},
],
right: [
{type:"heading", text:"IMMUNOLOGY OF THE NAIL"},
{text:"Nail matrix has IMMUNE PRIVILEGE (like hair matrix, eye, testis)"},
{text:"MHC class I restricted → protects from autoimmune T-cell attack"},
{text:"Contains LL-37 (kills Candida albicans)"},
{text:"hβD-2 and hβD-3 (beta-defensins) in matrix"},
{type:"heading", text:"SIGNALLING PATHWAYS"},
{text:"Wnt/β-catenin crucial in nail embryogenesis & maintenance"},
{text:"R-spondin 4 mutations → autosomal recessive anonychia"},
{text:"Frizzled-6 (Wnt receptor) mutations → inherited nail dysplasia"},
{text:"BMPs work with Wnt signalling"},
{type:"heading", text:"BLOOD SUPPLY"},
{text:"Paired digital arteries (large palmar + small dorsal)"},
{text:"Glomus bodies (Masson) → regulate capillary circulation"},
{text:"Glomus bodies DILATE with cold (opposite of arterioles)"},
{text:"Superficial arcade: supplies nail fold, extensor tendon, matrix"},
]
});
// ── SECTION 2 HEADER ────────────────────────────────────────
sectionSlide("PART 2 — NAIL SIGNS & THEIR SIGNIFICANCE", "Shape • Attachment • Surface • Colour • Systemic associations", "0B3D6B");
// ── SHAPE ABNORMALITIES ──────────────────────────────────────
contentSlide({
title: "2.1 — ABNORMALITIES OF SHAPE: CLUBBING & KOILONYCHIA",
img: "img_clubbing.png", imgX:7.6, imgY:0.85, imgW:5.4, imgH:5.2,
accentColor: C.lblue,
bullets: [
{type:"heading", text:"CLUBBING (Hippocratic fingers / Acropachy)"},
{text:"Lovibond angle > 180° (normally < 160°)"},
{text:"Schamroth window OBLITERATED (normally open diamond)"},
{text:"Curth angle (DIP joint) < 160°"},
{text:"Mechanism: ↑VEGF → nail bed angiogenesis + vasodilation"},
{text:"HPGD / SLCO2A1 mutations → pachydermoperiostosis (primary)"},
{type:"heading", text:"CAUSES — Secondary Clubbing"},
{text:"Respiratory: lung Ca, mesothelioma, CF, cryptogenic FA, sarcoid"},
{text:"Cardiac: cyanotic CHD, infective endocarditis"},
{text:"GI: IBD, liver disease, oesophageal Ca"},
{text:"HIV (37%), POEMS syndrome (70%)"},
{type:"heading", text:"KOILONYCHIA (Spoon nail)"},
{text:"Concave, spoon-shaped nail plate"},
{text:"Most common: iron deficiency anaemia, haemochromatosis"},
{text:"Also: trichothiodystrophy, familial (AD)"},
{text:"Secondary: psoriasis, LP, dermatophyte infection"},
],
pearl: "Schamroth window test: oppose dorsal surfaces of two homologous fingers. Normal = diamond window. Clubbing = obliteration. Quick bedside sign."
});
// ── ONYCHOLYSIS + PTERYGIUM ───────────────────────────────────
contentSlide({
title: "2.2 — ONYCHOLYSIS & PTERYGIUM",
accentColor: C.red,
bullets: [
{type:"heading", text:"ONYCHOLYSIS — Separation from nail bed (distal → proximal)"},
{text:"Detached plate looks WHITE (apparent leukonychia — air underneath)"},
{text:"Green = Pseudomonas aeruginosa (pyocyanin pigment = chloronychia)"},
{type:"heading", text:"Dermoscopic Types (4)"},
{text:"1. Post-traumatic: regular margin, usually lateral"},
{text:"2. Psoriatic: IRREGULAR margin, whole free edge, erythematous border"},
{text:"3. Onychomycosis: ragged/spike edge, mycelium visible proximally"},
{text:"4. Drug-induced: uniform pattern in midline (photo-onycholysis)"},
{type:"heading", text:"Key Causes"},
{text:"Psoriasis (30% of psoriatics), fungal, trauma, photo-onycholysis"},
{text:"Drugs: doxycycline, psoralens, 5-FU, captopril, retinoids"},
{text:"Systemic: hypothyroidism, hyperthyroidism, yellow nail syndrome"},
{type:"heading", text:"PTERYGIUM (Dorsal — True)"},
{text:"Fibrotic band from PNF divides nail in TWO"},
{text:"Cause: LICHEN PLANUS (most common), trauma, GVHD, leprosy"},
{type:"heading", text:"PTERYGIUM INVERSUM UNGUIS (Ventral)"},
{text:"Forward extension of nail bed epithelium"},
{text:"Causes: systemic sclerosis, Raynaud, SLE, familial, trauma"},
],
pearl: "The onychodermal band is the 'Achilles heel' of nail attachment. Once breached by psoriasis or trauma, onycholysis becomes progressive. Clip, dry, and apply topical antiseptics."
});
// ── SURFACE CHANGES ──────────────────────────────────────────
twoColSlide({
title: "2.3 — NAIL SURFACE CHANGES",
accentColor: C.green,
left: [
{type:"heading", text:"BEAU LINES (Transverse Grooves)"},
{text:"Transverse depressions = temporary arrest of proximal matrix mitosis"},
{text:"Depth = severity of damage; Width = duration of insult"},
{text:"Migrate distally as nail grows"},
{text:"All 20 nails simultaneously = SYSTEMIC cause"},
{text:"1-2 nails only = local trauma / paronychia"},
{text:"Beau lines → Onychomadesis when full thickness groove"},
{type:"heading", text:"PITTING"},
{text:"Shallow depressions from parakeratosis foci in proximal matrix"},
{text:"Fine pits (<1mm): PSORIASIS (most common)"},
{text:">10 pits/nail OR >60 pits total supports psoriasis diagnosis"},
{text:"Coarse pits: ECZEMA"},
{text:"Geometric/uniform 'Scotch plaid' pattern: ALOPECIA AREATA"},
{text:"Elkonyxis = deep single large pit (reactive arthritis, psoriasis)"},
{type:"heading", text:"TRACHYONYCHIA (Twenty-nail dystrophy)"},
{text:"Rough sandpaper-like opaque surface; all 20 nails"},
{text:"Associations: alopecia areata (most common), psoriasis, LP, eczema"},
],
right: [
{type:"heading", text:"ONYCHOSCHIZIA (Lamellar Dystrophy)"},
{text:"Distal horizontal lamellar splitting"},
{text:"Causes: repeated wet-dry cycles, chemical exposure"},
{text:"Common with aging; NOT a sign of systemic disease"},
{type:"heading", text:"LONGITUDINAL RIDGING / BEADING"},
{text:"Normal aging change; NOT clinically significant alone"},
{type:"heading", text:"MEDIAN CANALIFORM DYSTROPHY OF HELLER"},
{text:"Midline fir-tree groove; thumbs most commonly"},
{text:"Distinct from habit-tic (washboard nails — disturbed cuticle)"},
{text:"Often self-resolving"},
{type:"heading", text:"PINCER NAIL (Trumpet nail)"},
{text:"Transverse overcurvature increasing toward distal tip"},
{text:"3 patterns: psoriasis (thumbs/big toes), inherited, isolated"},
{text:"Treatment: braces, partial matricectomy, Z-plasty"},
{type:"heading", text:"PACHYONYCHIA"},
{text:"Thickened plate, yellow, horseshoe free edge, extreme hardness"},
{text:"Jadassohn-Lewandowsky syndrome (pachyonychia congenita)"},
{text:"Acquired: psoriasis, PRP, chronic eczema, onychomycosis"},
]
});
// ── COLOUR CHANGES ───────────────────────────────────────────
contentSlide({
title: "2.4 — NAIL COLOUR CHANGES (CHROMONYCHIA)",
accentColor: C.purple,
bullets: [
{type:"heading", text:"LEUKONYCHIA"},
{text:"True leukonychia (nail plate): parakeratosis in plate; Mees' lines = arsenic / systemic insult"},
{text:"Apparent leukonychia (nail BED — disappear with pressure):"},
{text:" → Muehrcke's lines (paired transverse bands) = hypoalbuminaemia"},
{text:" → Terry's nails (white proximally, normal 1-2mm distally) = hepatic cirrhosis"},
{text:" → Half-and-half / Lindsay's nails (white proximal, red-brown distal) = chronic renal failure"},
{text:" → Azure lunula = Wilson's disease / argyria"},
{type:"heading", text:"MELANONYCHIA"},
{text:"Brown/black: nail matrix melanocytes, subungual haematoma"},
{text:"ABCDEF rule for nail melanoma:"},
{text:" A = Age (40-70), African/Asian/Native American; B = Brown/Black >3mm, Blurred borders"},
{text:" C = Change in morphology; D = Digit (thumb > hallux > index)"},
{text:" E = Extension to nail fold (Hutchinson's sign); F = Family/personal Hx melanoma"},
{type:"heading", text:"OTHER COLOURS"},
{text:"Yellow: yellow nail syndrome, psoriasis (subungual hyperkeratosis), fungal"},
{text:"Green: Pseudomonas aeruginosa (chloronychia)"},
{text:"Red lunula: psoriasis, CO poisoning, cardiac failure, alopecia areata"},
{text:"Splinter haemorrhages: psoriasis, endocarditis, vasculitis, trauma"},
],
pearl: "Pseudo-Hutchinson's sign = apparent periungual pigmentation through a TRANSPARENT cuticle (racial melanonychia, benign nevi). Real Hutchinson's = actual melanin in nail fold skin. Dermoscopy distinguishes both."
});
// ── SYSTEMIC NAIL SIGNS ──────────────────────────────────────
diagramSlide(
"2.5 — NAIL SIGNS IN SYSTEMIC DISEASE (Quick Reference)",
"img_systemic.png",
"Source: Rook's Ch.93, Bolivnia 5e, Fitzpatrick's Ch.91, Andrews' Ch.33",
C.purple
);
// ── SECTION 3 HEADER ────────────────────────────────────────
sectionSlide("PART 3 — NAIL DISORDERS", "Psoriasis • Lichen Planus • Onychomycosis • Paronychia • Darier Disease • Eczema • Yellow Nail • Tumours", C.red);
// ── NAIL PSORIASIS CLINICAL ──────────────────────────────────
contentSlide({
title: "3.1a — NAIL PSORIASIS — EPIDEMIOLOGY & CLINICAL FEATURES",
img: "img_psoriasis_clinical.png", imgX:7.5, imgY:0.85, imgW:5.5, imgH:5.0,
accentColor: C.red,
bullets: [
{type:"heading", text:"EPIDEMIOLOGY"},
{text:">50% prevalence in plaque psoriasis; 80-90% lifetime incidence"},
{text:"5-10% have nail psoriasis WITHOUT skin/joint disease"},
{text:"Annual PsA risk with nail involvement: 0.55-2.55%"},
{text:"HLA: Cw6 NEGATIVE (cutaneous psoriasis is HLA-Cw6 positive)"},
{type:"heading", text:"MATRIX SIGNS"},
{text:"Pitting — proximal matrix parakeratosis (most common, fine pits)"},
{text:"Transverse furrows — proximal matrix extension"},
{text:"Crumbling nail — entire matrix; prolonged disease"},
{text:"Leukonychia with rough surface"},
{type:"heading", text:"NAIL BED SIGNS"},
{text:"Salmon / Oil-drop patch — NEARLY PATHOGNOMONIC (yellow-red translucent zone)"},
{text:"Onycholysis — irregular margin involving whole free edge; erythematous border"},
{text:"Subungual hyperkeratosis — prolonged; hard keratinous material"},
{text:"Splinter haemorrhages — short episodes; capillary rupture"},
{text:"Yellow-green discolouration — secondary yeast / Pseudomonas"},
],
pearl: "Salmon patch (oil-drop sign) = nearly pathognomonic for psoriasis. Unlike pitting (also in AA, eczema), an oil-spot is nearly exclusive to psoriasis. Confirm with onychoscopy: dilated tortuous capillaries (90%)."
});
// ── PSORIASIS MECHANISM SLIDE ────────────────────────────────
mechanismSlide();
// ── PSORIASIS TREATMENT ──────────────────────────────────────
contentSlide({
title: "3.1b — NAIL PSORIASIS — TREATMENT ALGORITHM",
accentColor: C.red,
bullets: [
{type:"heading", text:"≤3 NAILS — MATRIX INVOLVEMENT"},
{text:"1st line: Intralesional triamcinolone acetonide (after digital nerve block)"},
{text:"2nd line: Topical vitamin D analogue (calcipotriol) ± topical steroid"},
{type:"heading", text:"≤3 NAILS — NAIL BED INVOLVEMENT"},
{text:"1st line: Topical steroids OR topical vitamin D analogue"},
{type:"heading", text:"> 3 NAILS INVOLVED"},
{text:"Intralesional steroids ± topical vitamin D + steroids — 1st line"},
{text:"SYSTEMIC: Methotrexate (≤15mg/week), Ciclosporin (3-5mg/kg short-term)"},
{text:"Acitretin (0.2-0.4 mg/kg × 6 months)"},
{type:"heading", text:"BIOLOGICS"},
{text:"Adalimumab — ONLY FDA-approved specifically for nail psoriasis"},
{text:"IL-17i: Secukinumab, Ixekizumab, Brodalumab — excellent nail clearance"},
{text:"IL-23i: Risankizumab, Guselkumab, Ustekinumab"},
{text:"Anti-TNF: Infliximab, Etanercept, Certolizumab, Golimumab"},
{type:"heading", text:"SMALL MOLECULES"},
{text:"Apremilast (PDE4 inhibitor) — especially for mild-moderate nail psoriasis"},
{text:"Tofacitinib (JAK inhibitor) — emerging evidence"},
{type:"heading", text:"SCORING: NAPSI"},
{text:"0-8 per nail (matrix 0-4 + nail bed 0-4); total max = 160 (all 20 nails)"},
],
pearl: "Nail psoriasis is HLA-Cw6 NEGATIVE — the opposite of cutaneous plaque psoriasis. This genetically distinct subset has stronger PsA association. Always screen for joint disease."
});
// ── LICHEN PLANUS ────────────────────────────────────────────
contentSlide({
title: "3.2 — LICHEN PLANUS OF THE NAILS",
img: "img_lichen_planus.png", imgX:7.6, imgY:0.85, imgW:5.4, imgH:5.2,
accentColor: C.gold,
bullets: [
{type:"heading", text:"EPIDEMIOLOGY & FEATURES"},
{text:"5-10% of LP patients; 5th-6th decade; may precede skin LP"},
{type:"heading", text:"CLINICAL SIGNS"},
{text:"Dorsal pterygium — MOST CHARACTERISTIC; fibrotic PNF-matrix fusion"},
{text:"Onychorrhexis — irregular longitudinal ridging and grooving"},
{text:"Thinning of nail plate → atrophy → nail shedding"},
{text:"Trachyonychia — 20-nail dystrophy (shiny variant)"},
{text:"Erythronychia — red longitudinal streaks"},
{text:"Subungual hyperpigmentation and keratosis"},
{text:"Idiopathic atrophy of nails = most severe variant (rapid irreversible destruction)"},
{type:"heading", text:"HISTOLOGY"},
{text:"Interface dermatitis with band-like lymphocytic infiltrate"},
{text:"Basal cell liquefaction (identical to cutaneous LP)"},
{type:"heading", text:"TREATMENT"},
{text:"Intralesional triamcinolone acetonide (digital nerve block first)"},
{text:"Oral prednisone 0.5-1 mg/kg × 3 weeks"},
{text:"IM triamcinolone 0.5-1mg/kg/month × 3-6 months (children)"},
{text:"Combination: oral retinoids + topical steroids"},
],
pearl: "Dorsal pterygium = lichen planus until proven otherwise. It is irreversible scarring — early aggressive treatment is necessary. LP pterygium splits the nail; psoriasis does NOT cause pterygium."
});
// ── ONYCHOMYCOSIS ────────────────────────────────────────────
contentSlide({
title: "3.3 — ONYCHOMYCOSIS — CLASSIFICATION & TREATMENT",
img: "img_onychomycosis.png", imgX:7.6, imgY:0.85, imgW:5.4, imgH:5.2,
accentColor: C.green,
bullets: [
{type:"heading", text:"TYPES & ORGANISMS"},
{text:"DLSO (most common): T. rubrum (70-80%) — free edge/lateral; hyperkeratosis"},
{text:"PSO (proximal subungual): T. rubrum — lunula leukonychia — HIV!"},
{text:"SWO (superficial white): T. interdigitale, moulds — dorsal powdery"},
{text:"Endonyx: T. soudanense/violaceum — milky white, no hyperkeratosis"},
{text:"Candida (CDLSO): chronic mucocutaneous candidiasis"},
{type:"heading", text:"DIFFERENTIAL FROM PSORIASIS"},
{text:"Onychomycosis: KOH = filaments; ragged/spike dermoscopy edge"},
{text:"Psoriasis: fine pitting, salmon patch, KOH usually negative"},
{text:"Up to 20% of psoriatics also have co-infection — treat both!"},
{type:"heading", text:"DIAGNOSIS"},
{text:"KOH direct microscopy; Fungal culture (gold standard)"},
{text:"PAS histology of nail clippings; PCR (faster, more sensitive)"},
{type:"heading", text:"TREATMENT"},
{text:"Terbinafine oral 250mg/day × 6 wks (fingernails), 12 wks (toenails)"},
{text:"Itraconazole: 200mg/day continuous OR pulse (400mg/day × 1 wk/month)"},
{text:"Topical: ciclopirox 8%, efinaconazole, tavaborole (adjunct)"},
],
pearl: "PSO (proximal subungual onychomycosis) in a young patient = HIV testing MANDATORY. PSO entering via the nail fold is rare in immunocompetent patients. Always get KOH/culture before treating — misdiagnosis rate is high."
});
// ── PARONYCHIA ───────────────────────────────────────────────
twoColSlide({
title: "3.4 — PARONYCHIA (Acute & Chronic)",
accentColor: C.orange,
left: [
{type:"heading", text:"ACUTE PARONYCHIA"},
{text:"Rapid onset pain, swelling, erythema of nail folds"},
{text:"Most common cause: Staphylococcus aureus"},
{text:"Also: Streptococcus, herpes simplex (herpetic whitlow), orf"},
{text:"Neutropenic patients: Fusarium, Aspergillus"},
{text:"3× more common in females; index finger + thumb most common"},
{type:"heading", text:"TREATMENT — Acute"},
{text:"Superficial abscess: drain with pointed scalpel (no anaesthesia)"},
{text:"Deep: penicillinase-resistant antibiotic + surgery if no response 48h"},
{text:"Herpetic whitlow: oral aciclovir/famciclovir (topical has NO benefit)"},
{text:"Artificial nails harbour bacteria inaccessible to hand hygiene"},
],
right: [
{type:"heading", text:"CHRONIC PARONYCHIA"},
{text:"Insidious; inflammatory dermatosis of nail folds"},
{text:"Predominantly: domestic/catering workers (wet work), females"},
{text:"First 3 fingers of dominant hand most affected"},
{type:"heading", text:"PATHOPHYSIOLOGY (Critical!)"},
{text:"Candida is NOT the primary pathogen"},
{text:"Primary cause = IRRITANT REACTION / contact allergy / food hypersensitivity"},
{text:"Candida = secondary coloniser only"},
{text:"Systemic antifungals are NOT useful"},
{type:"heading", text:"CLINICAL FEATURES"},
{text:"Loss of cuticle (pathognomonic), Beau lines, cross-ridging"},
{text:"Dark discolouration at lateral edges"},
{type:"heading", text:"TREATMENT — Chronic"},
{text:"Avoid wet work; topical imidazoles (for Candida colonisation)"},
{text:"Topical / intralesional steroids — primary treatment"},
{text:"Surgical: crescent-shaped excision of PNF (refractory cases)"},
{text:"Heals by secondary intention in < 2 weeks"},
]
});
// ── DARIER + ECZEMA ──────────────────────────────────────────
twoColSlide({
title: "3.5 & 3.6 — DARIER DISEASE & ECZEMATOUS NAIL DYSTROPHY",
accentColor: C.purple,
left: [
{type:"heading", text:"DARIER DISEASE OF NAILS"},
{text:"Candy-cane appearance: red (erythronychia) + white (leukonychia) longitudinal bands"},
{text:"PATHOGNOMONIC — can diagnose Darier disease from nails alone"},
{text:"Free margin: V-shaped NOTCH and fissure (fragility)"},
{text:"Multiple nails affected simultaneously"},
{type:"heading", text:"HISTOLOGY"},
{text:"Acantholysis + multinucleate giant cells"},
{text:"Epithelial hyperplasia in nail bed"},
{text:"Similar to skin Darier disease (ATP2A2 mutation)"},
{type:"heading", text:"CLINICAL PEARL"},
{text:"Red+white longitudinal bands + V-notch at free edge = Darier disease"},
{text:"Even if skin Darier is not clinically apparent"},
],
right: [
{type:"heading", text:"ECZEMATOUS NAIL DYSTROPHY"},
{text:"Prevalence: almost ALL hand eczema patients; ~16% atopic dermatitis"},
{type:"heading", text:"FEATURES"},
{text:"Thickened, pitted, rough, discoloured nails"},
{text:"Beau lines (very common)"},
{text:"COARSE pits (distinguish from fine pits of psoriasis!)"},
{text:"Loss of cuticle → Candida/bacterial superinfection"},
{type:"heading", text:"PHOTO-ONYCHOLYSIS"},
{text:"Tetracyclines, 5-FU, capecitabine → phototoxic onycholysis"},
{text:"Pattern: matches shape of proximal nail fold"},
{type:"heading", text:"YELLOW NAIL SYNDROME"},
{text:"TRIAD: Yellow thickened overcurved nails + Lymphoedema + Pleural effusion"},
{text:"Also: bronchiectasis, rhinosinusitis, chronic cough"},
{text:"Absent lunula, loss of cuticle"},
{text:"Growth < 0.1mm/week (extreme slowdown)"},
{text:"Treatment: vitamin E (topical/systemic), triazoles"},
]
});
// ── NAIL TUMOURS ─────────────────────────────────────────────
twoColSlide({
title: "3.7 — NAIL TUMOURS (Benign & Malignant)",
accentColor: C.dark,
left: [
{type:"heading", text:"GLOMUS TUMOUR"},
{text:"1-2% of hand tumours; predominantly women, 4th-5th decade"},
{text:"TRIAD: Love test (point tenderness) + Hildreth's sign (tourniquet relief) + Cold sensitivity"},
{text:"Small reddish/bluish spot under nail OR longitudinal erythronychia + distal notch"},
{text:"Investigation: MRI (gold standard); ultrasound + colour Doppler"},
{text:"Bone erosion in 50% of cases"},
{text:"Treatment: surgical excision (transungual approach preferred)"},
{type:"heading", text:"SUBUNGUAL EXOSTOSIS"},
{text:"Benign osteochondral outgrowth from distal phalanx"},
{text:"75% great toenail; porcelain white with telangiectasias"},
{text:"X-ray: cup-shaped bone outgrowth (diagnostic)"},
{type:"heading", text:"ONYCHOMATRICOMA"},
{text:"Classic: longitudinal xanthopachyonychia + woodworm cavities at free edge"},
{text:"Sea-anemone matrix tumour on nail avulsion"},
],
right: [
{type:"heading", text:"SUBUNGUAL MELANOMA (Nail Apparatus Melanoma)"},
{text:"0.18-2.8% of all cutaneous melanomas"},
{text:"~25% of melanomas in Japanese and African Americans"},
{text:"Most arise from MATRIX (75%) → longitudinal melanonychia"},
{text:"Subtype: acral lentiginous melanoma"},
{text:"BRAF mutations LOW; KIT and NRAS mutations HIGH"},
{text:"Treatment: in situ → en bloc 5-10mm margins; invasive → amputation"},
{text:"Sentinel LN biopsy for melanoma > 1mm thickness"},
{type:"heading", text:"SQUAMOUS CELL CARCINOMA (Most Common Malignant)"},
{text:"Mean age 60; 75% male"},
{text:"HPV-associated (genito-digital transmission, up to 60%)"},
{text:"Right index / middle finger most common"},
{text:"Mean diagnosis DELAY = 6 years"},
{text:"Bowen disease = in situ SCC"},
{text:"Treatment: Mohs surgery; amputation only if bone involved"},
{type:"heading", text:"DIGITAL MYXOID PSEUDOCYST"},
{text:"Type B: in PNF → longitudinal nail groove"},
{text:"MRI confirms DIP joint capsule breach (> 85%)"},
]
});
// ── SECTION 4: PSORIASIS MECHANISM (diagram) ─────────────────
sectionSlide("MECHANISM OF NAIL CHANGES IN PSORIASIS", "The IL-23 → Th17 → IL-17/TNF pathway explained step-by-step", C.purple);
// Already added mechanismSlide() above — add another dedicated one here with detail
{
const sl = pres.addSlide();
const ac = C.purple;
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.light} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.7, fill:{color: ac} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.75, w:0.08, h:6.75, fill:{color: C.gold} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: C.gold} });
sl.addText("PSORIASIS NAIL MECHANISM — DETAILED CYTOKINE PATHWAY", {
x:0.2, y:0.1, w:13, h:0.55, fontSize:19, bold:true, color:C.white, align:"center", valign:"middle"
});
const rows = [
{heading:"GENETIC BASIS", text:"HLA-Cw6 NEGATIVE (distinct from cutaneous psoriasis which is HLA-Cw6 positive). Asian patients: HLA-B46, HLA-A*02:07. This suggests nail psoriasis is a genetically distinct entity with stronger PsA association."},
{heading:"ANATOMICAL TRIGGER — ENTHESITIS", text:"The extensor tendon inserts adjacent to the nail root at the DIP joint. Microtrauma (Koebner phenomenon) triggers enthesitis at this synovio-entheseal complex. Nail matrix is anatomically contiguous with the DIP enthesis — inflammation spreads both ways."},
{heading:"INNATE IMMUNITY (Step 1)", text:"Stressed keratinocytes release antimicrobial peptides (LL-37, hβD-2, hβD-3). These activate plasmacytoid dendritic cells (pDCs), stimulate myeloid DCs (mDCs), and breach the immune privilege of the nail matrix. NF-κB pathway activated."},
{heading:"IL-23/Th17 AXIS (Step 2-3)", text:"mDCs release IL-23 → differentiates naïve T cells into Th17 cells. Th17 cells produce IL-17A, IL-17F, IL-22 and induce TNF-α from mDCs and mast cells. VEGF upregulation → angiogenesis → dilated tortuous capillaries visible on onychoscopy (90% of cases)."},
{heading:"MATRIX EFFECTS → PITTING (Step 4)", text:"IL-17/TNF-α in proximal matrix → defective keratinization → parakeratosis foci (clusters of nucleated cells) in the dorsal nail plate surface → these shed as tiny depressions = PITS. Severity correlates with inflammation duration."},
{heading:"NAIL BED EFFECTS → OIL-SPOT + ONYCHOLYSIS (Step 5)", text:"Psoriasiform hyperplasia of nail bed + parakeratosis + microvascular changes + neutrophil trapping → translucent yellow-red oil-drop/salmon patch. Onychodermal band breach → progressive onycholysis. Subungual hyperkeratosis = nail bed hyperkeratosis."},
{heading:"PsA RISK (Step 6)", text:"Pro-inflammatory cytokines (IL-17, IL-22, TNF-α) from nail unit spread to adjacent DIP joint synovio-entheseal complex → sensitisation → psoriatic arthritis. Annual PsA risk: 0.55-2.55% with nail involvement vs 0.26-1.14% without."},
];
rows.forEach((r, i) => {
const yy = 0.82 + i * 0.91;
const bg = i % 2 === 0 ? "FFFFFF" : "F0ECF9";
sl.addShape(pres.shapes.RECTANGLE, {x:0.25, y:yy, w:12.8, h:0.88, fill:{color:bg}, line:{color:"DDDDDD", width:0.5}});
sl.addText(r.heading, {x:0.35, y:yy+0.05, w:2.8, h:0.75, fontSize:10, bold:true, color:ac, valign:"middle", wrap:true});
sl.addShape(pres.shapes.LINE, {x:3.2, y:yy, w:0, h:0.88, line:{color:ac, width:0.8}});
sl.addText(r.text, {x:3.3, y:yy+0.05, w:9.6, h:0.75, fontSize:10, color:C.dark, valign:"middle", wrap:true});
});
}
// ── CONNECTIVE TISSUE & DRUGS ─────────────────────────────────
twoColSlide({
title: "3.8 — NAILS IN CONNECTIVE TISSUE DISEASES & DRUG-INDUCED CHANGES",
accentColor: C.teal,
left: [
{type:"heading", text:"CONNECTIVE TISSUE DISEASES"},
{text:"Systemic sclerosis: periungual telangiectasias; megacapillaries + avascular areas (4 stages on capillaroscopy); pterygium inversum unguis; acro-osteolysis"},
{text:"SLE: periungual erythema, splinter haemorrhages, onycholysis"},
{text:"Dermatomyositis: dilated irregular nail fold capillaries (PATHOGNOMONIC); ragged cuticles (Gottron's equivalent)"},
{text:"Raynaud: capillaroscopy — normal (primary); decreased + dropout (secondary)"},
{text:"RA: tortuous/ramified capillary loops; 'fish shoal' pattern"},
{type:"heading", text:"CAPILLAROSCOPY PEARLS"},
{text:"Megacapillaries + avascular areas + hazy background = SYSTEMIC SCLEROSIS"},
{text:"Use nail fold capillaroscopy to distinguish primary vs secondary Raynaud"},
],
right: [
{type:"heading", text:"DRUG-INDUCED NAIL CHANGES"},
{text:"Retinoids: onycholysis, paronychia, ingrown toenails, fragility"},
{text:"EGFR inhibitors (cetuximab, gefitinib): multiple pyogenic granulomas, paronychia"},
{text:"Taxanes (docetaxel, paclitaxel): multiple PGs, onycholysis, subungual haematoma"},
{text:"Capecitabine: onycholysis, pigmentation"},
{text:"Antiretrovirals (indinavir): paronychia, pyogenic granuloma"},
{text:"Hydroxyurea: melanonychia (drug-induced)"},
{text:"β-blockers: pincer nails, digital necrosis"},
{text:"ACE inhibitors (captopril): onycholysis"},
{text:"Methotrexate: slower nail growth"},
{text:"Doxycycline / psoralens: photo-onycholysis"},
{text:"Ciclosporin: ingrown toenails, pyogenic granuloma"},
]
});
// ── NAIL SURGERY ─────────────────────────────────────────────
contentSlide({
title: "PART 4 — NAIL SURGERY OVERVIEW",
accentColor: C.dark,
bullets: [
{type:"heading", text:"ANAESTHESIA"},
{text:"Distal digital block (preferred over ring block)"},
{text:"1 cm proximal/lateral to PNF-lateral nail fold junction"},
{text:"0.5 mL dorsal + 0.5 mL palmar branches × BOTH sides"},
{text:"Addresses dual innervation (ring block misses dorsal branches)"},
{type:"heading", text:"KEY PROCEDURES"},
{text:"Nail avulsion (partial preferred; total avulsion causes nail bed shrinkage + distal pulp expansion)"},
{text:"Punch biopsy 3mm — for small pigmented lesion < 3mm in distal matrix"},
{text:"Longitudinal ellipse excision — for longitudinal pigmented bands"},
{text:"Tangential excision — for wide pigmented areas"},
{text:"Lateral longitudinal biopsy (sigmoid-shaped) — includes all lateral nail unit structures"},
{text:"Crescent-shaped PNF excision — chronic paronychia; heals 2° intention in < 2 weeks"},
{text:"Chemical cautery 88% phenol × 4 min — ingrowing toenail; tourniquet mandatory"},
{text:"Phenol oozing lasts up to 5 weeks; < 3% recurrence"},
{type:"heading", text:"IMAGING"},
{text:"MRI: gold standard for glomus tumour, soft tissue masses, melanoma extent"},
{text:"High-res ultrasound (>15 MHz hockey-stick): glomus tumour, psoriatic enthesitis"},
{text:"X-ray: subungual exostosis, acro-osteolysis, SCC bone involvement"},
{text:"Onychoscopy/dermoscopy: pitting patterns, capillaries, melanonychia"},
],
pearl: "Distal digital block — NOT a ring block — is the correct anaesthesia for nail surgery. Nail has dual innervation (dorsal + palmar). A classic ring block at the base of the digit can miss dorsal branches."
});
// ── CLINICAL PEARLS SLIDE ────────────────────────────────────
diagramSlide(
"CLINICAL PEARLS — HIGH-YIELD SUMMARY",
"img_pearls.png",
"Sources: Rook's Ch.93 • Fitzpatrick's Ch.91 • Andrews' Ch.33 • Bolivnia Dermatology 5e",
C.orange
);
// ── CLINICAL PEARLS EXPANDED ──────────────────────────────────
{
const sl = pres.addSlide();
const ac = C.orange;
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.light} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.7, fill:{color: ac} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0.75, w:0.08, h:6.75, fill:{color: C.gold} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.2, w:13.3, h:0.3, fill:{color: ac} });
sl.addText("CLINICAL PEARLS — EXPANDED (High-Yield for Exams & Viva)", {
x:0.2, y:0.1, w:13, h:0.55, fontSize:19, bold:true, color:C.white, align:"center", valign:"middle"
});
const pearls = [
["1","Onychodermal band = Achilles heel","Once breached (psoriasis/trauma), onycholysis becomes PROGRESSIVE and hard to reverse. Clip, dry, topical antiseptics."],
["2","Chronic paronychia ≠ Candida","Candida is a SECONDARY coloniser. Primary = irritant/allergic dermatitis. Systemic antifungals DO NOT HELP. Treat inflammation first."],
["3","PSO + young patient = HIV","Proximal Subungual Onychomycosis in an immunocompetent-appearing patient should always trigger HIV testing."],
["4","Nail psoriasis = HLA-Cw6 NEGATIVE","Skin psoriasis = HLA-Cw6 positive. Nail psoriasis patients are MORE frequently HLA-Cw6 NEGATIVE — genetically distinct, stronger PsA link."],
["5","Salmon patch = nearly pathognomonic","Unlike pitting, the oil-drop/salmon patch is nearly exclusive to psoriasis. Confirm with onychoscopy: dilated tortuous capillaries (90%)."],
["6","Glomus tumour triad","Love test (point tenderness) + Hildreth's sign (tourniquet relieves pain) + cold sensitivity. MRI is gold standard. Bone erosion in 50%."],
["7","Darier disease candy-cane nails","Red + white longitudinal bands + V-notch at free edge = PATHOGNOMONIC. Can diagnose Darier disease from nails alone."],
["8","Dorsal pterygium = LP until proven otherwise","Lichen planus causes irreversible scarring pterygium. Unlike psoriasis which causes pitting and onycholysis, LP causes pterygium."],
["9","SCC > melanoma (malignant nail tumour)","SCC is the MOST COMMON malignant nail tumour (not melanoma). HPV-associated; mean diagnostic delay = 6 years. Right index finger."],
["10","Hutchinson vs Pseudo-Hutchinson","Real Hutchinson = melanin pigment IN nail fold skin = melanoma. Pseudo = transparency of cuticle reveals nail pigment = benign (racial melanonychia)."],
];
pearls.forEach((p, i) => {
const row = Math.floor(i / 2);
const col = i % 2;
const x = col === 0 ? 0.2 : 6.85;
const y = 0.82 + row * 1.25;
sl.addShape(pres.shapes.ROUNDED_RECTANGLE, {
x, y, w:6.3, h:1.18,
fill:{color:C.pearl}, line:{color:ac, width:1}, rectRadius:0.09,
shadow:{type:"outer", color:"000000", blur:4, offset:2, angle:135, opacity:0.1}
});
sl.addText([
{text:`💎 #${p[0]} — ${p[1]}\n`, options:{bold:true, color:ac, fontSize:10.5}},
{text:p[2], options:{color:C.dark, fontSize:10}}
], {x:x+0.1, y:y+0.06, w:6.1, h:1.05, valign:"top", wrap:true, margin:4});
});
}
// ── QUIZ SLIDE 1 ─────────────────────────────────────────────
quizSlide([
["Normal fingernail growth rate?", "~3 mm/month"],
["Which matrix zone produces ventral nail plate?", "Distal matrix (lunula)"],
["Onychodermal band is also called?", "Nail isthmus"],
["Lovibond angle in clubbing exceeds?", "> 180°"],
["Koilonychia most commonly = which deficiency?", "Iron deficiency anaemia"],
["K1/K10 in nail bed indicates?", "Pathological (psoriasis/onychomycosis)"],
["Yellow nails + lymphoedema + pleural effusion = ?", "Yellow nail syndrome"],
["Primary pathogen in chronic paronychia?", "NONE — irritant/allergic dermatitis"],
], "QUIZ PART 1 — ANATOMY, GROWTH & NAIL SIGNS", C.navy);
quizSlide([
["Most common organism in DLSO?", "Trichophyton rubrum"],
["PSO in young patient → test for?", "HIV"],
["Candy-cane nails (red+white + V-notch) = ?", "Darier disease"],
["Pterygium of nail most commonly caused by?", "Lichen planus"],
["Koenen tumours develop in which syndrome?", "Tuberous sclerosis (around puberty)"],
["Triangular lunulae = pathognomonic of?", "Nail-patella syndrome (LMX1B mutation)"],
["Most common MALIGNANT nail tumour?", "Squamous cell carcinoma (not melanoma)"],
["FDA-approved biologic for nail psoriasis?", "Adalimumab (anti-TNF)"],
["NAPSI maximum total score?", "160 (80 fingernails + 80 toenails)"],
["Green discolouration under onycholytic nail?", "Pseudomonas aeruginosa (pyocyanin)"],
], "QUIZ PART 2 — NAIL DISORDERS & TREATMENT", C.red);
// ── VIVA Q&A SLIDE ───────────────────────────────────────────
contentSlide({
title: "VIVA QUESTIONS — PSORIASIS NAIL MECHANISM",
accentColor: C.purple,
bullets: [
{type:"heading", text:"Q: Describe the mechanism of nail pitting in psoriasis."},
{text:"Proximal matrix is affected by psoriatic inflammation → IL-17/TNF-α → defective keratinization → parakeratosis foci (clusters of nucleated cells without normal cornification) in dorsal nail plate surface → these foci are shed as nail plate grows distally, leaving tiny depressions = PITS. Fine pits (<1mm) = psoriasis. >10 pits/nail OR >60 total supports diagnosis."},
{type:"heading", text:"Q: Why does nail psoriasis cause psoriatic arthritis?"},
{text:"The nail matrix is anatomically contiguous with the DIP joint extensor tendon enthesis. Pro-inflammatory cytokines (IL-23, IL-17A/F, TNF-α) from the psoriatic nail unit spread to the adjacent synovio-entheseal complex. This sensitises the DIP joint to trauma-triggered inflammation (Koebner). Annual PsA risk doubles with nail involvement."},
{type:"heading", text:"Q: What is the Zaias classification of nail psoriasis?"},
{text:"Based on anatomical site: Proximal matrix → pitting, transverse furrows, leukonychia, crumbling. Distal matrix/lunula → erythema of lunula, focal onycholysis. Nail bed → salmon/oil-drop patch, subungual hyperkeratosis, splinter haemorrhages, onycholysis. Nail fold → periungual psoriasis (PsA association)."},
{type:"heading", text:"Q: What makes the oil-drop/salmon patch pathognomonic?"},
{text:"It results from psoriasiform hyperplasia + parakeratosis + microvascular changes + neutrophil trapping in the nail bed — a combination specific to psoriasis. Unlike pitting (also in AA, eczema, LP), oil-spotting is nearly exclusive to psoriasis."},
{type:"heading", text:"Q: NAPSI scoring?"},
{text:"0-8 per nail: matrix component (0-4) + nail bed component (0-4). Each scored 0=none, 1=¼ nail, 2=½ nail, 3=¾ nail, 4=entire nail affected. Max total = 160 (all 20 nails × 8)."},
],
});
// ── THANK YOU SLIDE ───────────────────────────────────────────
{
const sl = pres.addSlide();
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:7.5, fill:{color: C.navy} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:0, w:13.3, h:0.12, fill:{color: C.teal} });
sl.addShape(pres.shapes.RECTANGLE, { x:0, y:7.38, w:13.3, h:0.12, fill:{color: C.gold} });
sl.addText("NAIL ANATOMY & DISORDERS", {
x:0.5, y:2.0, w:12.3, h:1.0, fontSize:36, bold:true, color:C.white, align:"center"
});
sl.addText("Dermatology Resident Study Note — Complete Reference", {
x:0.5, y:3.1, w:12.3, h:0.6, fontSize:20, color:C.teal, align:"center", italic:true
});
sl.addText([
{text:"Sources: ", options:{bold:true, color:C.gold, fontSize:13}},
{text:"Rook's Dermatology 9e Ch.93 • Fitzpatrick's Dermatology Ch.91 • Bolivnia Dermatology 5e Ch.71 • Andrews' Diseases of the Skin Ch.33\nGoodman & Gilman's Pharmacology • Goldman-Cecil Medicine • JAAD 2024 (Hwang JK et al. PMID 38007038) • JAAD 2025 (Ricardo JW et al. PMID 40023404)", options:{color:"AABBCC", fontSize:12}}
], { x:0.5, y:4.2, w:12.3, h:1.2, align:"center", wrap:true });
sl.addText("With Enhanced Clinical Pearls | Mechanism of Nail Changes in Psoriasis | Psoriasis IL-23/Th17/IL-17 Pathway", {
x:0.5, y:5.6, w:12.3, h:0.6, fontSize:13, color:C.teal, align:"center", italic:true
});
}
// ── WRITE FILE ───────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/nails-pptx/Nails_Enhanced.pptx" })
.then(() => console.log("SUCCESS: Nails_Enhanced.pptx written"))
.catch(e => { console.error("ERROR:", e); process.exit(1); });