Jump to content

Template:Adhyaya: Difference between revisions

From Anandamakaranda
No edit summary
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>{{#cargo_declare: _table=Adhyaya
{{#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
}}
</noinclude>
<!--
  Template:Adhyaya
  ════════════════
  Renders a chapter heading with optional intro text.
  Auto-generates a stable HTML anchor ID for cross-referencing.
 
  Parameters:
    document_id  – e.g. NNS            (required)
    chapter_num  – e.g. 01              (required, zero-padded)
    title        – Sanskrit/display title (required)
    title_trans  – IAST transliteration  (optional)
    intro        – Introductory prose    (optional)
 
  Auto-ID format: {document_id}_C{chapter_num}
  Example:        NNS_C01
 
  Usage:
    {{Adhyaya
    | document_id  = NNS
    | chapter_num  = 01
    | title        = प्रथमोऽध्यायः
    | title_trans  = Prathamō'dhyāyaḥ
    | intro        = This chapter deals with...
    }}
-->
<div
  class="adhyaya-block"
  id="{{{document_id}}}_C{{{chapter_num}}}"
  style="margin:2em 0 1.5em;font-family:'Adishila',serif;">
 
  <!-- Chapter heading bar -->
  <div class="adhyaya-heading" style="
    border-bottom: 2px solid #8b6914;
    padding-bottom: 6px;
    margin-bottom: 0.6em;">
 
    <span class="adhyaya-num" style="
      display:inline-block;
      font-size:0.78em;
      font-weight:bold;
      color:#fff;
      background:#8b6914;
      padding:2px 9px;
      border-radius:3px;
      margin-right:10px;
      vertical-align:middle;
      letter-spacing:0.04em;">
      Chapter {{{chapter_num}}}
    </span>
 
    <span class="adhyaya-title" style="
      font-size:1.45em;
      font-weight:bold;
      color:#2a1f0a;
      vertical-align:middle;">
      {{{title}}}
    </span>
 
    {{#if:{{{title_trans|}}}|
    <span class="adhyaya-title-trans" style="
      display:block;
      font-size:0.88em;
      color:#7a6030;
      font-style:italic;
      margin-top:2px;
      margin-left:2px;">
      {{{title_trans}}}
    </span>
    }}
 
    <!-- Cross-reference permalink -->
    <span style="
  display:inline-block;
  margin-left:10px;
  font-size:0.72em;
  color:#c9a84c;
  text-decoration:none;
  vertical-align:middle;
  opacity:0.7;">[[#{{{document_id}}}_C{{{chapter_num}}}|¶ {{{document_id}}}_C{{{chapter_num}}}]]</span>  </div>
 
  <!-- Intro block (collapsible if present) -->
{{#if:{{{intro|}}}|
<div class="adhyaya-intro mw-collapsible mw-collapsed" style="
  width:100%;
  box-sizing:border-box;
  border:1px solid #d4b866;
  border-radius:0 4px 4px 0;
  margin-top:0.5em;
  font-family:'Adishila',serif;
  font-size:1em;
  line-height:1.9;
  color:#2a1f0a;">
  <div class="mw-collapsible-toggle" style="
    background:#f8f3e8;
    border-left:4px solid #8b6914;
    padding:10px 14px;
    font-size:0.78em;
    font-weight:bold;
    color:#8b6914;
    text-transform:uppercase;
    letter-spacing:0.07em;
    cursor:pointer;">
    ▶ Introduction
  </div>
  <div class="mw-collapsible-content" style="
    background:#f8f3e8;
    border-left:4px solid #8b6914;
    padding:10px 14px;
    direction:auto;
    unicode-bidi:plaintext;">
    {{{intro}}}
  </div>
</div>
}}
 
</div>
<!-- Cargo store for chapter index -->
{{#cargo_store: _table=Adhyaya
| document_id  = {{{document_id|}}}
| document_id  = {{{document_id|}}}
| 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|}}}
| title_trans  = {{{title_trans|}}}
}}<noinclude>
| has_intro    = {{#if:{{{intro|}}}|yes|no}}
== Template:Adhyaya ==
}}<!--store only-->
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>

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.