from pptx import Presentation from pptx.util import Inches prs = Presentation() slides_content = [ ("Title Slide", ["Major Depressive Disorder and Bipolar Disorder", "Based on Kaplan & Sadock's Synopsis of Psychiatry (12th Edition) and DSM-5-TR"]), ("Learning Objectives", [ "Define MDD and Bipolar Disorder", "Discuss epidemiology and risk factors", "Describe clinical manifestations", "Apply DSM-5-TR diagnostic criteria", "Explain management and prognosis" ]), ("Mood Disorders", [ "Persistent disturbances in mood affecting functioning", "Includes MDD, Bipolar I, Bipolar II, Cyclothymic Disorder, Persistent Depressive Disorder" ]), ("MDD: Introduction", [ "One or more major depressive episodes lasting at least 2 weeks", "Associated with significant impairment in functioning" ]), ("MDD: Epidemiology", [ "Lifetime prevalence: 15–20%", "Women affected twice as often as men", "Peak onset: 20–40 years", "Leading cause of disability worldwide" ]), ("MDD: Etiology and Risk Factors", [ "Genetic predisposition", "Monoamine deficiency", "Stress, trauma, bereavement", "Substance abuse and social isolation" ]), ("MDD: Pathophysiology", [ "Reduced serotonin, norepinephrine, and dopamine", "HPA-axis hyperactivity", "Reduced BDNF and hippocampal atrophy" ]), ("MDD: Clinical Features", [ "Sad mood", "Anhedonia", "Fatigue", "Sleep disturbance", "Poor concentration", "Suicidal ideation" ]), ("SIGECAPS", [ "Sleep disturbance", "Interest decreased", "Guilt", "Energy decreased", "Concentration poor", "Appetite change", "Psychomotor change", "Suicidal thoughts" ]), ("DSM-5-TR Criteria for MDD", [ "Five or more symptoms for at least 2 weeks", "Depressed mood or loss of interest must be present", "Symptoms cause distress or impairment" ]), ("MDD: Severity Specifiers", [ "Mild", "Moderate", "Severe", "Melancholic", "Psychotic", "Seasonal", "Peripartum" ]), ("MDD: Management Goals", [ "Symptom remission", "Functional recovery", "Suicide prevention", "Relapse prevention" ]), ("MDD: Pharmacological Treatment", [ "SSRIs: Fluoxetine, Sertraline, Escitalopram", "SNRIs: Venlafaxine, Duloxetine", "Others: Bupropion, Mirtazapine" ]), ("MDD: Non-pharmacological Treatment", [ "Cognitive Behavioral Therapy", "Interpersonal Therapy", "Exercise", "Sleep hygiene", "ECT for severe depression" ]), ("MDD: Prognosis", [ "Early treatment improves outcome", "Psychosis and substance abuse worsen prognosis", "Suicide risk remains important" ]), ("Bipolar Disorder: Introduction", [ "Recurrent episodes of mania, hypomania, and depression", "Includes Bipolar I, Bipolar II, and Cyclothymic Disorder" ]), ("Bipolar Disorder: Epidemiology", [ "Lifetime prevalence: 1–3%", "Equal in males and females", "Peak onset in late adolescence" ]), ("Bipolar Disorder: Etiology", [ "Highly heritable", "Neurotransmitter abnormalities", "Circadian rhythm disturbance", "Stress and sleep deprivation" ]), ("Bipolar Disorder: Mania", [ "Elevated mood", "Grandiosity", "Decreased need for sleep", "Talkativeness", "Risk-taking behavior", "Psychosis in severe cases" ]), ("Bipolar Depression", [ "Sadness", "Fatigue", "Sleep and appetite changes", "Hopelessness", "Suicidal thoughts" ]), ("DSM-5-TR: Manic Episode", [ "Elevated or irritable mood for at least 1 week", "Three or more manic symptoms", "May require hospitalization" ]), ("Hypomanic Episode", [ "Lasts at least 4 days", "Similar symptoms to mania", "No psychosis or hospitalization" ]), ("Bipolar I vs Bipolar II", [ "Bipolar I: Mania present", "Bipolar II: Hypomania present", "Depression is mandatory in Bipolar II" ]), ("Bipolar Disorder: Management Goals", [ "Stabilize mood", "Prevent relapse", "Improve functioning", "Reduce suicide risk" ]), ("Bipolar Disorder: Pharmacological Management", [ "Lithium", "Valproate", "Carbamazepine", "Lamotrigine", "Atypical antipsychotics" ]), ("Bipolar Disorder: Non-pharmacological Management", [ "Psychoeducation", "CBT", "Family-focused therapy", "Sleep regulation", "ECT in severe cases" ]), ("Bipolar Disorder: Prognosis", [ "Good adherence improves outcome", "Frequent relapses worsen prognosis", "Substance abuse is a negative predictor" ]), ("MDD vs Bipolar Disorder", [ "MDD: Depression only", "Bipolar: Mania/Hypomania with depression", "SSRIs are first-line in MDD", "Mood stabilizers are first-line in Bipolar Disorder" ]), ("Take-home Messages", [ "Mood disorders are common and treatable", "Early diagnosis improves outcomes", "Long-term follow-up is essential", "Suicide assessment is mandatory" ]), ("References", [ "Kaplan & Sadock's Synopsis of Psychiatry, 12th Edition", "DSM-5-TR", "APA Practice Guidelines", "World Health Organization" ]) ] for title, bullets in slides_content: slide_layout = prs.slide_layouts[1] # Title and Content slide = prs.slides.add_slide(slide_layout) slide.shapes.title.text = title body = slide.placeholders[1].text_frame body.clear() for i, bullet in enumerate(bullets): if i == 0: body.text = bullet else: p = body.add_paragraph() p.text = bullet out_path = "/mnt/data/MDD_Bipolar_Presentation.pptx" prs.save(out_path) print(f"Saved PowerPoint to {out_path}")

Reading File
Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or missing"

Running Command

mkdir -p /home/daytona/workspace/mdd-bipolar-pptx

Writing File

~/mdd-bipolar-pptx/build.js

const pptxgen = require("pptxgenjs");

const prs = new pptxgen();
prs.layout = "LAYOUT_16x9";
prs.title = "Major Depressive Disorder and Bipolar Disorder";
prs.author = "Psychiatry Education";

// ─── PALETTE ────────────────────────────────────────────────────
const C = {
  navy:      "1A2D4F",   // dominant dark
  teal:      "2E7D8E",   // supporting mid
  tealLight: "3FA8BF",   // accent bars
  gold:      "E8A430",   // accent highlight
  white:     "FFFFFF",
  offWhite:  "F4F7FA",
  textDark:  "1A2D4F",
  textMid:   "3A4A62",
  textLight: "7B92B0",
};

const FONT = "Calibri";

// ─── HELPERS ────────────────────────────────────────────────────

function darkSlide(slide) {
  slide.background = { color: C.navy };
}

function lightSlide(slide) {
  slide.background = { color: C.offWhite };
}

// Top accent bar on light slides
function accentBar(slide, color) {
  slide.addShape(prs.ShapeType.rect, {
    x: 0, y: 0, w: "100%", h: 0.07,
    fill: { color: color || C.teal },
    line: { type: "none" }
  });
}

// Section divider: coloured left strip
function leftStrip(slide, color) {
  slide.addShape(prs.ShapeType.rect, {
    x: 0, y: 0, w: 0.18, h: "100%",
    fill: { color: color || C.teal },
    line: { type: "none" }
  });
}

// Bottom footer bar
function footer(slide, text) {
  slide.addShape(prs.ShapeType.rect, {
    x: 0, y: 5.42, w: "100%", h: 0.21,
    fill: { color: C.navy },
    line: { type: "none" }
  });
  slide.addText(text || "Kaplan & Sadock's Synopsis of Psychiatry, 12th Ed. | DSM-5-TR", {
    x: 0.25, y: 5.42, w: 9.5, h: 0.21,
    fontSize: 7.5, color: C.tealLight, fontFace: FONT, align: "left", valign: "middle"
  });
}

function slideNumber(slide, n) {
  slide.addText(`${n}`, {
    x: 9.5, y: 5.42, w: 0.4, h: 0.21,
    fontSize: 7.5, color: C.gold, fontFace: FONT, align: "right", valign: "middle",
    bold: true
  });
}

// ─── BULLET HELPER ──────────────────────────────────────────────
function makeBullets(items, opts = {}) {
  return items.map((text, i) => ({
    text,
    options: {
      bullet: { type: "bullet", code: "25B8" },
      color: opts.color || C.textDark,
      fontSize: opts.fontSize || 17,
      fontFace: FONT,
      bold: false,
      breakLine: i < items.length - 1
    }
  }));
}

// ─── SLIDES ─────────────────────────────────────────────────────
let n = 0;

