chaz23 / buddhism-in-color

https://buddhism-in-color.vercel.app
MIT License
0 stars 0 forks source link

Move ID that are in <dt> tags to <dfn> tags #5

Closed chaz23 closed 2 years ago

chaz23 commented 2 years ago

As per the markup format specified in #2, IDs need to be within the <dfn> tag. However, some entries have the ID inside the <dt> tag instead.

A quick Ctrl+F with search term "dt id=" on the DPPN-SC json file will highlight the problematic entries. To maintain consistency across entries, let's move these IDs from the <dt> to the <dfn> tags.

chaz23 commented 2 years ago

@thesunshade this one is good to go as well.

thesunshade commented 2 years ago

Have you cleared this with Bhante Sujato? I'm not completely clear if you are planning on building your own version of DPPN-SC, or if we are, with this change especially, planning on have it be changed on the sutta-central repo.

Of course you can have your own version too, but that means that the corrections have to be done in both places, eh?

chaz23 commented 2 years ago

Have you cleared this with Bhante Sujato?

I only asked him in person, but I'll send him an email as well just to confirm.

planning on building your own version of DPPN-SC

No, like we discussed, let's try to make as many improvements as possible to the DPPN-SC, and then fork it only when we need to. I don't think that any of the changes we are making are breaking changes - we're just removing whitespace, adding IDs etc.

So with all the issues that we have highlighted, are you able to update the original DPPN-SC with amendments and push those changes to the SC github repo?

thesunshade commented 2 years ago

Yes, I can do all those things. Shouldn't be a problem. We had a ten hour power cut yesterday so I wasn't able to get much done. No idea what today will be like.

I was trying to read the (semi) official docs on the <dfn> tags and it seems that they are being used incorrectly. Or at least in a non-standard way. That's been tripping me up. The <dfn> tag is supposed to be used within a sentence that defines the term so that you can link back to it later. So using it in an actual dictionary context seems out of place. Any hoo, I'll figure it out.

I've never contributed changes like this to a project... Should I be doing an individual commit for each type of change? Like one for removing the spaces, one for moving the ids? Otherwise I think it may be hard to check.

Also, I currently have a clone of the master branch of sc-data. I guess I need to clone that one that I have and make the changes to that? I'm very new at this. I will ask on the SC forum.

chaz23 commented 2 years ago

Or at least in a non-standard way.

Interesting. I wonder if it necessarily has to be used "phrase or sentence". I think the idea is that for example if we gave Sariputta an ID, then under Mahamoggallana's entry if we wrote something like

he was a chief disciple with Venerable <a href="#Sariputta1">Sariputta</a>

then if we clicked on the link it would take us to the entry for Sariputta. Am I just repeating what you've already said?? :joy:

Anyway let me know when you figure out the right way of using it.

Should I be doing an individual commit for each type of change?

The advice is to commit often, and so you'd end up individual commits for each change type. Also when you commit you can write an informative description (within 50 characters I think is the norm). But ask them what their workflow process looks like. I'd like to learn as well.

thesunshade commented 2 years ago

I wonder if it necessarily has to be used "phrase or sentence".

So from what I read, it looks like if you have a true list/dictionary, the dt (dictionary term) would have the id. The dfn is just a semantic way of indicating where a term is defined in a context (i.e. sentence/paragraph). And in that case the dfn would hold the id, instead of, say, the paragraph or a span.

You can have more than one dt (dictionary term) followed by a dd (dictionary definition). And in fact we do.

I have turned the json file into a real html doc and am styling things to make it more clear what is going on. There is this odd case where there are two def tags with ids and within each of those there are another two each of dt tags. :

        <div class="word">acelakassapa</div>
        <div class="text">
            <dl class='person'>
                <dt><dfn id='Acelakassapa1'>Acelakassapa</dfn><sup>1</sup></dt>
                <dt id='Acela1'>Acela</dt>
                <dt id='Kassapa10'>Kassapa</dt>
                <dd>
                    <p>A naked ascetic. He visited the Buddha at Ujuññā in the Kaṇṇa-katthala deer-park and asked him if   it  were true that he disparaged all penance and reviled ascetics. Their conversation is recorded in   the  Kassapa-Sīhanāda Sutta. <span class='ref'>DN.i.161<em>ff.</em></span> After the usual four months’  probation, he joined the Order and in due course became an arahant. <span
                            class='ref'>DN.i.177</span></p>
                    <p>In the Majjhima Nikāya <span class='ref'>MN.iii.124<em>ff.</em></span> we are told that he was an old  friend of Bakkula Thera, and that after a conversation with him. obtained his ordination under  him.
                    </p>
                    <p>The Kassapa mentioned in the Acela Sutta <span class='ref'>SN.ii.18<em>f.</em></span> is probably   the    same person, though the stories of their conversions are different.</p>
                </dd>
                <dt><dfn id='Acelakassapa2'>Acelakassapa</dfn><sup>2</sup></dt>
                <dt id='Acela2'>Acela</dt>
                <dt id='Kassapa11'>Kassapa</dt>
                <dd>
                    <p>An old family friend of Cittagapahati. Having been for thirty years a <i>paribbājaka</i>, he  admits   to Citta that he had thereby obtained no particular excellence of knowledge. Citta tells him of  his own attainments and Kassapa expresses a desire to enter the Order. He is duly ordained, and  shortly  afterwards becomes an arahant. <span class='ref'>SN.iv.300<em>ff.</em></span></p>
                </dd>
            </dl>
        </div>

abhaya is a somewhat similar situation.

So if there are situations where both the dfn and the dt has ids, then that has to be figured out.

Could you loop me in to whatever conversation you are having with Bhante S about this? I'd really like to know why the ids are there in the first place, if they are even being used anywhere, etc.

thesunshade commented 2 years ago

Here is a visualization(?) of the DPPN-SC that reveals a bit of what is going on. https://stately-hummingbird-392e64.netlify.app/

May be helpful. Power just cut, so I don't know how much more I can work ATM.

chaz23 commented 2 years ago

Power just cut.

Yeah the situation in SL is unbelievable. My family is there as well. I'm so sorry that you all have to be going through that... 😢

Could you loop me in to whatever conversation you are having with Bhante S about this?

There is no conversation as such really, all I did was send him an email asking permission for you to update the DPPN on SC. Perhaps we could start a thread with him on D&D? If so I'd appreciate if you could do that, I think you'd know better about what questions to ask him. And I can jump in if I want to clarify anything.

I'd really like to know why the ids are there in the first place, if they are even being used anywhere, etc.

I'm guessing they're not being used? Given that many entries (if there's only one person) don't have IDs. However, we really do need IDs, at least for this project otherwise we can't link people together.

chaz23 commented 2 years ago

Also just to clarify, so are you saying that we don't actually need <dfn> tags nested inside <dt>? However they can be nested inside <dd> if they're referencing someone of a different entry??

chaz23 commented 2 years ago

<dt><dfn id='Acelakassapa1'>Acelakassapa</dfn><sup>1</sup></dt> <dt id='Acela1'>Acela</dt> <dt id='Kassapa10'>Kassapa</dt>

This is really weird. Since they're all referencing the same person, the IDs should all be the same, correct? The second and third <dt> elements are probably similar to the aliases field in our MN characters table. Acela and Kassapa are aliases for Acelakassapa.

thesunshade commented 2 years ago

Also just to clarify, so are you saying that we don't actually need <dfn> tags nested inside <dt>?

In theory, that is my understanding. However, they seem to be used to indicate the main word when their are aliases.

So every individual will have their own dfn (wrapped in dt). If there is more than one thing the same name, then their will be another dfn (wrapped in dt). If one thing has alternate names/aliases then there will be more names wrapped in dt tags under the dt tags that wrap the dft.

Hope I'm not making this more complicated than it needs to be.

What I can't yet figure out is why the ids are where they are.

chaz23 commented 2 years ago

Ok I got it. So do you think that indicating the main name by the <dft> tag is the right way to do it??

If one thing has alternate names/aliases then there will be more names wrapped in dt tags under the dt tags that wrap the dft.

Seems like there should be term-description pairs. If not, I guess we use the following logic: if a term does not have a description, take the next available description...?

thesunshade commented 2 years ago

Ok I got it. So do you think that indicating the main name by the <dft> tag is the right way to do it??

Nooooo idea. That would really be Bhante S's call. Having a series of <dt> items seems to be within correct usage, but there isn't a way (that I can see) to indicate what is the "main" word. That may be why the dfn tags are being used. I'll put that in the message I'm writing to Bhante.

I may have been reading the documentation incorrectly. It could be that this is a fine use of the dfn tag. Here is what I think is the official specification. And this is the developer.mozilla.org documentation.

thesunshade commented 2 years ago

OK, Bhante has given the OK for this. I will try to take care of this today.

thesunshade commented 2 years ago

OK, so instead of moving ids from dt to def I actually made new ids in the def tags that matched what we will be converting to in the future. So for example rather than Angulimala being Ahimsaka1, he is just aṅgulimāla.

I have a draft pull request. Can you tell me if this looks ok? https://github.com/suttacentral/sc-data/pull/132

chaz23 commented 2 years ago

I think it looks ok!

thesunshade commented 2 years ago

So, I think this issue is resolved?