Python 3.12 brought some new functionality to f-strings, described in PEP 701, that I only just discovered. One of those new features is reusing quotes which I first saw in the wild last week. Another functionality is removing the restrictions on multi-line f-strings and allowing comments.
Read from linktil
Alex shares how to create static maps using Python and in doing so calculate a position on the unit square from coordinates. There's helpful Python code and a link to the OSM wiki describing the maths behind it. This was something I'd struggled to do when trying to add new points to the tiny-world-map. I was able to adjust the base map and add my own cities and plan to use this to add railway stations to the media map.
Read from linkTIL you can use an Apple TV as a tailscale exit node which according to the Mastodon thread also works when the app is running in the background. Cool use case. Being able to setup GitHub actions to use the tailscale exit node is a bonus.
Coincidentally, I also shared a post earlier today from Ruben Schade about his Apple TV.
Read from linkStefan writes about how a <section>
is essentially a <div>
if an aria-label
is not used. The <section>
element would have been more prominent if browsers had implemented document outline functionality, which, according to Stefan never happened. So today, you can use <section>
s to signal where a section begins and ends, an example given in the writing was a summary paragraph.
In my site and blog, I use <sections>
a number of times, and TIL they're not much more than <div>
s. I'll have to revisit my HTML templates and CSS and make changes.
Terence Eden shares a few small CSS snippets to style links based on where they go. This could include adding text, changing the font size or color and other CSS properties. Using attribute selectors you can match links that start with, end with or contain specific domains.
Read from linkThe author of TheCoffeeMachine gives a detailed walkthrough of how to add maps to a hugo site using uMap, which allows you to create maps based on OpenStreetMap (OSM) layers, and a shortcode that allows you to embed them. This is a belated TIL as I've already used this a few times, most recently for my post on the Tri-Country Train.
A rough overview of the steps involves signing up for and using uMap. This will allow you to create a map, set markers, and make the adjustments you need on top of existing OSM layer. From here using hanzei's hugo-component-osm theme you can embed the map into the hugo site using a shortcode. This includes passing in any parameters that uMap supports like coordinates to center the map and the zoom level.
I recommend reading the linked post for detailed steps. I needed to take this further and include a class within the iframe that's rendered on the page to able to style it with CSS. Unable to find a way to do this I forked and made my own addition. The pull request was created to the original repository if hanzei would like to include the changes. Here's a sample of what it looks like:
{< openstreetmap mapName="usa-train-lines-using-stadler-multiple-units_1100675" coordX="40.0731" coordY="-74.8924" scale="10" class="alignright" >}}
Atom differs from RSS in a few key ways and for the better. Chris Wellons' blog post outlines a few of these differences theyve encountered while working on Elfeed for emacs. One thatve I run into before and find really odd is the use of <channel>
when only one channel is permitted in an RSS feed.
Read from linkHaving a channel tag suggests a single feed can have a number of different channels. Nope! Only one channel is allowed, meaning the channel tag serves absolutely no purpose.
Atom is a much cleaner specification, with much clearer intent, and without all the mistakes and ambiguities.