// ── 1. TITLE SLIDE ──────────────────────────────────────────────
{
  const s = prs.addSlide();
  darkSlide(s);
  n++;

  // Big decorative circle (top-right)
  s.addShape(prs.ShapeType.ellipse, {
    x: 7.8, y: -1.2, w: 4, h: 4,
    fill: { color: C.teal, transparency: 75 },
    line: { type: "none" }
  });
  // Second circle (bottom-left)
  s.addShape(prs.ShapeType.ellipse, {
    x: -1.5, y: 3.6, w: 3.5, h: 3.5,
    fill: { color: C.tealLight, transparency: 82 },
    line: { type: "none" }
  });

  // Gold accent line
  s.addShape(prs.ShapeType.rect, {
    x: 0.6, y: 1.9, w: 1.6, h: 0.055,
    fill: { color: C.gold },
    line: { type: "none" }
  });

  s.addText("Major Depressive Disorder\n& Bipolar Disorder", {
    x: 0.5, y: 0.55, w: 9, h: 1.5,
    fontSize: 36, bold: true, color: C.white,
    fontFace: FONT, align: "left", valign: "top",
    lineSpacingMultiple: 1.15
  });

  s.addText("Based on Kaplan & Sadock's Synopsis of Psychiatry (12th Edition) and DSM-5-TR", {
    x: 0.5, y: 2.05, w: 8.5, h: 0.55,
    fontSize: 13, color: C.tealLight, fontFace: FONT, align: "left"
  });

  s.addText("Psychiatry Education Series  •  2026", {
    x: 0.5, y: 4.9, w: 9, h: 0.4,
    fontSize: 10.5, color: C.textLight, fontFace: FONT, align: "left", italic: true
  });

  footer(s); slideNumber(s, n);
}

// ── SECTION HEADER helper ────────────────────────────────────────
function sectionHeader(title, subtitle, bgColor) {
  const s = prs.addSlide();
  s.background = { color: bgColor || C.teal };
  n++;

  s.addShape(prs.ShapeType.ellipse, {
    x: 7.2, y: -0.8, w: 3.8, h: 3.8,
    fill: { color: C.white, transparency: 88 },
    line: { type: "none" }
  });

  s.addText(title, {
    x: 0.5, y: 1.6, w: 9, h: 1.1,
    fontSize: 34, bold: true, color: C.white, fontFace: FONT, align: "left"
  });
  if (subtitle) {
    s.addText(subtitle, {
      x: 0.5, y: 2.8, w: 8.5, h: 0.6,
      fontSize: 14, color: C.white, fontFace: FONT, align: "left", italic: true
    });
  }
  footer(s); slideNumber(s, n);
  return s;
}

// ── STANDARD CONTENT SLIDE helper ────────────────────────────────
function contentSlide(title, bullets, stripColor, twoCol) {
  const s = prs.addSlide();
  lightSlide(s);
  leftStrip(s, stripColor || C.teal);
  accentBar(s, stripColor || C.teal);
  n++;

  // Title
  s.addText(title, {
    x: 0.35, y: 0.12, w: 9.4, h: 0.65,
    fontSize: 20, bold: true, color: C.navy, fontFace: FONT, align: "left", valign: "middle"
  });

  // Horizontal rule below title
  s.addShape(prs.ShapeType.line, {
    x: 0.35, y: 0.78, w: 9.3, h: 0,
    line: { color: C.tealLight, width: 1 }
  });

  if (!twoCol) {
    const items = makeBullets(bullets, { fontSize: bullets.length > 6 ? 15 : 17 });
    s.addText(items, {
      x: 0.45, y: 0.9, w: 9.2, h: 4.3,
      fontFace: FONT, valign: "top", paraSpaceAfter: 6
    });
  } else {
    // Two-column layout
    const half = Math.ceil(bullets.length / 2);
    const col1 = bullets.slice(0, half);
    const col2 = bullets.slice(half);
    s.addText(makeBullets(col1, { fontSize: 16 }), {
      x: 0.45, y: 0.9, w: 4.5, h: 4.3, fontFace: FONT, valign: "top", paraSpaceAfter: 7
    });
    s.addText(makeBullets(col2, { fontSize: 16 }), {
      x: 5.1, y: 0.9, w: 4.5, h: 4.3, fontFace: FONT, valign: "top", paraSpaceAfter: 7
    });
    // vertical divider
    s.addShape(prs.ShapeType.line, {
      x: 5.0, y: 0.85, w: 0, h: 4.3,
      line: { color: C.tealLight, width: 0.75, dashType: "dash" }
    });
  }

  footer(s); slideNumber(s, n);
  return s;
}

