Jump to content

Template:Adhyaya: Difference between revisions

From Grantha
No edit summary
No edit summary
Line 3: Line 3:
| chapter_id  = String
| chapter_id  = String
| chapter_num  = String
| chapter_num  = String
| section_num  = String
| title        = String
| title        = String
}}</noinclude>{{#cargo_store: _table=Adhyaya
}}</noinclude>{{#cargo_store: _table=Adhyaya
Line 8: Line 9:
| chapter_id  = {{{document_id}}}_C{{{chapter_num|}}}
| chapter_id  = {{{document_id}}}_C{{{chapter_num|}}}
| chapter_num  = {{{chapter_num|}}}
| chapter_num  = {{{chapter_num|}}}
| section_num  = {{{section_num|}}}
| title        = {{{title|}}}
| title        = {{{title|}}}
}}<includeonly><div class="adhyaya-block" id="{{{document_id|}}}_C{{{chapter_num|}}}"><h2><span class="mw-headline" id="{{{document_id|}}}_C{{{chapter_num|}}}">{{{title|}}}</span></h2></div></includeonly><noinclude>
}}<includeonly><div class="adhyaya-block" id="{{{document_id|}}}_C{{{chapter_num|}}}{{#if:{{{section_num|}}}|_S{{{section_num|}}}}}"><h1 class="adhyaya-heading"><span class="mw-headline" id="{{{document_id|}}}_C{{{chapter_num|}}}{{#if:{{{section_num|}}}|_S{{{section_num|}}}}}}">{{{title|}}}</span></h1></div></includeonly><noinclude>
== Template:Adhyaya ==
== Template:Adhyaya ==
Stores chapter metadata in Cargo and renders the adhyaya heading.
Renders the chapter/section heading as h1.adhyaya-heading (black, large)
matching the reference site structure where chapter titles are prominent h1
headings. Adhikarana (sub-section) headings use === wiki markup (h2/h3, orange).


The h2 with mw-headline span is picked up by MediaWiki's TOC generator
The mw-headline span registers this heading with MW's TOC generator.
automatically — the built-in TOC lists all adhyayas without needing
The id= matches the XML chapter id for [[#BGB_C01|anchor]] links.
== wiki headings == in the page source.
 
The id= on both the outer div and the inner span uses the document's
chapter id (e.g. BGB_C01) so anchor links like #BGB_C01 work directly.


=== Parameters ===
=== Parameters ===
Line 25: Line 25:
! Parameter !! Description
! Parameter !! Description
|-
|-
| document_id || Document ID (e.g. BGB, BS, NNS)
| document_id || Document ID (e.g. BGB, BS)
|-
|-
| chapter_num || Chapter number (1, 2, 3...)
| chapter_num || Chapter number (1, 2, 3...)
|-
|-
| title || Chapter/section title in Sanskrit
| section_num || Section/pada number (optional, for BS padas)
|-
| title || Chapter title in Sanskrit
|}
|}
[[Category:Templates]]
[[Category:Templates]]
[[Category:Cargo store templates]]
[[Category:Cargo store templates]]
</noinclude>
</noinclude>

Revision as of 07:33, 13 April 2026

This template defines the table "Adhyaya". View table. A replacement table has been generated for this table; View replacement table.

Template:Adhyaya

Renders the chapter/section heading as h1.adhyaya-heading (black, large) matching the reference site structure where chapter titles are prominent h1 headings. Adhikarana (sub-section) headings use === wiki markup (h2/h3, orange).

The mw-headline span registers this heading with MW's TOC generator. The id= matches the XML chapter id for anchor links.

Parameters

Parameter Description
document_id Document ID (e.g. BGB, BS)
chapter_num Chapter number (1, 2, 3...)
section_num Section/pada number (optional, for BS padas)
title Chapter title in Sanskrit