Skip to content

Commit

Permalink
(chore) Removed prettier from /includes templates. GH-234
Browse files Browse the repository at this point in the history
  • Loading branch information
Daveiano committed Nov 23, 2024
1 parent a687cff commit acb52ef
Show file tree
Hide file tree
Showing 95 changed files with 38 additions and 289 deletions.
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Ignore artifacts:
dist
skins/weewx-wdc/includes/stat-tile.inc
*.inc
*.html.tmpl
2 changes: 0 additions & 2 deletions skins/weewx-wdc/includes/almanac-moon-detail-tile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8

Expand Down Expand Up @@ -27,7 +26,6 @@
<p class="value">$("%.1f&deg;" % $almanac.moon.dec)</p>
</div>
</div>
<!--prettier-ignore-->
#if $almanac.next_full_moon.raw < $almanac.next_new_moon.raw
<div class="bx--row stats">
<div class="bx--col">
Expand Down
4 changes: 0 additions & 4 deletions skins/weewx-wdc/includes/almanac-sun-detail-tile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8

Expand Down Expand Up @@ -57,7 +56,6 @@
<p class="value">$("%.1f&deg;" % $almanac.sun.dec)</p>
</div>
</div>
<!--prettier-ignore-->
#if $almanac.next_equinox.raw < $almanac.next_solstice.raw
## The equinox is before the solstice. Display them in order.
<div class="bx--row stats">
Expand All @@ -70,7 +68,6 @@
<p class="value">$almanac.next_solstice</p>
</div>
</div>
<!--prettier-ignore-->
#else
## The solstice is before the equinox. Display them in order.
<div class="bx--row stats">
Expand All @@ -89,7 +86,6 @@
<p class="label small">$gettext("Total daylight")</p>
<p class="value">$almanac.sun.visible.long_form</p>
<p class="label small">
<!--prettier-ignore-->
$almanac.sun.visible_change.long_form
#if $almanac.sun.visible_change.raw < 0
$gettext("less than yesterday")
Expand Down
2 changes: 0 additions & 2 deletions skins/weewx-wdc/includes/almanac-tile-simple.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8

Expand All @@ -7,7 +6,6 @@
<div class="bx--row">
<div class="bx--col">
<p class="label">
<!--prettier-ignore-->
$label_almanac
#include "includes/pictograms/sun.svg"
</p>
Expand Down
5 changes: 0 additions & 5 deletions skins/weewx-wdc/includes/almanac-tile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8
#set $planet = $label_almanac.lower()
Expand All @@ -8,15 +7,13 @@
<div class="bx--row">
<div class="bx--col">
<p class="label">
<!--prettier-ignore-->
$gettext($label_almanac)
#if $get_celestial_icon($label_almanac, None) is not None
#include $get_celestial_icon($label_almanac, None)
#end if
</p>
<div class="bx--row">
<div class="bx--col value">
<!--prettier-ignore-->
#if $get_celestial_icon($label_almanac, 'rise') is not None
#include $get_celestial_icon($label_almanac, 'rise')
#end if
Expand All @@ -26,7 +23,6 @@
</div>
</div>
<div class="bx--col value">
<!--prettier-ignore-->
#if $get_celestial_icon($label_almanac, 'transit') is not None
#include $get_celestial_icon($label_almanac, 'transit')
#end if
Expand All @@ -36,7 +32,6 @@
</div>
</div>
<div class="bx--col value">
<!--prettier-ignore-->
#if $get_celestial_icon($label_almanac, 'set') is not None
#include $get_celestial_icon($label_almanac, 'set')
#end if
Expand Down
16 changes: 3 additions & 13 deletions skins/weewx-wdc/includes/body-classic.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8
#set $diagrams_config = $DisplayOptions.get("diagrams", {})
Expand Down Expand Up @@ -45,29 +44,24 @@
#end for
#end if

<!--prettier-ignore-->
<div class="bx--row">
<div class="bx--col-sm-4 bx--col-md-8 bx--col-lg-6 bx--col-xlg-4 bx--col-max-4 layout-col">
#set global $stat_obs = $DisplayOptions.get('stat_tile_observations')
#include 'includes/conditions-table.inc'

<!--prettier-ignore-->
#if $context == "day" and $daily_archive == False
#include "includes/forecast.inc"
#end if

<!--prettier-ignore-->
#if $stat_tiles_xaggs_classic
#set global $hide_xaggs_heading = True
<!--prettier-ignore-->
<header class="bx--col section-header" style="margin-top: 2rem;">
#if $context == 'day'
<h2>$gettext("Historical values for today")</h2>
#else
<h2>$gettext("Historical values")</h2>
#end if
</header>
<!--prettier-ignore-->
<div class="bx--row">
#for $stat_xaggs in $stat_tiles_xaggs_classic
#set global $stat_xaggs = $stat_xaggs
Expand All @@ -92,16 +86,13 @@
</div>
#end if