// ── SIGECAPS SPECIAL SLIDE ───────────────────────────────────────
function sigecapsSlide() {
  const s = prs.addSlide();
  lightSlide(s);
  leftStrip(s, C.navy);
  accentBar(s, C.navy);
  n++;

  s.addText("SIGECAPS Mnemonic", {
    x: 0.35, y: 0.12, w: 9.4, h: 0.65,
    fontSize: 20, bold: true, color: C.navy, fontFace: FONT, align: "left", valign: "middle"
  });
  s.addShape(prs.ShapeType.line, {
    x: 0.35, y: 0.78, w: 9.3, h: 0,
    line: { color: C.navy, width: 1 }
  });

  const items = [
    { letter: "S", label: "Sleep disturbance" },
    { letter: "I", label: "Interest decreased (anhedonia)" },
    { letter: "G", label: "Guilt / worthlessness" },
    { letter: "E", label: "Energy decreased" },
    { letter: "C", label: "Concentration poor" },
    { letter: "A", label: "Appetite / weight change" },
    { letter: "P", label: "Psychomotor change" },
    { letter: "S", label: "Suicidal thoughts" },
  ];

  const cols = 2;
  const rows = Math.ceil(items.length / cols);
  const xBase = [0.42, 5.1];
  const yBase = 0.95;
  const rowH = 0.55;

  items.forEach((item, i) => {
    const col = Math.floor(i / rows);
    const row = i % rows;
    const x = xBase[col];
    const y = yBase + row * rowH;

    // Coloured badge
    s.addShape(prs.ShapeType.roundRect, {
      x, y, w: 0.42, h: 0.42,
      fill: { color: C.navy },
      line: { type: "none" },
      rectRadius: 0.08
    });
    s.addText(item.letter, {
      x, y, w: 0.42, h: 0.42,
      fontSize: 18, bold: true, color: C.gold, fontFace: FONT,
      align: "center", valign: "middle"
    });
    s.addText(item.label, {
      x: x + 0.5, y: y + 0.02, w: 4.0, h: 0.42,
      fontSize: 15.5, color: C.textDark, fontFace: FONT, align: "left", valign: "middle"
    });
  });

  footer(s); slideNumber(s, n);
}

// ── COMPARISON SLIDE ─────────────────────────────────────────────
function comparisonSlide() {
  const s = prs.addSlide();
  s.background = { color: C.offWhite };
  accentBar(s, C.gold);
  n++;

  s.addText("MDD vs Bipolar Disorder", {
    x: 0.4, y: 0.1, w: 9.2, h: 0.65,
    fontSize: 20, bold: true, color: C.navy, fontFace: FONT, align: "center", valign: "middle"
  });
  s.addShape(prs.ShapeType.line, {
    x: 0.4, y: 0.78, w: 9.2, h: 0,
    line: { color: C.gold, width: 1 }
  });

  // MDD column
  s.addShape(prs.ShapeType.roundRect, {
    x: 0.35, y: 0.9, w: 4.3, h: 4.35,
    fill: { color: C.navy },
    line: { type: "none" },
    rectRadius: 0.12
  });
  s.addText("MDD", {
    x: 0.35, y: 0.9, w: 4.3, h: 0.65,
    fontSize: 18, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle"
  });
  const mddBullets = [
    "Depression episodes only",
    "No manic/hypomanic episodes",
    "SSRIs are first-line treatment",
    "Antidepressants used safely",
    "Lifetime prevalence 15–20%",
    "2× more common in women"
  ];
  s.addText(makeBullets(mddBullets, { color: "D0E8F4", fontSize: 14 }), {
    x: 0.5, y: 1.65, w: 4.0, h: 3.4, fontFace: FONT, valign: "top", paraSpaceAfter: 6
  });

  // Bipolar column
  s.addShape(prs.ShapeType.roundRect, {
    x: 5.35, y: 0.9, w: 4.3, h: 4.35,
    fill: { color: C.teal },
    line: { type: "none" },
    rectRadius: 0.12
  });
  s.addText("Bipolar Disorder", {
    x: 5.35, y: 0.9, w: 4.3, h: 0.65,
    fontSize: 18, bold: true, color: C.white, fontFace: FONT, align: "center", valign: "middle"
  });
  const bpBullets = [
    "Mania or hypomania present",
    "Depression mandatory in BDⅡ",
    "Mood stabilizers first-line",
    "Antidepressants used cautiously",
    "Lifetime prevalence 1–3%",
    "Equal in males and females"
  ];
  s.addText(makeBullets(bpBullets, { color: "D4F0F7", fontSize: 14 }), {
    x: 5.5, y: 1.65, w: 4.0, h: 3.4, fontFace: FONT, valign: "top", paraSpaceAfter: 6
  });

  // VS badge
  s.addShape(prs.ShapeType.ellipse, {
    x: 4.58, y: 2.3, w: 0.84, h: 0.84,
    fill: { color: C.gold },
    line: { type: "none" }
  });
  s.addText("VS", {
    x: 4.58, y: 2.3, w: 0.84, h: 0.84,
    fontSize: 15, bold: true, color: C.navy, fontFace: FONT, align: "center", valign: "middle"
  });

  footer(s); slideNumber(s, n);
}

