Source data for suttacentral abbreviations page

Would some please be able to show me where the source data for the abbreviations page is kept in suttacentral? Looked for half an hour but couldn’t find it. :frowning:

I believe this csv file:

1 Like

Thank you, that’s what I was looking for!

1 Like

Is the data in that directory up-to-date? For example, I notice that the csv files use “pi” for Pali, whereas the Vinaya segments seem to use “pli” instead…

1 Like

Those IDs don’t use these abbreviations. Those IDs are (I believe?) drawn from the folder names e.g. sc-data/sc_bilara_data/translation/en/brahmali/vinaya/pli-tv-kd at master · suttacentral/sc-data · GitHub

Sometimes they match (e.g. DN) but often they do not :confused:

Funny, I just asked Bhante about that a few hours ago! Haven’t heard back yet, but I will post when I do.

I don’t believe the csv @Khemarato.bhikkhu linked to is the (direct?) source for the abbreviations page linked by the OP. For example, on the front end page there is this…
image

Whereas in the csv it shows this:
image

1 Like

Ok, I may have found it! Not sure if it is the real source, but it has “Pts” for the item I showed above:

How did I find it? I already had the sc-data repository copied to my local device. Then I just used Sublime Text to search the whole directory for “List of Abbreviations”.

I actually always seem to forget that this can be done.

1 Like

Oh! Seems you may be right

:crazy_face:

Sorry if this is kind of a derail, but can you tell why that table is built manually? I would have thought the whole purpose of having the data in an object would be so you didn’t have to update two places when changing the data.

1 Like

I kind of assumed that it was, like most files in SuttaCentral, generated by a script at some point. :man_shrugging:

It’s very hard to tell in their code which files are actually source code and which are intermediate files generated by scripts :confused:

1 Like

Ah, so the live site is actually built and then the pages are uploaded to the real server? I have much more experience with WordPress where it’s all done on the fly.

1 Like

Yes, there are several steps between e.g. finding a translation online and seeing it live on SuttaCentral… but I’ve never done it myself so I don’t actually know what those steps are… :grimacing:

Perhaps Bhante @Sujato can point us to some documentation? :slight_smile: How would one go about making a change to the abbreviations page? :pray:

The source file is supplied by Snowbird above.

For converting Ids in data we use:

The .csv file is deprecated, it’s just used in search for now, it will be removed.

Only because I put it together years ago and that’s all I knew!

Static page are basically all hand-built, not from data.

They are only composed for the sake of localization. The static files include l10n keys, the content is in site files in sc-data. Here’s the root english files.

Not quite. The raw data from the JSON files is scooped up (when SC is restarted or on data-load) and added to our DB. Then, much like Wordpress, we query the DB to create a REST API. JSON arrives at the front end, and it’s stamped into HTML using lit-element.

2 Likes