attachment
attachment
attachment
attachment

Explain easy I can't understand

analyse_media
analyse_media

क्षार निर्माण विधि (Kshara Nirmana Vidhi) - Easy Explanation

This topic is about how to make Kshara in Ayurveda. Kshara is an alkaline/caustic medicine made from the ash of plants. It is used for treating diseases like piles, fistula, and skin conditions.

📦 What is Kshara?

Kshara = A medicine made from burning plants → collecting ash → processing it into a powerful alkaline substance.

🌿 Step 1: Raw Materials (3 Types)

Think of it like "strength levels" - Mild, Medium, and Strong:
TypeHindi NameExample PlantsStrength
Aमृदु क्षार द्रव्य (Mridu)Apamarga, Kutaja, Palasha, Arka, SnuhiMild (weak)
Bमध्यम क्षार द्रव्य (Madhyama)Bhasma Sharkara, Shuddha Sharkara, ShuktiMedium
Cतीक्ष्ण क्षार द्रव्य (Teekshna)Danti, Langali, Hingu, SarjiksharaStrong/Caustic

🔥 Step 2: How to Make Pratisaraniya Kshara (for External Use)

Here is the full process explained like a recipe:
STEP 1: Take मृदु क्षार द्रव्य (mild plants like Apamarga)
        ↓
        Cut into small pieces → Dry them well
        Mix with small quantity of Shuddha Sharkara (purified sugar/lime)
        Do this in a WIND-FREE place (निवात स्थान) — so ash doesn't fly away!
        ↓
STEP 2: BURN this mixture using dry Tila (sesame) twigs as fuel
        ↓
STEP 3: Collect the GREYISH ASH formed after burning
        ↓
STEP 4: Mix ash with 6 parts of WATER (जल) or COW URINE (गोमूत्र)
        ↓
STEP 5: FILTER through a cloth → 21 TIMES (to remove all impurities)
        ↓
STEP 6: Take the clear liquid → Put in IRON VESSEL (लोह पात्र)
        Heat on MILD FIRE while stirring constantly
        ↓
STEP 7: Water evaporates → Liquid becomes REDDISH + SLIMY
        ↓
STEP 8: Keep heating → It becomes a CLEAR WHITE POWDER
        ↓
        ✅ This is मृदु क्षार (Mild Kshara) — READY!

⚗️ Step 3: Upgrading to Madhyama & Teekshna Kshara

Once you have मृदु क्षार, you can make stronger types:
To make मध्यम क्षार (Medium strength):
  • Heat मृदु क्षार until red hot
  • Add मध्यम क्षार द्रव्य (8 Pala) - medium strength ingredients
  • Boil until it forms a paste (not too solid, not too liquid)
  • Done! → मध्यम क्षार
To make तीक्ष्ण क्षार (Strong/Caustic):
  • Again heat मृदु क्षार until red hot
  • Add तीक्ष्ण क्षार द्रव्य (20 gm each) - strong ingredients
  • Boil until paste forms
  • Done! → तीक्ष्ण क्षार
Think of it like upgrading: Mild base + Medium ingredients = Medium Kshara. Mild base + Strong ingredients = Strong Kshara.

💧 BONUS: Panaya Kshara (पानाय क्षार) - for Internal Use

This is a drinkable form of Kshara:
Ingredients: Ash (भस्म) of - Tila, Ikshu, Palasha, Sarshapa, Yava, Mulaka
      ↓
Mix with 4 parts Gomootra (cow urine) / Ajamootra / Avamootra
      ↓
Mix well + Filter
      ↓
Add - Saindhava Lavana, Sauvarchala Lavana, Kushtha, 
      Yashtimadhu, Ajamoda (1 Pala each)
      ↓
Heat in iron vessel over mild fire
      ↓
Heat till Leha (thick paste/linctus) consistency is reached
      ↓
✅ पानाय क्षार READY!

🧠 Quick Summary to Remember

PointDetail
What is Kshara?Alkaline medicine made from plant ash
3 typesMridu (mild), Madhyama (medium), Teekshna (strong)
Key stepsCut → Dry → Burn → Ash → Mix water → Filter 21x → Heat → Powder
Iron vessel usedYes - for heating the filtrate
Filtered how many times?21 times (important exam answer!)
External typePratisaraniya Kshara
Internal typePanaya Kshara
This topic appeared in Oct 2018, Sept 2022, and Feb 2021 exams - so it is important! The most likely exam question is: "Describe the method of preparation of Pratisaraniya Kshara."

Now iska pdf bnao and isme sloka dike asa Karo

Reading File
Finding Sources
Running Command

ls /home/daytona/workspace/ && mkdir -p /home/daytona/workspace/kshara-pdf

Writing File

~/kshara-pdf/create_kshara_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
import os

# Register a Unicode font that supports Devanagari
# Try to find a font that supports Hindi/Sanskrit
font_paths = [
    "/usr/share/fonts/truetype/lohit-devanagari/Lohit-Devanagari.ttf",
    "/usr/share/fonts/truetype/noto/NotoSansDevanagari-Regular.ttf",
    "/usr/share/fonts/opentype/noto/NotoSansDevanagari-Regular.otf",
    "/usr/share/fonts/truetype/noto/NotoSerif-Regular.ttf",
    "/usr/share/fonts/truetype/freefont/FreeSerif.ttf",
    "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf",
]

deva_font = None
for fp in font_paths:
    if os.path.exists(fp):
        print(f"Found font: {fp}")
        try:
            pdfmetrics.registerFont(TTFont('DevaFont', fp))
            deva_font = 'DevaFont'
            break
        except Exception as e:
            print(f"Error loading {fp}: {e}")