<!--prettier-ignore-->
#if $show_gauges
<!--prettier-ignore-->
<div class="bx--row">
$render_gauges($DisplayOptions['Gauges'][$context])
</div>
<div class="bx--row">
$render_gauges($DisplayOptions['Gauges'][$context])
</div>
#end if

<div class="bx--row">
<!-- prettier-ignore -->
#set $diagram_index = 0
#set $context_for_diagrams = $context if $context != 'yesterday' else 'day'
#set $diagram_context_config = $DisplayOptions.get("diagrams", {}).get($context_for_diagrams, {}).get('observations', {})
Expand Down Expand Up @@ -157,7 +148,6 @@

#if 'table_tile_observations' in $DisplayOptions
<div class="bx--row">
<!-- prettier-ignore -->
#set global $table_obs = None
#include "includes/data-table-tile.inc"
</div>
Expand Down
7 changes: 0 additions & 7 deletions skins/weewx-wdc/includes/combined-diagram-tile.inc
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<!--prettier-ignore-->
#errorCatcher Echo
#import datetime
#import time

<!--prettier-ignore-->
#encoding UTF-8
## Input vars:
## $combined_diagram - The diagrams config
Expand All @@ -23,7 +21,6 @@
#set $diagram_classes = "bx--col"
#end if

<!--prettier-ignore-->
#set $combined_diagram_obs = {}
#for $combined_obs in $combined_diagram.obs.keys()
#silent $combined_diagram_obs.update({ $combined_obs: $combined_diagram.obs[$combined_obs].observation })
Expand All @@ -45,7 +42,6 @@
<div class="bx--tile diagram-tile combined" data-test="$combined_obs_string">
<div class="bx--row">
<div class="bx--col">
<!--prettier-ignore-->
<p class="label">
#set $icon = $get_icon($comb_obs, $use_combined_diagram_config=True, $context=$context)

Expand All @@ -67,7 +63,6 @@

$gettext($combined_diagram.label)
</p>
<!--prettier-ignore-->
<div class="value">
#set $series_names = []
#set $series_colors = []
Expand Down Expand Up @@ -125,11 +120,9 @@
#end if

<script>
/* prettier-ignore */
var $series_name = $get_diagram_data($observation=$combined_obs, $observation_key=$series_observation_key, $context_key=$context_key, $start_ts=$start_ts, $end_ts=$end_ts, $data_binding=$combined_obs_binding, $alltime_start=$alltime.start.format('%d.%m.%Y'), alltime_end=$alltime.end.format('%d.%m.%Y'), combined=$combined_diagram, combined_key=$comb_obs);
</script>

<!--prettier-ignore-->
#set $combined_index = $combined_index + 1
#end for

Expand Down
10 changes: 0 additions & 10 deletions skins/weewx-wdc/includes/conditions-table.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8

Expand All @@ -7,7 +6,6 @@
src="https://1.www.s81c.com/common/carbon/web-components/version/v1.21.0/structured-list.min.js"
></script>

<!--prettier-ignore-->
#set $label_sum = $get_labels('Sum', $context)
#set $label_min = $get_labels('Min', $context)
#set $label_max = $get_labels('Max', $context)
Expand Down Expand Up @@ -37,11 +35,9 @@
<bx-structured-list-header-row>
<bx-structured-list-header-cell></bx-structured-list-header-cell>
<bx-structured-list-header-cell>
<!--prettier-ignore-->
#if $context != 'day'
$gettext($label_avg)
#end if
<!--prettier-ignore-->
#if $context == 'day'
$gettext("Current")
#end if
Expand All @@ -54,7 +50,6 @@
>
</bx-structured-list-header-row>
</bx-structured-list-head>
<!--prettier-ignore-->
<bx-structured-list-body>
#for $skin_obs in $stat_obs
#set $skin_obs_binding = $get_data_binding($skin_obs)
Expand Down Expand Up @@ -88,7 +83,6 @@
<bx-structured-list-row data-test="$skin_obs" data-observation="$skin_obs_key" data-unit="$get_unit_label($get_unit_for_obs($skin_obs, $skin_obs_key, $context))" data-rounding="$get_rounding($skin_obs, $skin_obs_key)">
<bx-structured-list-cell class="cell-label">$obs.label[$skin_obs]</bx-structured-list-cell>
<bx-structured-list-cell class="cell-value">
<!--prettier-ignore-->
#if $context == 'day' and not $daily_archive
<span>
#if $skin_obs_binding != 'wx_binding'
Expand Down Expand Up @@ -130,7 +124,6 @@
#end if
#end if
</bx-structured-list-cell>
<!--prettier-ignore-->
<bx-structured-list-cell class="cell-min">
#if $getattr($context_binded, $skin_obs_key).has_data
<span>$getattr($context_binded, $skin_obs_key).min.format("%." + $rounding + "f")</span>
Expand All @@ -142,7 +135,6 @@
<span>$gettext("N/A")</span>
#end if
</bx-structured-list-cell>
<!--prettier-ignore-->
<bx-structured-list-cell class="cell-max">
#if $getattr($context_binded, $skin_obs_key).has_data
<span>$getattr($context_binded, $skin_obs_key).max.format("%." + $rounding + "f")</span>
Expand Down Expand Up @@ -189,7 +181,6 @@
<bx-structured-list-header-cell></bx-structured-list-header-cell>
</bx-structured-list-header-row>
</bx-structured-list-head>
<!--prettier-ignore-->
<bx-structured-list-body>
#for $skin_obs in $stat_obs
#set $skin_obs_binding = $get_data_binding($skin_obs)
Expand All @@ -201,7 +192,6 @@
#set $rounding = $str($get_rounding($skin_obs, $skin_obs_key))
<bx-structured-list-row data-aggregation="sum" data-test="$skin_obs" data-observation="$skin_obs_key" data-unit="$get_unit_label($get_unit_for_obs($skin_obs, $skin_obs_key, $context))" data-rounding="$get_rounding($skin_obs, $skin_obs_key)">
<bx-structured-list-cell class="keep-cell">$obs.label[$skin_obs]</bx-structured-list-cell>
<!--prettier-ignore-->
<bx-structured-list-cell class="cell-value">
$getattr($context_binding, $skin_obs_key).sum.format("%." + $rounding + "f")
</bx-structured-list-cell>
Expand Down
2 changes: 0 additions & 2 deletions skins/weewx-wdc/includes/data-table-tile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#encoding UTF-8
#errorCatcher Echo