// ── TAKE-HOME SLIDE ──────────────────────────────────────────────
function takeHomeSlide() {
  const s = prs.addSlide();
  s.background = { color: C.navy };
  n++;

  // Decorative shapes
  s.addShape(prs.ShapeType.ellipse, {
    x: -0.8, y: -0.8, w: 3.5, h: 3.5,
    fill: { color: C.teal, transparency: 80 },
    line: { type: "none" }
  });
  s.addShape(prs.ShapeType.ellipse, {
    x: 8.0, y: 3.2, w: 3.2, h: 3.2,
    fill: { color: C.gold, transparency: 85 },
    line: { type: "none" }
  });

  s.addText("Take-home Messages", {
    x: 0.5, y: 0.3, w: 9, h: 0.65,
    fontSize: 24, bold: true, color: C.gold, fontFace: FONT, align: "left"
  });
  s.addShape(prs.ShapeType.line, {
    x: 0.5, y: 0.97, w: 9, h: 0,
    line: { color: C.gold, width: 1 }
  });

  const msgs = [
    ["Mood disorders are common and treatable", "Early diagnosis and treatment significantly improve outcomes"],
    ["Long-term follow-up is essential", "Maintenance therapy reduces relapse and functional decline"],
    ["Differentiate MDD from Bipolar Disorder", "Antidepressants alone can trigger mania in Bipolar Disorder"],
    ["Suicide assessment is mandatory", "Address suicidality at every clinical encounter"],
  ];

  msgs.forEach(([head, body], i) => {
    const y = 1.1 + i * 1.05;
    s.addShape(prs.ShapeType.roundRect, {
      x: 0.42, y, w: 9.16, h: 0.88,
      fill: { color: C.teal, transparency: 82 },
      line: { color: C.tealLight, width: 0.5 },
      rectRadius: 0.1
    });
    // Number badge
    s.addShape(prs.ShapeType.ellipse, {
      x: 0.5, y: y + 0.18, w: 0.52, h: 0.52,
      fill: { color: C.gold },
      line: { type: "none" }
    });
    s.addText(`${i + 1}`, {
      x: 0.5, y: y + 0.18, w: 0.52, h: 0.52,
      fontSize: 14, bold: true, color: C.navy, fontFace: FONT, align: "center", valign: "middle"
    });
    s.addText(head, {
      x: 1.15, y: y + 0.06, w: 8.2, h: 0.38,
      fontSize: 14, bold: true, color: C.white, fontFace: FONT
    });
    s.addText(body, {
      x: 1.15, y: y + 0.46, w: 8.2, h: 0.32,
      fontSize: 12, color: C.tealLight, fontFace: FONT
    });
  });

  footer(s); slideNumber(s, n);
}

// ── REFERENCES SLIDE ─────────────────────────────────────────────
function referencesSlide() {
  const s = prs.addSlide();
  lightSlide(s);
  leftStrip(s, C.gold);
  accentBar(s, C.gold);
  n++;

  s.addText("References", {
    x: 0.35, y: 0.12, w: 9.4, h: 0.65,
    fontSize: 20, bold: true, color: C.navy, fontFace: FONT, align: "left", valign: "middle"
  });
  s.addShape(prs.ShapeType.line, {
    x: 0.35, y: 0.78, w: 9.3, h: 0,
    line: { color: C.gold, width: 1 }
  });

  const refs = [
    "Sadock BJ, Sadock VA, Ruiz P. Kaplan & Sadock's Synopsis of Psychiatry, 12th Ed. Wolters Kluwer; 2022.",
    "American Psychiatric Association. Diagnostic and Statistical Manual of Mental Disorders, 5th Ed Text Revision (DSM-5-TR). APA Publishing; 2022.",
    "APA Practice Guideline for the Treatment of Patients with Major Depressive Disorder, 3rd Ed.",
    "World Health Organization. Depression and Other Common Mental Disorders: Global Health Estimates. WHO; 2017.",
  ];

  refs.forEach((ref, i) => {
    const y = 1.0 + i * 0.9;
    s.addShape(prs.ShapeType.roundRect, {
      x: 0.42, y, w: 9.16, h: 0.72,
      fill: { color: "EEF3F8" },
      line: { color: C.tealLight, width: 0.5 },
      rectRadius: 0.08
    });
    s.addText(`[${i + 1}]  ${ref}`, {
      x: 0.58, y: y + 0.06, w: 8.9, h: 0.6,
      fontSize: 11.5, color: C.textMid, fontFace: FONT, valign: "top"
    });
  });

  footer(s, "References"); slideNumber(s, n);
}

// ═══════════════════════════════════════════════════════════════
// BUILD ALL SLIDES
// ═══════════════════════════════════════════════════════════════

// 1 - Title already done above

// 2 - Learning Objectives
contentSlide("Learning Objectives", [
  "Define MDD and Bipolar Disorder",
  "Discuss epidemiology and risk factors",
  "Describe clinical manifestations",
  "Apply DSM-5-TR diagnostic criteria",
  "Explain management and prognosis"
], C.teal);

// 3 - Mood Disorders overview
contentSlide("Mood Disorders: Overview", [
  "Persistent disturbances in mood that affect daily functioning",
  "Major Depressive Disorder (MDD)",
  "Bipolar I and Bipolar II Disorder",
  "Cyclothymic Disorder",
  "Persistent Depressive Disorder (Dysthymia)"
], C.teal);

// ── SECTION: MDD
sectionHeader("Major Depressive\nDisorder (MDD)", "Epidemiology · Etiology · Clinical Features · Management");

contentSlide("MDD: Introduction", [
  "Characterised by one or more major depressive episodes",
  "Each episode lasts at least 2 weeks",
  "Associated with significant impairment in occupational and social functioning",
  "Distinct from normal sadness: pervasive, persistent, and disabling"
], C.teal);

contentSlide("MDD: Epidemiology", [
  "Lifetime prevalence: 15–20% of the general population",
  "Women affected twice as often as men",
  "Peak onset: 20–40 years of age",
  "Leading cause of disability worldwide (WHO)",
  "High rates of comorbid anxiety, substance use, and medical illness"
], C.teal);

contentSlide("MDD: Etiology and Risk Factors", [
  "Genetic predisposition (heritability ~40%)",
  "Monoamine deficiency (serotonin, norepinephrine, dopamine)",
  "HPA-axis dysregulation and elevated cortisol",
  "Stressful life events, trauma, and bereavement",
  "Substance abuse and social isolation",
  "Chronic medical illness (e.g. hypothyroidism, cancer)"
], C.teal);

contentSlide("MDD: Pathophysiology", [
  "Reduced serotonin, norepinephrine, and dopamine neurotransmission",
  "HPA-axis hyperactivity → elevated cortisol",
  "Reduced Brain-Derived Neurotrophic Factor (BDNF)",
  "Hippocampal atrophy on neuroimaging",
  "Prefrontal cortex hypoactivity (neuroimaging studies)"
], C.teal);

contentSlide("MDD: Clinical Features", [
  "Persistent sad, empty, or hopeless mood",
  "Anhedonia (loss of interest/pleasure)",
  "Fatigue and low energy",
  "Insomnia or hypersomnia",
  "Poor concentration and indecisiveness",
  "Psychomotor agitation or retardation",
  "Suicidal ideation or attempts"
], C.teal);

// SIGECAPS special slide
sigecapsSlide();

contentSlide("DSM-5-TR Criteria for MDD", [
  "Five or more symptoms present for at least 2 weeks",
  "Depressed mood OR loss of interest/pleasure must be present",
  "Symptoms represent a change from previous functioning",
  "Cause clinically significant distress or impairment",
  "Not attributable to a substance or medical condition",
  "No history of manic or hypomanic episodes"
], C.teal);