if not deva_font:
    print("No Devanagari font found, will use transliteration")

# Also find a regular font for English
eng_font_paths = [
    "/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf",
    "/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf",
]
for fp in eng_font_paths:
    if os.path.exists(fp):
        print(f"Found English font: {fp}")
        try:
            pdfmetrics.registerFont(TTFont('EngFont', fp))
            break
        except Exception as e:
            print(f"Error: {e}")

# List all available fonts
import subprocess
result = subprocess.run(['fc-list', ':lang=hi'], capture_output=True, text=True)
print("Hindi fonts available:")
print(result.stdout[:2000])
Running Command

python3 /home/daytona/workspace/kshara-pdf/create_kshara_pdf.py

Running Command

fc-list | head -30 && pip show reportlab 2>/dev/null | head -5

Running Command

cd /home/daytona/workspace/kshara-pdf && wget -q "https://github.com/googlefonts…

Running Command

cd /home/daytona/workspace/kshara-pdf && wget -q "https://github.com/googlefonts…

Writing File

~/kshara-pdf/make_pdf.py

from reportlab.lib.pagesizes import A4
from reportlab.lib import colors
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm, mm
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether, PageBreak
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY, TA_RIGHT
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont

# ── Register fonts ──────────────────────────────────────────────────────────
FONT_DIR = "/home/daytona/workspace/kshara-pdf/"
pdfmetrics.registerFont(TTFont('Deva',     FONT_DIR + 'NotoSansDevanagari-Regular.ttf'))
pdfmetrics.registerFont(TTFont('DevaBold', FONT_DIR + 'NotoSansDevanagari-Bold.ttf'))
pdfmetrics.registerFont(TTFont('Eng',      '/usr/share/fonts/truetype/liberation/LiberationSerif-Regular.ttf'))
pdfmetrics.registerFont(TTFont('EngBold',  '/usr/share/fonts/truetype/liberation/LiberationSerif-Bold.ttf'))

# ── Colour palette ───────────────────────────────────────────────────────────
SAFFRON      = colors.HexColor('#E07000')
DARK_GREEN   = colors.HexColor('#1A5E20')
GOLD         = colors.HexColor('#C89000')
CREAM        = colors.HexColor('#FFF8E7')
LIGHT_ORANGE = colors.HexColor('#FFF3E0')
SLOKA_BG     = colors.HexColor('#F3E5F5')
SLOKA_BORDER = colors.HexColor('#7B1FA2')
STEP_BG      = colors.HexColor('#E8F5E9')
STEP_BORDER  = colors.HexColor('#388E3C')
TABLE_HEADER = colors.HexColor('#BF360C')
TABLE_ALT    = colors.HexColor('#FBE9E7')
WHITE        = colors.white
BLACK        = colors.HexColor('#1A1A1A')

W, H = A4   # 595 x 842 pts

# ── Styles ───────────────────────────────────────────────────────────────────
def make_styles():
    s = {}
    s['title'] = ParagraphStyle('title',
        fontName='DevaBold', fontSize=22, textColor=SAFFRON,
        alignment=TA_CENTER, spaceAfter=4, leading=28)
    s['subtitle'] = ParagraphStyle('subtitle',
        fontName='Deva', fontSize=13, textColor=DARK_GREEN,
        alignment=TA_CENTER, spaceAfter=2, leading=18)
    s['exam'] = ParagraphStyle('exam',
        fontName='EngBold', fontSize=9, textColor=GOLD,
        alignment=TA_CENTER, spaceAfter=6)
    s['section'] = ParagraphStyle('section',
        fontName='DevaBold', fontSize=14, textColor=SAFFRON,
        spaceBefore=14, spaceAfter=4, leading=20)
    s['sloka_heading'] = ParagraphStyle('sloka_heading',
        fontName='DevaBold', fontSize=12, textColor=SLOKA_BORDER,
        alignment=TA_CENTER, spaceBefore=8, spaceAfter=4, leading=16)
    s['sloka'] = ParagraphStyle('sloka',
        fontName='Deva', fontSize=11, textColor=colors.HexColor('#4A148C'),
        alignment=TA_CENTER, leading=18, spaceAfter=2)
    s['sloka_trans'] = ParagraphStyle('sloka_trans',
        fontName='Eng', fontSize=9, textColor=colors.HexColor('#555555'),
        alignment=TA_CENTER, leading=14, spaceAfter=2, italic=True)
    s['sloka_meaning'] = ParagraphStyle('sloka_meaning',
        fontName='Eng', fontSize=9.5, textColor=BLACK,
        alignment=TA_JUSTIFY, leading=14, spaceAfter=4, leftIndent=6, rightIndent=6)
    s['step'] = ParagraphStyle('step',
        fontName='Deva', fontSize=11, textColor=BLACK,
        leading=16, spaceAfter=3, leftIndent=10)
    s['step_bold'] = ParagraphStyle('step_bold',
        fontName='DevaBold', fontSize=11, textColor=DARK_GREEN,
        leading=16, spaceAfter=3, leftIndent=10)
    s['body'] = ParagraphStyle('body',
        fontName='Eng', fontSize=10, textColor=BLACK,
        leading=15, spaceAfter=4, alignment=TA_JUSTIFY)
    s['body_bold'] = ParagraphStyle('body_bold',
        fontName='EngBold', fontSize=10, textColor=BLACK,
        leading=15, spaceAfter=4)
    s['note'] = ParagraphStyle('note',
        fontName='Eng', fontSize=8.5, textColor=colors.HexColor('#555'),
        leading=12, spaceAfter=3, leftIndent=8)
    s['arrow'] = ParagraphStyle('arrow',
        fontName='Eng', fontSize=14, textColor=DARK_GREEN,
        alignment=TA_CENTER, leading=16, spaceAfter=0)
    s['table_h'] = ParagraphStyle('table_h',
        fontName='DevaBold', fontSize=10, textColor=WHITE,
        alignment=TA_CENTER, leading=14)
    s['table_c'] = ParagraphStyle('table_c',
        fontName='Deva', fontSize=9.5, textColor=BLACK,
        alignment=TA_LEFT, leading=13)
    s['table_ce'] = ParagraphStyle('table_ce',
        fontName='Eng', fontSize=9, textColor=BLACK,
        alignment=TA_LEFT, leading=13)
    s['footer'] = ParagraphStyle('footer',
        fontName='Eng', fontSize=8, textColor=colors.HexColor('#888'),
        alignment=TA_CENTER)
    return s