Expand All @@ -7,7 +6,6 @@
<div class="bx--row">
<div class="bx--col">
<script>
/*prettier-ignore*/
#if $context == 'alltime'
var tableRows = $get_table_rows($alltime.start.raw, $alltime.end.raw, $context, $table_obs);
var tableHeaders = $jsonize($get_table_headers($alltime.start.raw, $alltime.end.raw, $table_obs));
Expand Down
6 changes: 0 additions & 6 deletions skins/weewx-wdc/includes/diagram-tile.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8
#set diagram_classes = "bx--col-sm-4 bx--col-md-8 bx--col-lg-12 bx--col-xlg-6 bx--col-max-4"
Expand All @@ -13,7 +12,6 @@
<div class="bx--tile diagram-tile" data-test="$partial_obs">
<div class="bx--row">
<div class="bx--col">
<!--prettier-ignore-->
<p class="label">
#set $icon = $get_icon($partial_obs_key, $use_diagram_config=True, $context=$context)
#if $icon != 'none' and "includes/icons/" in $icon and '.svg' in $icon
Expand All @@ -24,12 +22,10 @@
$obs.label[$partial_obs]
</p>
<div class="value">
<!--prettier-ignore-->
#set $series_name = $partial_obs + 'Series' + str($diagram_index)
#set $partial_obs_binding = $get_data_binding($partial_obs, $context)

<!--TODO: Implement custom context logic from combined-diagram-tile template-->
<!--prettier-ignore-->
#if $context == 'month' and $use_parameter_month
#set $obs_context = $month($data_binding=$partial_obs_binding)
#else if $context == 'year' and $use_parameter_year
Expand All @@ -43,11 +39,9 @@
#end if

<script>
/* prettier-ignore */
var $series_name = $get_diagram_data($observation=$partial_obs, $observation_key=$partial_obs_key, $context_key=$context, $start_ts=$obs_context.start.raw, $end_ts=$obs_context.end.raw, $data_binding=$partial_obs_binding, $alltime_start=$alltime.start.format('%d.%m.%Y'), alltime_end=$alltime.end.format('%d.%m.%Y'));
</script>

<!--prettier-ignore-->
<div
class="diagram"
data-labels="['$obs.label[$partial_obs]']"
Expand Down
1 change: 0 additions & 1 deletion skins/weewx-wdc/includes/dwd-warning.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8

Expand Down
3 changes: 0 additions & 3 deletions skins/weewx-wdc/includes/footer.inc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!--prettier-ignore-->
#errorCatcher Echo
#encoding UTF-8

Expand All @@ -24,7 +23,6 @@
</p>
</div>
</div>
<!--prettier-ignore-->
#if 'github_link' in $Extras and $to_bool($Extras.github_link)
<div class="bx--row">
<div class="bx--col">
Expand All @@ -40,7 +38,6 @@
#end if
<div class="bx--row">
<div class="bx--col">
<!--prettier-ignore-->
<p class="footnote">
$gettext("This station is controlled by <a target='_blank' href='https://weewx.com'>WeeWX</a>, an experimental weather software system written in Python.")
</p>
Expand Down
Loading

0 comments on commit acb52ef

Please sign in to comment.