SuttaCentral

A better title structure for vagga-suttas

We have updated and revised our HTML and data structures, however one infelicity remains. In the so-called vagga-suttas—where one file includes a range of texts—the heading structure doesn’t properly reflect the text.

I’m hoping to fix this over the next couple of days. Hopefully this won’t affect anyone, but just letting you know what I’m up to.

We can take an1.1-10 as an example. Here is the HTML for the first three suttas.

  "an1.1:0.1": "<section class='range' id='an1.1-10'><header><ul><li class='division'>{}</li>",
  "an1.1:0.2": "<li>{}</li></ul>",
  "an1.1:0.3": "<h1 class='range-title'>{}</h1></header>",
  "an1.1:1.1": "<article id='an1.1'><p><span class='evam'>{}</span>",
  "an1.1:1.2": "{}",
  "an1.1:1.3": "{}",
  "an1.1:1.4": "{}</p>",
  "an1.1:1.5": "<p>{}",
  "an1.1:1.6": "{}</p>",
  "an1.1:2.1": "<p>{}",
  "an1.1:2.2": "{}</p>",
  "an1.1:2.3": "<p class='endsection'>{}</p></article>",
  "an1.2:1.0": "<article id='an1.2'><h2 class='sutta-title'>{}</h2>",
  "an1.2:1.1": "<p>{}",
  "an1.2:1.2": "{}</p>",
  "an1.2:1.3": "<p class='endsection'>{}</p></article>",
  "an1.3:1.0": "<article id='an1.3'><h2 class='sutta-title'>{}</h2>",
  "an1.3:1.1": "<p>{}",
  "an1.3:1.2": "{}</p>",
  "an1.3:1.3": "<p class='endsection'>{}</p></article>",

The overall structure is good. The file is a “vagga”, which is a collection of smaller things that is itself a section of a larger thing; for this reason, we use <section>. The <article> tag is for a specific sutta. The <section> has an ID for the range, while each <article> has an ID for that sutta. (In some cases the suttas themselves are ranges; these are the “undebaked” suttas.)

However the heading structure doesn’t properly reflect this. There is an overall <h1> heading. Since this lies outside any article, but inside the section, it should be the heading for the range. But currently it is the heading for the first sutta.

Subsequently, the suttas have an <h2> inside the <article>, which is the heading for each sutta. Thus the pattern is inconsistent. Abstractly it is as follows:

<section>
    <h1 class='range-title'>1</h1>
         <article>
…
        <article>
            <h2 class='sutta-title'>2</h2>
…
       <article>
            <h2 class='sutta-title'>3</h2>
…

It should be as follows:

<section>
    <h1 class='range-title'>1–10</h1>
        <article>
           <h2 class='sutta-title'>1</h2>
…
        <article>
           <h2 class='sutta-title'>2</h2>
…
        <article>
           <h2 class='sutta-title'>3</h2>
…

This requires adding an extra segment at the start of the vagga-sutta.

I propose that <h2 class='sutta-title'> always takes the segment number of x:1.0 rather than x:0.1. I have made this change for the existing h2s in this and this commit. You can see this pattern above. The reason for this is that, without doing this, the first <h2> would be segment number x:0.4, thus coinnecting it with range heading rather than the sutta to which it belongs. It just makes things neater if it is x:1.0 to start the next series of segments.

The beginning of an1.1-10 would thus become:

  "an1.1:0.1": "<section class='range' id='an1.1-10'><header><ul><li class='division'>{}</li>",
  "an1.1:0.2": "<li>{}</li></ul>",
  "an1.1:0.3": "<h1 class='range-title'>{}</h1></header>",
  "an1.1:1.0": "<article id='an1.1'><h2 class='sutta-tile'>{}</h2>",
  "an1.1:1.1": "<p><span class='evam'>{}</span>",
…

@Aminah @Robbie @sabbamitta @karl_lew

4 Likes

Thanks for the info. As far as I can tell this is all in agreement with the current legacy standard so all’s good on that front.

https://github.com/suttacentral/suttacentral/wiki/HTML-structure:-template-&-guiding-principles#for-a-debaked-range-sutta

3 Likes

And just so youse know, this is now done:

In addition, I took the opportunity to debake an1.378-393:

As always, if anyone notices any problems please let me know.

2 Likes