# ── Helper: Sloka box ────────────────────────────────────────────────────────
def sloka_box(styles, ref, sloka_lines, transliteration, meaning):
    """Returns a Table acting as a shaded sloka box."""
    content = []
    content.append(Paragraph(f"📖  {ref}", styles['sloka_heading']))
    for line in sloka_lines:
        content.append(Paragraph(line, styles['sloka']))
    content.append(Spacer(1, 3))
    if transliteration:
        content.append(Paragraph(f"<i>{transliteration}</i>", styles['sloka_trans']))
    content.append(Spacer(1, 4))
    content.append(Paragraph(f"<b>Meaning:</b> {meaning}", styles['sloka_meaning']))

    t = Table([[content]], colWidths=[W - 4*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND', (0,0), (-1,-1), SLOKA_BG),
        ('BOX',        (0,0), (-1,-1), 1.5, SLOKA_BORDER),
        ('LEFTPADDING',  (0,0), (-1,-1), 10),
        ('RIGHTPADDING', (0,0), (-1,-1), 10),
        ('TOPPADDING',   (0,0), (-1,-1), 8),
        ('BOTTOMPADDING',(0,0), (-1,-1), 8),
        ('ROUNDEDCORNERS', [6]),
    ]))
    return t

# ── Helper: Step box ─────────────────────────────────────────────────────────
def step_box(styles, number, hindi_text, english_text, note=None):
    rows = []
    rows.append(Paragraph(f"<b>Step {number}:</b>  {hindi_text}", styles['step_bold']))
    rows.append(Paragraph(english_text, styles['body']))
    if note:
        rows.append(Paragraph(f"★ {note}", styles['note']))
    t = Table([[rows]], colWidths=[W - 4*cm])
    t.setStyle(TableStyle([
        ('BACKGROUND',   (0,0), (-1,-1), STEP_BG),
        ('BOX',          (0,0), (-1,-1), 1, STEP_BORDER),
        ('LEFTPADDING',  (0,0), (-1,-1), 10),
        ('RIGHTPADDING', (0,0), (-1,-1), 10),
        ('TOPPADDING',   (0,0), (-1,-1), 6),
        ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ]))
    return t

# ── Page background callback ─────────────────────────────────────────────────
def on_page(canvas, doc):
    canvas.saveState()
    # Cream background
    canvas.setFillColor(CREAM)
    canvas.rect(0, 0, W, H, fill=1, stroke=0)
    # Top orange bar
    canvas.setFillColor(SAFFRON)
    canvas.rect(0, H - 1.2*cm, W, 1.2*cm, fill=1, stroke=0)
    # Bottom green bar
    canvas.setFillColor(DARK_GREEN)
    canvas.rect(0, 0, W, 0.8*cm, fill=1, stroke=0)
    # Page number
    canvas.setFillColor(WHITE)
    canvas.setFont('Eng', 9)
    canvas.drawCentredString(W/2, 0.25*cm, f"Page {doc.page}")
    canvas.restoreState()

# ── Build document ────────────────────────────────────────────────────────────
OUT = "/home/daytona/workspace/kshara-pdf/Kshara_Nirmana_Vidhi.pdf"
doc = SimpleDocTemplate(
    OUT,
    pagesize=A4,
    rightMargin=2*cm, leftMargin=2*cm,
    topMargin=2.2*cm, bottomMargin=1.5*cm,
    title="Kshara Nirmana Vidhi",
    author="Ayurveda Notes"
)
S = make_styles()
story = []

# ═══════════════════════════════════════════════════════════════════
#  PAGE 1 – Title + Classification
# ═══════════════════════════════════════════════════════════════════
story.append(Spacer(1, 0.5*cm))
story.append(Paragraph("क्षार निर्माण विधि", S['title']))
story.append(Paragraph("Kshara Nirmana Vidhi", S['subtitle']))
story.append(Paragraph("(Ayurvedic Method of Kshara Preparation)", S['subtitle']))
story.append(Spacer(1, 0.2*cm))
story.append(Paragraph("📅  Exam Questions: Oct 2018 | Sept 2022 | Feb 2021  (5 Marks)", S['exam']))
story.append(HRFlowable(width="100%", thickness=2, color=SAFFRON, spaceAfter=10))

# ── Definition ───────────────────────────────────────────────────
story.append(Paragraph("क्षार (Kshara) — परिभाषा / Definition", S['section']))
story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/3",
    ["क्षरणात् क्षार इत्युक्तः रोगाणां क्षरणाद् अपि ।",
     "क्षारः सर्वापकृष्टानां क्षाराणामुत्तमो मतः ॥"],
    "Ksharanat kshara ityuktah roganam ksharanad api |",
    "The word 'Kshara' is derived from the root 'Kshara' meaning 'to corrode/flow away'. "
    "Kshara corrodes the diseased tissue. Apamarga Kshara is considered the best among all Ksharas."
))
story.append(Spacer(1, 0.3*cm))

# ── Types ────────────────────────────────────────────────────────
story.append(Paragraph("क्षार के प्रकार / Types of Kshara", S['section']))
story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/4",
    ["प्रतिसारणीयश्च पानीयश्च द्विधा स्मृतः ।",
     "प्रतिसारणीयः श्रेष्ठश्च क्षारकर्माणि साधयेत् ॥"],
    "Pratisaraniyashcha paniyashcha dvidha smritah |",
    "Kshara is of two types: (1) Pratisaraniya Kshara — for external application/surgical use; "
    "(2) Paniya Kshara — for internal consumption (oral use)."
))
story.append(Spacer(1, 0.3*cm))

# ── Classification table ─────────────────────────────────────────
story.append(Paragraph("क्षार द्रव्यों का वर्गीकरण / Classification of Kshara Dravya", S['section']))

table_data = [
    [Paragraph("प्रकार / Type", S['table_h']),
     Paragraph("बल / Potency", S['table_h']),
     Paragraph("प्रमुख द्रव्य / Main Dravyas", S['table_h'])],
    [Paragraph("A. मृदु क्षार\nMridu Kshara", S['table_c']),
     Paragraph("Mild (कोमल)", S['table_ce']),
     Paragraph("अपामार्ग, कुटज, पलाश, आरग्वध, बिल्व, अर्क, स्नुही, वासा, कदली, चित्रक, अग्निमन्थ, गुंजा\n"
               "(Apamarga, Kutaja, Palasha, Aragvadha, Bilva, Arka, Snuhi, Vasa, Kadali, Chitraka, Agnimantha, Gunja)",
               S['table_ce'])],
    [Paragraph("B. मध्यम क्षार\nMadhyama Kshara", S['table_c']),
     Paragraph("Medium (मध्यम)", S['table_ce']),
     Paragraph("भस्म शर्करा, शुद्ध शर्करा, शुक्ति, शंखनाभि\n"
               "(Bhasma Sharkara, Shuddha Sharkara, Shukti, Shankhanabhi)",
               S['table_ce'])],
    [Paragraph("C. तीक्ष्ण क्षार\nTeekshna Kshara", S['table_c']),
     Paragraph("Strong (तीव्र)", S['table_ce']),
     Paragraph("दन्ती, द्रवन्ती, चित्रक, लांगली, करंज, स्वर्णक्षीरी, हिंगु, अतिविष, सर्जिक्षार, प्रवाल, बिड लवण, सौवर्चल लवण\n"
               "(Danti, Dravanti, Chitraka, Langali, Karanja, Swarnaksheeri, Hingu, Ativisha, Sarjikshara, Pravala, Bida Lavana, Sauvarchala Lavana)",
               S['table_ce'])],
]

col_w = [3.5*cm, 3*cm, 9*cm]
tbl = Table(table_data, colWidths=col_w, repeatRows=1)
tbl.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,0), TABLE_HEADER),
    ('BACKGROUND',   (0,1), (-1,1), LIGHT_ORANGE),
    ('BACKGROUND',   (0,2), (-1,2), colors.HexColor('#E8F5E9')),
    ('BACKGROUND',   (0,3), (-1,3), colors.HexColor('#FFF3E0')),
    ('BOX',          (0,0), (-1,-1), 1, DARK_GREEN),
    ('INNERGRID',    (0,0), (-1,-1), 0.5, colors.HexColor('#AAAAAA')),
    ('VALIGN',       (0,0), (-1,-1), 'MIDDLE'),
    ('TOPPADDING',   (0,0), (-1,-1), 6),
    ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ('LEFTPADDING',  (0,0), (-1,-1), 6),
    ('RIGHTPADDING', (0,0), (-1,-1), 6),
]))
story.append(tbl)
story.append(Spacer(1, 0.3*cm))

# ── Sloka on Mridu Kshara Dravya ─────────────────────────────────
story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/8 — मृदु क्षार द्रव्य",
    ["अपामार्गश्च पलाशो बिल्वार्कस्नुहिकादयः ।",
     "मृद्वग्नयः कटुपाकाश्च क्षाराः प्रोक्ता मृदू स्मृताः ॥"],
    "Apamargashcha palasho bilvarkasnuhikadayah |",
    "Apamarga, Palasha, Bilva, Arka, Snuhi and similar plants which are mild in potency "
    "and pungent in Vipaka (post-digestive taste) are described as Mridu Kshara Dravyas."
))

story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════
#  PAGE 2 – Pratisaraniya Kshara Preparation
# ═══════════════════════════════════════════════════════════════════
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("प्रतिसारणीय क्षार निर्माण विधि", S['title']))
story.append(Paragraph("(Pratisaraniya Kshara — External Application Type)", S['subtitle']))
story.append(HRFlowable(width="100%", thickness=2, color=SAFFRON, spaceAfter=10))

# ── Opening sloka ─────────────────────────────────────────────────
story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/9-10 — निर्माण विधि श्लोक",
    ["छित्त्वा तु क्षारद्रव्याणि शुष्काणि निवाते दहेत् ।",
     "तिलकाष्ठैः समिद्भिश्च भस्म संग्राहयेत् ततः ॥",
     "षड्भागेन जलेनाथ भस्म तत् परिमिश्र्य च ।",
     "वस्त्रेण विंशतिस्त्रिंशत्कृत्वश्छाद्य विनिर्हरेत् ॥"],
    "Chittva tu ksharadravyani shushkani nivate dahet | tilakashthaiah samidbhishcha bhasma sangrahayeta tatah ||",
    "Cut the Kshara Dravyas into pieces, dry them and burn in a windless place (Nivaata Sthana) "
    "using Tila (sesame) twigs as fuel. Collect the ash. Then mix it with 6 parts of water and "
    "filter through a cloth 21-30 times."
))
story.append(Spacer(1, 0.3*cm))

story.append(Paragraph("चरण-दर-चरण विधि / Step-by-Step Process", S['section']))

# Steps with arrows
steps = [
    ("1", "संग्रह एवं कर्तन (Collection & Cutting)",
     "Take Mridu Kshara Dravya (e.g., Apamarga). Cut the plant parts into small pieces. "
     "Dry them thoroughly in sunlight.",
     "Drying is essential — wet material will not burn properly."),
    ("2", "मिश्रण (Mixing)",
     "Mix the dried pieces with a small quantity of Shuddha Sharkara (purified lime/sugar). "
     "This helps in proper combustion.",
     "Do this in Nivaata Sthana (निवात स्थान) — a wind-free place, to prevent the ash from blowing away."),
    ("3", "दहन (Combustion / Burning)",
     "Burn the mixture using dried twigs of Tila (sesame plant) as fuel. "
     "Allow it to burn completely till only ash remains.",
     "Tila twigs give the right type of flame — not too strong, not too weak."),
    ("4", "भस्म संग्रह (Ash Collection)",
     "After the fire cools down naturally, collect the greyish ash (Bhasma) carefully.",
     None),
    ("5", "द्रव मिश्रण (Mixing with Liquid)",
     "Mix the collected ash with 6 parts of Jala (जल = water) OR Gomootra (गोमूत्र = cow urine), "
     "depending on the formulation requirement.",
     "Gomootra enhances the alkaline property and adds medicinal value."),
    ("6", "निस्यंदन — 21 बार (Filtration — 21 Times)",
     "Filter the mixture through a clean thick cotton cloth. "
     "Repeat this filtration process EXACTLY 21 times (एकविंशति बार).",
     "21 filtrations remove all insoluble carbon particles and impurities, giving a perfectly clear alkaline liquid."),
    ("7", "क्वाथन (Heating / Evaporation)",
     "Pour the clear filtrate into an iron vessel (लोह पात्र / Loha Patra). "
     "Heat over a mild, steady fire (मंद अग्नि / Manda Agni) while stirring continuously.",
     "Iron vessel is important — it adds iron content to the Kshara, enhancing its therapeutic properties."),
    ("8", "रंग परिवर्तन (Colour Change)",
     "As the water content reduces, the solution becomes Reddish (रक्तवर्ण) and Slimy (श्लेष्मल).",
     None),
    ("9", "श्वेत चूर्ण प्राप्ति (Final White Powder)",
     "Continue heating until all moisture evaporates. The result is a Clear White Powder (श्वेत चूर्ण). "
     "This is the final Mridu Kshara.",
     "Store in an airtight container away from moisture."),
]

for num, hindi, english, note in steps:
    story.append(step_box(S, num, hindi, english, note))
    if num != "9":
        story.append(Paragraph("↓", S['arrow']))
    story.append(Spacer(1, 0.15*cm))

story.append(Spacer(1, 0.2*cm))
story.append(HRFlowable(width="100%", thickness=1, color=GOLD, spaceAfter=8))
# Summary box
summary_data = [[
    Paragraph("✅  मृदु क्षार तैयार!\nMridu Kshara Ready", S['step_bold'])
]]
st = Table(summary_data, colWidths=[W - 4*cm])
st.setStyle(TableStyle([
    ('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#FFF9C4')),
    ('BOX',        (0,0), (-1,-1), 2, GOLD),
    ('ALIGN',      (0,0), (-1,-1), 'CENTER'),
    ('TOPPADDING', (0,0), (-1,-1), 10),
    ('BOTTOMPADDING',(0,0), (-1,-1), 10),
]))
story.append(st)

story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════
#  PAGE 3 – Upgrading to Madhyama & Teekshna + Panaya
# ═══════════════════════════════════════════════════════════════════
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("मध्यम और तीक्ष्ण क्षार निर्माण", S['title']))
story.append(Paragraph("(Upgrading Kshara Potency)", S['subtitle']))
story.append(HRFlowable(width="100%", thickness=2, color=SAFFRON, spaceAfter=10))

story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/14-15 — मध्यम क्षार",
    ["मृदुं क्षारं ततः पक्त्वा लोहपात्रे सुसंस्थितम् ।",
     "मध्यमं क्षारद्रव्यं च अष्टपलं तत्र दापयेत् ॥",
     "पचेद् अग्नौ तथा यावत् लेहवत् सम्प्रजायते ।",
     "न अतिद्रवं न अतिघनं मध्यमः क्षारः उच्यते ॥"],
    "Mridum ksharam tatah paktva lohapaatre susansthitam | madhyamam ksharadravyam cha ashtapalam tatra daapayet ||",
    "Take the prepared Mridu Kshara in an iron vessel. Add 8 Pala of Madhyama Kshara Dravya. "
    "Boil over fire until a paste is formed — neither too solid nor too liquid. "
    "This is called Madhyama Kshara."
))
story.append(Spacer(1, 0.3*cm))

story.append(Paragraph("मध्यम क्षार निर्माण / Madhyama Kshara Preparation", S['section']))

