Skip to content

Add an introduction to HTML templating #13430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 20, 2025

Conversation

vwheeler63
Copy link
Contributor

Purpose

To more quickly orient the reader who is new to HTML templating. (I was recently a beginner on the topic, and I found the introductory section I added to be missing, which made it more difficult to understand the subsequent content.)

References

@AA-Turner AA-Turner changed the title docs(templating.rst): add orientation for those new to HTML templating Add an introduction to HTML templating Mar 13, 2025
@vwheeler63
Copy link
Contributor Author

vwheeler63 commented Mar 14, 2025

Honored to be in contact with you, Mr. Turner! 😄 ( @AA-Turner ) I love your edit! It's exactly what I needed the other day when I started learning about Templates!

altering Sphinx's source code, meaning that the Sphinx core can provide basic HTML
generation, independent of the final output.

Since template files function similar to Cascading Style Sheets, generating HTML
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vwheeler63 can you elaborate on this line please? I'm not sure I follow on the similarity between CSS and templates.

Copy link
Contributor Author

@vwheeler63 vwheeler63 Mar 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vwheeler63 can you elaborate on this line please? I'm not sure I follow on the similarity between CSS and templates.

What I meant to convey there is about the relationship between templates, where "more local" templates can inherit from higher templates and override as much of them as desired, from a tiny bit (e.g. one block), up through the whole thing. And in that respect, I find that similar (at least in my mind) to CSS. If that's not actually a good comparison, then perhaps it would be better simply to state explicitly that the more local template can override as little or as much of the higher-level template as desired? (Note: while I am a 32-veteran developer, I'm new to web development (and learning), so my view of CSS is probably limited compared to yours.) Perhaps it shares a deeper similarity to inheritance in O-O languages.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vwheeler63 can you elaborate on this line please? I'm not sure I follow on the similarity between CSS and templates.

I will try an alternate description simply using inheritance.

Copy link
Contributor Author

@vwheeler63 vwheeler63 Mar 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AA-Turner It's also possible that detail about the inheritance is not needed in an orientation paragraph. As a student, however, I found it helpful to quickly get my mind around the nature of template files and the amazingly powerful tool that they are, and why they were/are a genius design choice for Sphinx to use to push HTML through to get a final result! 😄

@AA-Turner AA-Turner merged commit 05838f0 into sphinx-doc:master Mar 20, 2025
7 checks passed
@AA-Turner
Copy link
Member

Thanks @vwheeler63, a very useful addition.

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 18, 2025
@vwheeler63 vwheeler63 deleted the docs/templating_introduction branch April 22, 2025 22:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants