Skip to content

HTML format for matter

sujato edited this page Nov 10, 2022 · 1 revision

Publications consume frontmatter and endmatter. These are HTML pages that contain things such as introduction, epigraphs, and so on. Matter must be supplied in an exact and correct HTML form. The root file will be transformed and applied in:

  • web
  • static HTML
  • EPUB
  • LaTeX (for PDF and print)

the basic format is:

  • file name must be the same as the class name of the matter.
  • matter is an <article class='foo'>.
  • top level heading must be h1
  • heading levels must follow proper hierarchy, i.e. h3 must not follow h1
  • use classless HTML where possible.
  • basic HTML block and inline elements are supported.
  • arbitrary classes are not supported, a few classes are supplied (gatha, byline).

Don't use hacks, don't try anything fancy. Tables are currently not supported. Check an existing file of the same type you are creating and make it exactly like that. Use paragraphs, headings, blockquotes, and lists and you'll be apples.

A file `forward.html might look like this.

<article class='foreword'>
<h1>The SuttaCentral Editions Series</h1>
<p>SuttaCentral is a charitable organization. Our work is accomplished by volunteers and through the generosity of our donors. Everything we create is offered to all of humanity free of any copyright or licensing restrictions. </p>
</article>

There are a few special considerations.

ToC

A large matter may include a ToC of the following format. This includes only h2.

<nav class='contents'>
<ul>
<li><a href="#general-remarks">General Remarks</a></li>
<li><a href="#the-serpent-chapter">The Serpent Chapter</a></li>
</ul>
</nav>

Pali etc.

Pali terms are marked up as follows:

<i translate='no' lang='pli'>paritta</i>

Other languages use the appropriate lang attribute.

Notes

Matter supports notes, which must be of exactly the following form. We currently supply no automated assistance, they must be created by hand.

Note anchor:

<a epub:type='noteref' href='#introduction-note-2' id='introduction-noteref-2' role='doc-noteref'>2</a>
  • href and id must begin with the class name of the matter, eg. introduction.
  • numbers increment.

Note content:

<section epub:type='endnotes' id='introduction-endnotes' role='doc-endnotes'>
<h1>Endnotes</h1>
<ol>
<li epub:type='endnote' id='introduction-note-1'>
<p>Warder, <cite>Pali Metre</cite>, pp. 12–13. <a epub:type='backlink' href='#introduction-noteref-1' role='doc-backlink'>↩</a></p>
</li>
…
</ol>
</section>

Links

Links are recommended for texts found on SuttaCentral, not for texts outside SuttaCentral (because we cannot control them.) There are two kinds.

To link to a specific translation or portion of text:

<a href='https://suttacentral.net/snp3.11/en/sujato'>Snp 3.11</a>

To link to a text generically; this will go to the suttaplex. It is usually used for texts for which SC has no segmented translation.

<a href='https://suttacentral.net/mnd9'>Mnd 9:32.8</a>

<br> tags

Line breaks are used for lines of verse. Because of a limitation in our LaTeX conversion, <br> tags must not be followed by a new line (this will add an extra blank line).

Wrong:

<blockquote class='gatha'>
<p>When questioned in many ways, <br>
they wouldn’t keep justifying themselves.</p>
</blockquote>

Right:

<blockquote class='gatha'>
<p>When questioned in many ways, <br>they wouldn’t keep justifying themselves.</p>
</blockquote>