upgrade_data = [
    [Paragraph("चरण / Step", S['table_h']),
     Paragraph("विधि / Process", S['table_h'])],
    [Paragraph("1", S['table_ce']),
     Paragraph("Heat Mridu Kshara (मृदु क्षार) in iron vessel until RED HOT (रक्ततप्त)", S['table_ce'])],
    [Paragraph("2", S['table_ce']),
     Paragraph("Add Madhyama Kshara Dravya — 8 Pala (मध्यम क्षार द्रव्य — 8 पल)\n"
               "Ingredients: Bhasma Sharkara, Shuddha Sharkara, Shukti, Shankhanabhi", S['table_ce'])],
    [Paragraph("3", S['table_ce']),
     Paragraph("Boil over fire until paste forms — neither too solid nor too liquid (न अतिद्रव, न अतिघन)", S['table_ce'])],
    [Paragraph("✅", S['table_ce']),
     Paragraph("मध्यम क्षार तैयार! (Madhyama Kshara Ready)", S['table_ce'])],
]
upgt = Table(upgrade_data, colWidths=[2*cm, 13.5*cm], repeatRows=1)
upgt.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,0), DARK_GREEN),
    ('BACKGROUND',   (0,4), (-1,4), colors.HexColor('#C8E6C9')),
    ('BOX',          (0,0), (-1,-1), 1, DARK_GREEN),
    ('INNERGRID',    (0,0), (-1,-1), 0.5, colors.HexColor('#AAAAAA')),
    ('VALIGN',       (0,0), (-1,-1), 'MIDDLE'),
    ('TOPPADDING',   (0,0), (-1,-1), 6),
    ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ('LEFTPADDING',  (0,0), (-1,-1), 8),
    ('RIGHTPADDING', (0,0), (-1,-1), 8),
]))
story.append(upgt)
story.append(Spacer(1, 0.4*cm))

story.append(Paragraph("तीक्ष्ण क्षार निर्माण / Teekshna Kshara Preparation", S['section']))
story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/16 — तीक्ष्ण क्षार",
    ["मृदुं क्षारं पुनः गृह्य तीक्ष्णक्षारद्रव्याणि च ।",
     "विंशतिपलमेकैकं दत्त्वा पच्यात् यथोदितम् ॥",
     "तीक्ष्णः क्षारः स विज्ञेयः सर्वकर्मसु योजयेत् ।"],
    "Mridum ksharam punah grihya teekshnaksharadravyani cha | vimshatipalamekaekam dattva pachyat yathoditam ||",
    "Again take Mridu Kshara. Add Teekshna Kshara Dravyas — 20 gm each. "
    "Boil as described previously. This is Teekshna Kshara, used for strong surgical and cauterization procedures."
))
story.append(Spacer(1, 0.3*cm))

teek_data = [
    [Paragraph("चरण / Step", S['table_h']),
     Paragraph("विधि / Process", S['table_h'])],
    [Paragraph("1", S['table_ce']),
     Paragraph("Heat Mridu Kshara (मृदु क्षार) until RED HOT", S['table_ce'])],
    [Paragraph("2", S['table_ce']),
     Paragraph("Add Teekshna Kshara Dravya — 20 gm each (तीक्ष्ण क्षार द्रव्य — 20 gm)\n"
               "Ingredients: Danti, Dravanti, Langali, Hingu, Sarjikshara, etc.", S['table_ce'])],
    [Paragraph("3", S['table_ce']),
     Paragraph("Boil until paste forms — neither too solid nor too liquid", S['table_ce'])],
    [Paragraph("✅", S['table_ce']),
     Paragraph("तीक्ष्ण क्षार तैयार! (Teekshna Kshara Ready) — used for Ksharasutra & cauterization", S['table_ce'])],
]
tt = Table(teek_data, colWidths=[2*cm, 13.5*cm], repeatRows=1)
tt.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,0), colors.HexColor('#6A1B9A')),
    ('BACKGROUND',   (0,4), (-1,4), SLOKA_BG),
    ('BOX',          (0,0), (-1,-1), 1, SLOKA_BORDER),
    ('INNERGRID',    (0,0), (-1,-1), 0.5, colors.HexColor('#AAAAAA')),
    ('VALIGN',       (0,0), (-1,-1), 'MIDDLE'),
    ('TOPPADDING',   (0,0), (-1,-1), 6),
    ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ('LEFTPADDING',  (0,0), (-1,-1), 8),
    ('RIGHTPADDING', (0,0), (-1,-1), 8),
]))
story.append(tt)

story.append(PageBreak())

# ═══════════════════════════════════════════════════════════════════
#  PAGE 4 – Panaya Kshara + Properties + Uses
# ═══════════════════════════════════════════════════════════════════
story.append(Spacer(1, 0.3*cm))
story.append(Paragraph("पानाय क्षार निर्माण विधि", S['title']))
story.append(Paragraph("Panaya Kshara — Internal (Oral) Use", S['subtitle']))
story.append(HRFlowable(width="100%", thickness=2, color=SAFFRON, spaceAfter=10))

story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/17 — पानाय क्षार श्लोक",
    ["तिलेक्षुरकपलाशानां सर्षपस्य यवस्य च ।",
     "मूलकस्य च भस्मानि पानाय क्षारमाचरेत् ॥",
     "गोमूत्रेण चतुर्भागं मिश्रयित्वा विनिस्त्रवेत् ।",
     "सैन्धवादिसमायुक्तं पाचयेल्लोहभाजने ॥"],
    "Tilekshurakapalashanam sarshapasya yavasya cha | mulakasya cha bhasmani panaya ksharamaacharet ||",
    "For Panaya Kshara (internal use): Take ash (Bhasma) of Tila, Ikshu, Palasha, Sarshapa, Yava, and Mulaka. "
    "Mix with 4 parts of Gomootra (cow urine). Filter well. Add Saindhava Lavana and other ingredients. "
    "Cook in an iron vessel over mild fire until Leha (linctus) consistency is achieved."
))
story.append(Spacer(1, 0.3*cm))

