Skip to content

Moonmode label parameters#2881

Open
tswfi wants to merge 5 commits into
aaronwmorris:mainfrom
tswfi:moonmode_label_parameters
Open

Moonmode label parameters#2881
tswfi wants to merge 5 commits into
aaronwmorris:mainfrom
tswfi:moonmode_label_parameters

Conversation

@tswfi
Copy link
Copy Markdown
Contributor

@tswfi tswfi commented Apr 23, 2026

Instead of always appending the moonmode and eclipse modes at the end of the template add new placeholders for them.

New template variables:
{moonmode}: On/Off, just like stretch
{moonmode_label}: empty or * Moon Mode * just like the current implementation injected
{moonmode_none}: always empty, nice way to supress the message

{eclipse}: No/Lunar/Solar
{eclipse_label}: empty * LUNAR ECLIPSE * or * SOLAR ECLIPSE *
{eclipse_none}: always empty, supresses the message

{modes}: the same thing that was automatically injected but now it can be put anywhere
{modes_none}: always empty, supresses modes from the template completely

If tempalate does not contain any of those this works just like before. If those are found from the template they will not be added automatically and instead just the new variable is rendered.

get_image_label was refactored a bit to get the moonmode and eclipse be nicely in their own places. Also dried up adding adsb, satellite and extra_file data to the template (they all did the same thing so just loop them)

Some minor tweaks:

  • two new constants: LUNAR_ECLIPSE_MAX_SUN_MOON_SEP and SOLAR_ECLIPSE_MIN_SUN_MOON_SEP just to get rid of two magic numbers
  • More helpful help texts for some of the fields on that page and link to pillow documentation about how anchor works
  • as the help text is now longer made the template textarea a bit longer too :)
  • new default template has the {modes} variable so everything looks just like before but it uses the new variable.

This issue #2350 was the inspiration to take a look at this.

I wasn't able to test all of these (I have no adsb data configured)... Would love to see a test suite for everything but that is kinda daunting task...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant