EssamWisam / cmp-docs

A comprehensive guide for prospective, current and past students in the computer engineering department of Cairo university.
https://cmp-docs.pages.dev
52 stars 8 forks source link

🪲 Footnotes Title in the Arabic Section #45

Closed Khalidmamdou7 closed 4 months ago

Khalidmamdou7 commented 5 months ago

Footnotes Title in the Arabic Section

While I was making the pr #44, I have noticed this issue that may require editing if someone has the time. In the Arabic pages, the footnotes is automatically created at the end of the page but with an English Title "Footnotes", if we could change it to an Arabic one like "ملاحظات" I think would be more appropriate. I would create an issue for it and mention it if anyone have the time to look for it.

image

I have looked up a solution and asked chatgpt and it recommended making a custom plugin for the markdown compiler and edit the generated html file. Unfortunately, I currently don't have the time to investigate the problem thoroughly, so if anyone has the time and the knowledge could help in this.

EssamWisam commented 5 months ago

Thanks for the catch. Let me shed some light that while creating this project I got the impression that the React markdown extension is really sick (for instance, it was painful to have it do more basic stuff like rendering HTML or katex and they don't have any formal documentation beyond the README). Thus, I am quite surprised that the extension supports the footnote feature in English and will be even more surprised if they give the ability to change their default "Footnotes" statement (which is a bad idea in the first place IMO).

Now iterating the point that they barely have docs and in the existing ones I can only find that they mention support footnotes and nothing else, it's quite likely that they don't support the feature of changing the generated "Footnotes" titles. I was about to drop them an issue to assert that in case they have undocumented but the following workaround crossed my mind:

#footnote-label {
display: none;
}

The ID I used seems to be the one they automatically give to any footnote and like I said, it was a bad idea for them to generate it in the first place because markdown by default doesn't generate that headline when it generates the footnotes and because it causes issues like this one (also what if I want to call it "references").

Given this, you can manually use an h2 to write "Footnotes" yourself along with the Arabic equivalent.

Sidenote you probably already know: ChatGPT will hallucinate if you ask it about something it hasn't seen it or something similar in the training data (i.e., no docs or discussion about that particular issue or similar on the internet). I tend not to ask it or at least not take its response at face value in cases like these. On the other hand, for things where there are docs or discussions or at least similar ones, it's much faster than trying to find them.

Khalidmamdou7 commented 4 months ago

Clever workaround :smile: , I think this will do it in the future if needed.