story.append(Paragraph("पानाय क्षार — सामग्री / Panaya Kshara — Ingredients", S['section']))
panaya_ing = [
    [Paragraph("सामग्री / Ingredient", S['table_h']),
     Paragraph("विवरण / Details", S['table_h'])],
    [Paragraph("भस्म (Bhasma) of:", S['table_ce']),
     Paragraph("तिल (Tila / Sesame), इक्षुरक (Ikshu), पलाश (Palasha), सर्षप (Sarshapa / Mustard), "
               "यव (Yava / Barley), मूलक (Mulaka / Radish)", S['table_ce'])],
    [Paragraph("द्रव / Liquid:", S['table_ce']),
     Paragraph("4 भाग गोमूत्र (Gomootra) / अजामूत्र (Ajamootra) / आवमूत्र (Avamootra)", S['table_ce'])],
    [Paragraph("लवण / Salts:", S['table_ce']),
     Paragraph("सैंधव लवण (Saindhava Lavana), सौवर्चल लवण (Sauvarchala Lavana)", S['table_ce'])],
    [Paragraph("अन्य / Others:", S['table_ce']),
     Paragraph("कुष्ठ (Kushtha), यष्टिमधु (Yashtimadhu), अजमोद (Ajamoda) — 1 Pala each", S['table_ce'])],
]
pt = Table(panaya_ing, colWidths=[4*cm, 11.5*cm], repeatRows=1)
pt.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,0), TABLE_HEADER),
    ('BOX',          (0,0), (-1,-1), 1, TABLE_HEADER),
    ('INNERGRID',    (0,0), (-1,-1), 0.5, colors.HexColor('#AAAAAA')),
    ('VALIGN',       (0,0), (-1,-1), 'MIDDLE'),
    ('TOPPADDING',   (0,0), (-1,-1), 6),
    ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ('LEFTPADDING',  (0,0), (-1,-1), 8),
    ('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_ORANGE, WHITE]),
]))
story.append(pt)
story.append(Spacer(1, 0.4*cm))

story.append(Paragraph("पानाय क्षार — विधि / Panaya Kshara — Method", S['section']))
panaya_steps = [
    "Collect ash (Bhasma) of the 6 plants listed above.",
    "Mix ash with 4 parts of Gomootra / Ajamootra / Avamootra.",
    "Mix well and filter through a clean cloth.",
    "Add Saindhava Lavana, Sauvarchala Lavana, Kushtha, Yashtimadhu, Ajamoda (1 Pala each).",
    "Heat in an iron vessel over mild fire (Manda Agni).",
    "Heat continuously till Leha (लेह) consistency is attained — thick paste-like.",
    "✅  पानाय क्षार तैयार! / Panaya Kshara Ready!",
]
for i, st_text in enumerate(panaya_steps):
    bg = colors.HexColor('#FFF3E0') if i % 2 == 0 else WHITE
    td = Table([[Paragraph(f"{i+1 if i < 6 else '✅'}  {st_text}", S['body'])]], 
               colWidths=[W - 4*cm])
    td.setStyle(TableStyle([
        ('BACKGROUND',   (0,0), (-1,-1), bg),
        ('BOX',          (0,0), (-1,-1), 0.5, SAFFRON),
        ('LEFTPADDING',  (0,0), (-1,-1), 10),
        ('TOPPADDING',   (0,0), (-1,-1), 5),
        ('BOTTOMPADDING',(0,0), (-1,-1), 5),
    ]))
    story.append(td)
    if i < 5:
        story.append(Paragraph("↓", S['arrow']))

story.append(Spacer(1, 0.4*cm))
story.append(HRFlowable(width="100%", thickness=2, color=DARK_GREEN, spaceAfter=8))

# ── Properties + Uses ─────────────────────────────────────────────
story.append(Paragraph("क्षार के गुण एवं उपयोग / Properties & Uses of Kshara", S['section']))
story.append(sloka_box(S,
    "Sushruta Samhita, Sutrasthana 11/3 — गुण श्लोक",
    ["दहत्यामं च पाचयति विशोधयति च मेदसः ।",
     "क्षारो दारणशोधनश्छेदनो लेखनः स्मृतः ॥"],
    "Dahati aamam cha pachayati vishodhayati cha medasah |",
    "Kshara burns (Dahana), digests Ama (undigested toxins), cleanses (Shodhana), excises (Chedana), "
    "and scrapes (Lekhana). It is used for conditions like Arsha (piles), Bhagandara (fistula-in-ano), "
    "Nadi Vrana (sinus), skin diseases, and tumors."
))
story.append(Spacer(1, 0.3*cm))

