Jump to content

Template:Adhyaya: Difference between revisions

From Grantha
Created page with "<!-- Template:Adhyaya/doc --> == Usage == Renders a chapter heading with optional collapsible introduction. Auto-generates a stable anchor ID (<code>{document_id}_C{chapter_num}</code>) for cross-referencing. === Example === <pre> {{Adhyaya | document_id = NNS | chapter_num = 01 | title = प्रथमोऽध्यायः | title_trans = Prathamō'dhyāyaḥ | intro = This chapter discusses the luminosity of the Lord's nails. }} </pre> === Linkin..."
 
No edit summary
 
(19 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<!-- Template:Adhyaya/doc -->
<noinclude>{{#cargo_declare: _table=Adhyaya
== Usage ==
Renders a chapter heading with optional collapsible introduction.
Auto-generates a stable anchor ID (<code>{document_id}_C{chapter_num}</code>) for cross-referencing.
 
=== Example ===
<pre>
{{Adhyaya
| document_id  = NNS
| chapter_num  = 01
| title        = प्रथमोऽध्यायः
| title_trans  = Prathamō'dhyāyaḥ
| intro        = This chapter discusses the luminosity of the Lord's nails.
}}
</pre>
 
=== Linking to a chapter ===
Use <code>[[PageName#{document_id}_C{chapter_num}]]</code> anywhere on the wiki.
 
Example: <code>[[Nakha#NNS_C01]]</code>
 
=== Parameters ===
{| class="wikitable"
! Parameter !! Required !! Description
|-
| <code>document_id</code> || Yes || Short document code, e.g. <code>NNS</code>
|-
| <code>chapter_num</code> || Yes || Zero-padded chapter number, e.g. <code>01</code>
|-
| <code>title</code> || Yes || Chapter title in Sanskrit / Kannada
|-
| <code>title_trans</code> || No || IAST transliteration of the title
|-
| <code>intro</code> || No || Introductory prose (shown collapsible)
|}
 
=== Auto-ID format ===
<code>{document_id}_C{chapter_num}</code> → e.g. <code>NNS_C01</code>
 
=== Cargo table ===
Stores to table <code>Adhyaya</code>. To initialise the table, run:
<code>Special:CargoTables</code> → Recreate table for <code>Adhyaya</code>.
 
== Cargo table declaration ==
<!-- Place this ONCE on Template:Adhyaya itself, inside a noinclude block -->
<noinclude>
{{#cargo_declare: _table=Adhyaya
| document_id  = String
| document_id  = String
| chapter_id  = String
| chapter_id  = String
| chapter_num  = String
| chapter_num  = String
| section_num  = String
| title        = String
| title        = String
| title_trans = String
}}</noinclude>{{#cargo_store: _table=Adhyaya
| has_intro    = Boolean
| document_id = {{{document_id|}}}
}}
| chapter_id  = {{{document_id}}}_C{{{chapter_num|}}}
| chapter_num  = {{{chapter_num|}}}
| section_num  = {{{section_num|}}}
| title        = {{{title|}}}
}}<noinclude>
== Template:Adhyaya ==
Stores chapter metadata in Cargo only. The visible heading comes from
== wiki markup == in the page wikitext, which MW's TOC picks up natively.
[[Category:Templates]]
[[Category:Cargo store templates]]
</noinclude>
</noinclude>
<includeonly>[[Category:Chapter templates]]</includeonly>

Latest revision as of 11:23, 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

Stores chapter metadata in Cargo only. The visible heading comes from == wiki markup == in the page wikitext, which MW's TOC picks up natively.