Sutta Pitaka Diagram/Chart

Actually it’s working well now, it must have been my connection yesterday. I’m on a different computer than when I reported the FF problem some weeks ago. Anyway for now it’s great.

1 Like

Dear Bhante, I also changed a small line in my CSS to fit the other full screen exemple that I just found. I’m not using viewport height anymore in the code and this could have solve the problem :wink:

Thank for all the feedback

2 Likes

Dear All,

I am making a horizontal version of that chart for a wall in the library :wink: I was checking if everything was OK before sending to the printer (A0 Size), and I noticed that some of the sutta range in the chapter or vagga at the edge of the chart sometime uses an en dash and sometime an hyphen. You can see it on this chart on Dhammapada (hyphen) vs Itivuttaka…

Most of the ranges come from that file https://github.com/suttacentral/sc-data/blob/master/structure/child_range.json

But I extracted the range for the Dhammapada chapters from their name in this file https://github.com/suttacentral/sc-data/blob/master/sc_bilara_data/translation/en/sujato/name/sutta/dhp-name_translation-en-sujato.json

I wonder if the name in this last file should use an en dash instead of an hyphen?

2 Likes

Bhante @sujato is the Grand Hyphen Master. So he is the one to say for sure.

There is documentation somewhere, but the basic idea is that for computer readable things it is a hyphen and for human readable things it is an en dash. So if it will appear in the URL it is a hyphen. If it appears in the body of the site it’s an en dash.

We use hyphen for code and en-dash for presentation. So we transform those codes when preparing the data for the website, printing, etc. But it wouldn’t hurt to add the Dhp ranges to the child_range file, I’ll do it when I get the chance, or if you want to, make a PR.

1 Like

Good, I have used the little script here to output the ranges:

const fs = require('fs');

fs.readdir('/workspaces/sc-data/sc_bilara_data/root/pli/ms/sutta/kn/dhp', (err, files) => {
    files = files.sort(function(a, b) { // natural Sorter
        return a.localeCompare(b, undefined, {
          numeric: true,
          sensitivity: 'base'
        });
      });
    files.forEach(file => {
        let range = file.split("_")[0].slice(3).replace("-","–");
        fs.readFile('/workspaces/sc-data/sc_bilara_data/root/pli/ms/sutta/kn/dhp/' + file, 'utf8', (err, data) => {
            let str = data.split(/\n/)[3];
            let name = str.split('"')[3].normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
            console.log('"dhp-'+name.slice(0, -1)+'": "'+'Dhp '+range+'",');
        });
    })
})

This gave me:

"dhp-yamakavagga": "Dhp 1–20",
"dhp-appamadavagga": "Dhp 21–32",
"dhp-cittavagga": "Dhp 33–43",
"dhp-pupphavagga": "Dhp 44–59",
"dhp-balavagga": "Dhp 60–75",
"dhp-panditavagga": "Dhp 76–89",
"dhp-arahantavagga": "Dhp 90–99",
"dhp-sahassavagga": "Dhp 100–115",
"dhp-papavagga": "Dhp 116–128",
"dhp-dandavagga": "Dhp 129–145",
"dhp-jaravagga": "Dhp 146–156",
"dhp-attavagga": "Dhp 157–166",
"dhp-lokavagga": "Dhp 167–178",
"dhp-buddhavagga": "Dhp 179–196",
"dhp-sukhavagga": "Dhp 197–208",
"dhp-piyavagga": "Dhp 209–220",
"dhp-kodhavagga": "Dhp 221–234",
"dhp-malavagga": "Dhp 235–255",
"dhp-dhammatthavagga": "Dhp 256–272",
"dhp-maggavagga": "Dhp 273–289",
"dhp-pakinnakavagga": "Dhp 290–305",
"dhp-nirayavagga": "Dhp 306–319",
"dhp-nagavagga": "Dhp 320–333",
"dhp-tanhavagga": "Dhp 334–359",
"dhp-bhikkhuvagga": "Dhp 360–382",
"dhp-brahmanavagga": "Dhp 383–423",

I made a pull request to add it add Dhp range by cittadhammo · Pull Request #224 · suttacentral/sc-data · GitHub

I don’t know if it is all right.

Thanks for your help.

1 Like

This is so useful, elegant, and just plain cool. Thank you for creating and sharing it with us!

2 Likes

Systematic & structured approach to The Four Noble Truths

https://www.reddit.com/r/Buddhism/comments/1bvp8ca/systematic_structured_approach_to_the_four_noble/

:anjal: