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.
I believe this csv file:
Thank you, that’s what I was looking for!
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…
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
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…
Whereas in the csv it shows this:
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.
Oh! Seems you may be right
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.
I kind of assumed that it was, like most files in SuttaCentral, generated by a script at some point.
It’s very hard to tell in their code which files are actually source code and which are intermediate files generated by scripts
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.
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…
Perhaps Bhante @Sujato can point us to some documentation? How would one go about making a change to the abbreviations page?
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.