Noob question about curly braces - only peripheral to weewx

33 views
Skip to first unread message

n7uv...@gmail.com

unread,
Apr 28, 2024, 10:51:30 PM4/28/24
to weewx-user
I have no idea what I'm talking about here. However, while tweaking various .html.tmpl and .inc files, I saw this in celestial.html.tmpl
Screenshot 2024-04-28 154723.png
The leading curly brace is commented out, while the trailing mate is not. Obviously, it seems to work. Is this because (I think) Python relies upon indentation, not braces?

I removed the hashes, and it runs the same. 

Cheers -- Jon N7UV

Tom Keffer

unread,
Apr 28, 2024, 11:06:41 PM4/28/24
to weewx...@googlegroups.com
You are looking at a CSS file, not a Python file. In a CSS file, the hash mark (#) is an ID Selector, not a comment. 

So, a CSS entry of

#my-heading h1 {
  font-weight: bold;
}

would use a bold font for the entity with id "my-heading":

<h1 id="my-heading">This is my heading</h1>

The hash mark (#) is used because it's analogous to an anchor reference <a href="#my-heading">.

Comments are C-style. They use surrounding /* and */;

/* This is a comment */

Hope that helps.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/f4326510-ea85-4aaf-af9d-591340389614n%40googlegroups.com.

n7uv...@gmail.com

unread,
Apr 28, 2024, 11:29:45 PM4/28/24
to weewx-user
Yes, it does. Thanks! The nano editor highlights the #'d lines in the same color as comments. My bad.

Cheers - Jon N7UV
Reply all
Reply to author
Forward
0 new messages