Template:Commentary: Difference between revisions

No edit summary
No edit summary
Line 3: Line 3:
   ═══════════════════════════════════════════════════════════════════
   ═══════════════════════════════════════════════════════════════════
   Renders a commentary block attached to a verse.
   Renders a commentary block attached to a verse.
   Parameters:
   Parameters:
     verse_id  — ID of the parent verse (e.g. BS_C01_S01_V01)
     verse_id  — ID of the parent verse (e.g. BS_C01_S01_V01)
Line 13: Line 12:
                 (falls back to name if omitted)
                 (falls back to name if omitted)
     text      — The commentary prose content
     text      — The commentary prose content
  Rendering:
    Bhashyam / primary bhashya → .commentary-body.gr-bhashyam
      Plain flowing text, same font/size as body, no border, no title
    Teeka / sub-commentary    → .commentary-body.gr-teeka
      Mild grey background, bold name as title, then prose below
      Same font/size as body text — no size change
      No expand/collapse — always visible
  The CSS classes gr-bhashyam and gr-teeka are defined in
  MediaWiki:Common.css and driven by the ReaderToolbar extension's
  applyCommentaryTypes() function which reads data-commentary-name.
   ═══════════════════════════════════════════════════════════════════
   ═══════════════════════════════════════════════════════════════════
--><includeonly><div
--><includeonly><div
Line 31: Line 17:
   data-verse="{{{verse_id|}}}"
   data-verse="{{{verse_id|}}}"
   data-commentary-id="{{{id|}}}"
   data-commentary-id="{{{id|}}}"
   data-commentary-name="{{lc:{{{name|}}}}}">{{#if:{{{name|}}}|{{#ifeq:{{lc:{{{name|}}}}}|bhashyam||{{#ifeq:{{lc:{{{name|}}}}}|bhashya||<div class="gr-teeka-title">{{#if:{{{label|}}}|{{{label}}}|{{{name}}}}}</div>}}}}}}}}{{{text|}}}</div></includeonly><noinclude>
   data-commentary-name="{{lc:{{{name|}}}}}">{{#if:{{{name|}}}|{{#ifeq:{{lc:{{{name|}}}}}|bhashyam||{{#ifeq:{{lc:{{{name|}}}}}|bhashya||<div class="gr-teeka-title">{{#if:{{{label|}}}|{{{label}}}|{{{name}}}}}</div>}}}}}}}}
{{{text|}}}</div></includeonly><noinclude>
== Template:Commentary ==
== Template:Commentary ==
Renders a commentary block (bhāṣya or ṭīkā) attached to a verse.
Renders a commentary block (bhāṣya or ṭīkā) attached to a verse.
=== Parameters ===
=== Parameters ===
{| class="wikitable"
{| class="wikitable"
Line 51: Line 36:
| <code>text</code> || Yes || The commentary text content
| <code>text</code> || Yes || The commentary text content
|}
|}
=== Rendering behaviour ===
=== Rendering behaviour ===
* '''Bhashyam''' (name= empty, "bhashyam", or "bhashya") — renders as plain flowing prose, same size and font as the rest of the document. No background, no title, no border.
* '''Bhashyam''' (name= empty, "bhashyam", or "bhashya") — renders as plain flowing prose, same size and font as the rest of the document. No background, no title, no border.
* '''Teeka / sub-commentary''' (any other name=) — renders with a mild grey background, the name/label in bold as a title, then the prose below. Same font and size as body text. Always visible — no expand/collapse.
* '''Teeka / sub-commentary''' (any other name=) — renders with a mild grey background, the name/label in bold as a title, then the prose below. Same font and size as body text. Always visible — no expand/collapse.
=== Example: Bhashyam (running text) ===
=== Example: Bhashyam (running text) ===
<pre>
<pre>
Line 65: Line 48:
}}
}}
</pre>
</pre>
=== Example: Teeka (bubble) ===
=== Example: Teeka (bubble) ===
<pre>
<pre>
Line 76: Line 58:
}}
}}
</pre>
</pre>
[[Category:Templates]]
[[Category:Templates]]
</noinclude>
</noinclude>