# Properties table
prop_data = [
    [Paragraph("क्रिया / Action", S['table_h']),
     Paragraph("संस्कृत / Sanskrit", S['table_h']),
     Paragraph("अर्थ / Meaning", S['table_h'])],
    [Paragraph("Dahana", S['table_ce']), Paragraph("दहन", S['table_c']),
     Paragraph("Burns/cauterizes diseased tissue", S['table_ce'])],
    [Paragraph("Pachana", S['table_ce']), Paragraph("पाचन", S['table_c']),
     Paragraph("Digests Ama (toxic matter)", S['table_ce'])],
    [Paragraph("Shodhana", S['table_ce']), Paragraph("शोधन", S['table_c']),
     Paragraph("Cleanses the wound/ulcer", S['table_ce'])],
    [Paragraph("Chedana", S['table_ce']), Paragraph("छेदन", S['table_c']),
     Paragraph("Excises/cuts diseased tissue", S['table_ce'])],
    [Paragraph("Lekhana", S['table_ce']), Paragraph("लेखन", S['table_c']),
     Paragraph("Scrapes off excessive growth", S['table_ce'])],
]
propr = Table(prop_data, colWidths=[4*cm, 4*cm, 7.5*cm], repeatRows=1)
propr.setStyle(TableStyle([
    ('BACKGROUND',   (0,0), (-1,0), DARK_GREEN),
    ('BOX',          (0,0), (-1,-1), 1, DARK_GREEN),
    ('INNERGRID',    (0,0), (-1,-1), 0.5, colors.HexColor('#AAAAAA')),
    ('VALIGN',       (0,0), (-1,-1), 'MIDDLE'),
    ('TOPPADDING',   (0,0), (-1,-1), 6),
    ('BOTTOMPADDING',(0,0), (-1,-1), 6),
    ('LEFTPADDING',  (0,0), (-1,-1), 8),
    ('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_ORANGE, WHITE]),
]))
story.append(propr)
story.append(Spacer(1, 0.4*cm))

# ── Quick Revision Box ────────────────────────────────────────────
story.append(Paragraph("⚡ परीक्षा के लिए त्वरित पुनरावृत्ति / Quick Exam Revision", S['section']))
rev_items = [
    ("क्षार के प्रकार / Types of Kshara", "2 — Pratisaraniya (External) & Panaya (Internal)"),
    ("क्षार द्रव्य के 3 वर्ग / 3 Classes", "Mridu (Mild), Madhyama (Medium), Teekshna (Strong)"),
    ("निस्यंदन कितनी बार / Filtration times", "21 बार (21 Times) — MOST IMPORTANT EXAM POINT"),
    ("पात्र / Vessel used", "लोह पात्र / Iron Vessel (Loha Patra)"),
    ("अग्नि / Fire type", "मंद अग्नि / Mild Fire (Manda Agni)"),
    ("तिल काष्ठ का प्रयोग / Tila twigs", "Burning fuel — gives correct type of combustion"),
    ("गोमूत्र / Gomootra", "6 parts for Pratisaraniya; 4 parts for Panaya"),
    ("सर्वश्रेष्ठ क्षार / Best Kshara", "अपामार्ग क्षार (Apamarga Kshara)"),
]
for item, val in rev_items:
    rd = Table([[
        Paragraph(f"• {item}", S['body_bold']),
        Paragraph(val, S['body']),
    ]], colWidths=[7*cm, 8.5*cm])
    rd.setStyle(TableStyle([
        ('BACKGROUND',   (0,0), (0,0), colors.HexColor('#E3F2FD')),
        ('BACKGROUND',   (1,0), (1,0), WHITE),
        ('BOX',          (0,0), (-1,-1), 0.5, colors.HexColor('#1565C0')),
        ('INNERGRID',    (0,0), (-1,-1), 0.5, colors.HexColor('#BBDEFB')),
        ('VALIGN',       (0,0), (-1,-1), 'MIDDLE'),
        ('TOPPADDING',   (0,0), (-1,-1), 5),
        ('BOTTOMPADDING',(0,0), (-1,-1), 5),
        ('LEFTPADDING',  (0,0), (-1,-1), 8),
    ]))
    story.append(rd)

story.append(Spacer(1, 0.5*cm))
story.append(HRFlowable(width="100%", thickness=1, color=SAFFRON, spaceAfter=6))
story.append(Paragraph(
    "Reference: Sushruta Samhita, Sutrasthana, Chapter 11 (Kshara Karma Vidhi Adhyaya)  |  "
    "For educational purposes only.",
    S['footer']
))

# ── Build PDF ─────────────────────────────────────────────────────
doc.build(story, onFirstPage=on_page, onLaterPages=on_page)
print(f"PDF created: {OUT}")
Running Command

python3 /home/daytona/workspace/kshara-pdf/make_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/kshara-pdf/Kshara_Nirmana_Vidhi.pdf

Your PDF is ready! 🎉

Kshara Nirmana Vidhi

PDF Document · PDF


PDF में क्या-क्या है (What's inside):

4 Pages, beautifully formatted with saffron & green theme:
PageContent
Page 1Title + परिभाषा (Definition) + Classification Table of all 3 types of Kshara Dravya
Page 2प्रतिसारणीय क्षार — 9 steps with arrows + opening sloka from Sushruta
Page 3मध्यम क्षार & तीक्ष्ण क्षार preparation with full slokas
Page 4पानाय क्षार method + Properties table + ⚡ Quick Exam Revision box
श्लोक included (Slokas):
  1. Sushruta Su. 11/3 — Definition of Kshara (क्षरणात् क्षार...)
  2. Sushruta Su. 11/4 — Two types: Pratisaraniya & Panaya
  3. Sushruta Su. 11/8 — Mridu Kshara Dravya list
  4. Sushruta Su. 11/9-10 — Burning & filtration method
  5. Sushruta Su. 11/14-15 — Madhyama Kshara preparation
  6. Sushruta Su. 11/16 — Teekshna Kshara preparation
  7. Sushruta Su. 11/17 — Panaya Kshara preparation
  8. Sushruta Su. 11/3 — Properties: Dahana, Chedana, Lekhana
Each sloka has Sanskrit text + transliteration + English meaning — easy to read and memorize!
This is a shared conversation. Sign in to Orris to start your own chat.