contentSlide("MDD: Severity and Specifiers", [
  "Mild · Moderate · Severe",
  "With Melancholic Features",
  "With Psychotic Features (mood-congruent or incongruent)",
  "With Peripartum Onset",
  "With Seasonal Pattern (Seasonal Affective Disorder)",
  "With Anxious Distress"
], C.teal);

contentSlide("MDD: Management Goals", [
  "Achieve full symptom remission",
  "Restore premorbid functional capacity",
  "Suicide risk assessment and prevention",
  "Prevent relapse and recurrence",
  "Address comorbid conditions"
], C.teal);

contentSlide("MDD: Pharmacological Treatment", [
  "SSRIs (first-line): Fluoxetine, Sertraline, Escitalopram, Paroxetine",
  "SNRIs: Venlafaxine, Duloxetine",
  "Atypical agents: Bupropion (also for smoking cessation), Mirtazapine",
  "TCAs: Amitriptyline, Imipramine (second-line; cardiac risk)",
  "MAOIs: Phenelzine, Tranylcypromine (reserved for refractory cases)",
  "Treatment trial: 4–8 weeks at adequate dose before switching"
], C.teal);

contentSlide("MDD: Non-pharmacological Treatment", [
  "Cognitive Behavioural Therapy (CBT) — evidence-based first-line",
  "Interpersonal Therapy (IPT)",
  "Behavioural Activation",
  "Regular aerobic exercise",
  "Sleep hygiene optimisation",
  "Electroconvulsive Therapy (ECT) for severe/treatment-resistant/psychotic MDD"
], C.teal);

contentSlide("MDD: Prognosis", [
  "50% of patients recover within 6 months with treatment",
  "Early treatment initiation improves long-term outcome",
  "Risk of recurrence increases with each episode",
  "Comorbid psychosis and substance abuse worsen prognosis",
  "Chronic subthreshold symptoms are common",
  "Suicide remains a significant risk throughout course of illness"
], C.teal);

// ── SECTION: Bipolar Disorder
sectionHeader("Bipolar Disorder", "Epidemiology · Subtypes · Mania · Management", C.navy);

contentSlide("Bipolar Disorder: Introduction", [
  "Characterised by recurrent episodes of mania/hypomania and depression",
  "Bipolar I: at least one full manic episode",
  "Bipolar II: hypomania + major depressive episodes (no full mania)",
  "Cyclothymic Disorder: subthreshold mood swings for ≥2 years",
  "Significant functional impairment between episodes"
], C.navy);

contentSlide("Bipolar Disorder: Epidemiology", [
  "Lifetime prevalence: 1–3% (Bipolar I ~1%; Bipolar II ~1–2%)",
  "Equal prevalence in males and females",
  "Peak onset: late adolescence (mean age ~20 years)",
  "Bipolar I onset often with manic episode",
  "Strong genetic component — most heritable mood disorder"
], C.navy);

contentSlide("Bipolar Disorder: Etiology", [
  "Heritability: ~80% (strongest genetic link in psychiatry)",
  "Neurotransmitter abnormalities (dopamine, serotonin, GABA)",
  "Circadian rhythm dysregulation",
  "Sleep deprivation as a precipitant for mania",
  "Stressful life events may trigger episodes",
  "Substance abuse (especially stimulants, cannabis) as comorbidity"
], C.navy);

contentSlide("Bipolar Disorder: Manic Episode", [
  "Elevated, expansive, or irritable mood lasting ≥1 week",
  "Grandiosity or inflated self-esteem",
  "Decreased need for sleep (feels rested after 3 hours)",
  "Pressured speech and racing thoughts",
  "Distractibility and increased goal-directed activity",
  "Risky behaviour (spending sprees, hypersexuality, reckless driving)",
  "Psychosis may occur in severe mania"
], C.navy);

contentSlide("Bipolar Depression", [
  "Persistent sad, empty, or hopeless mood",
  "Profound fatigue and hypersomnia (common in bipolar depression)",
  "Hyperphagia and weight gain (vs. typical MDD)",
  "Psychomotor retardation",
  "Hopelessness and worthlessness",
  "High risk of suicidal ideation and attempts"
], C.navy);

contentSlide("DSM-5-TR: Manic Episode Criteria", [
  "Elevated/expansive/irritable mood AND increased energy for ≥1 week",
  "Three or more manic symptoms (four if mood is irritable only)",
  "Sufficient severity to cause marked impairment",
  "May require hospitalisation for safety",
  "Not attributable to substance or medical condition"
], C.navy);

contentSlide("Hypomanic Episode", [
  "Same symptom profile as mania but less severe",
  "Duration: at least 4 consecutive days",
  "No psychosis, no hospitalisation required",
  "Does NOT cause marked functional impairment",
  "Observable change in behaviour noted by others",
  "Defines Bipolar II when combined with MDD episodes"
], C.navy);

contentSlide("Bipolar I vs Bipolar II", [
  "Bipolar I: Full manic episode (may or may not have depression)",
  "Bipolar II: Hypomanic + major depressive episodes required",
  "Depression is mandatory in Bipolar II",
  "Bipolar II is NOT milder — depressive burden is heavy",
  "Bipolar I carries higher hospitalisation risk",
  "Both carry significant suicide risk"
], C.navy, true);

contentSlide("Bipolar Disorder: Management Goals", [
  "Acute stabilisation of manic or depressive episode",
  "Prevent relapse with long-term mood stabilisation",
  "Improve quality of life and functioning",
  "Reduce suicide risk",
  "Minimise medication side effects"
], C.navy);

contentSlide("Bipolar Disorder: Pharmacological Management", [
  "Lithium — gold standard for Bipolar I; reduces suicide risk",
  "Valproate (Valproic acid) — effective for mania; avoid in pregnancy",
  "Carbamazepine — alternative mood stabiliser",
  "Lamotrigine — first-line for Bipolar II depression",
  "Atypical antipsychotics: Quetiapine, Olanzapine, Aripiprazole",
  "Caution: Antidepressants alone may precipitate mania"
], C.navy);

contentSlide("Bipolar Disorder: Non-pharmacological Management", [
  "Psychoeducation (most important non-pharmacological intervention)",
  "Cognitive Behavioural Therapy (CBT)",
  "Family-Focused Therapy",
  "Interpersonal and Social Rhythm Therapy (IPSRT)",
  "Regular sleep schedule — circadian stabilisation",
  "ECT for severe depressive or manic episodes unresponsive to medication"
], C.navy);

contentSlide("Bipolar Disorder: Prognosis", [
  "Chronic, relapsing illness — most patients have multiple episodes",
  "Good medication adherence significantly improves outcome",
  "Frequent relapses worsen cognitive and functional outcomes",
  "Substance abuse is the strongest negative predictor",
  "15–20× higher suicide rate than general population",
  "Early intervention and maintenance therapy are key"
], C.navy);

// ── COMPARISON
comparisonSlide();

// ── TAKE-HOME
takeHomeSlide();

// ── REFERENCES
referencesSlide();

// ─── SAVE ────────────────────────────────────────────────────────
const outPath = "/home/daytona/workspace/mdd-bipolar-pptx/MDD_Bipolar_Presentation.pptx";
prs.writeFile({ fileName: outPath }).then(() => {
  console.log(`✅  Saved: ${outPath}  (${n} slides)`);
}).catch(err => {
  console.error("❌  Error:", err);
  process.exit(1);
});
Running Command

cd /home/daytona/workspace/mdd-bipolar-pptx && node build.js 2>&1

Your presentation is ready. Here's what was built:

MDD Bipolar Presentation

Presentation · PPTX


32 slides, professionally designed with a clinical psychiatry theme. Here's a breakdown of the structure and design choices:

Design

  • Color palette: Deep navy (#1A2D4F) dominant, teal (#2E7D8E) for MDD sections, navy-dark for Bipolar sections, gold (#E8A430) accents
  • Layout: Left-strip accent bar, horizontal rule under every title, bottom footer with source attribution and slide numbers
  • Decorative circles/shapes on title, section headers, and take-home slides for visual depth

Slide Structure (32 slides)

GroupSlides
Title1
Objectives + Overview2
MDD Section (teal theme)Section header + 12 content slides
SIGECAPSSpecial badge-layout slide
Bipolar Section (navy theme)Section header + 11 content slides
MDD vs BipolarSide-by-side comparison (dark columns)
Take-home MessagesNumbered card layout
ReferencesCard-box layout with full citations

Special Slides

  • SIGECAPS: Each letter shown as a gold-on-navy badge beside its full label
  • MDD vs Bipolar comparison: Two dark column cards with a gold "VS" badge
  • Take-home messages: Numbered callout cards with headline + sub-text
  • References: Formatted cards with full APA-style citations
This is a shared conversation. Sign in to Orris to start your own chat.