From 25430c228d5392878f772595f6a9441c062371b7 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Wed, 9 May 2018 11:56:27 -0700 Subject: [PATCH] Adds the Weather module to the documentation --- _site/content/posts/modules.md | 2 +- _site/content/posts/modules/textfile.md | 5 +- _site/content/posts/modules/weather.md | 59 ++++++ .../hyde-hyde/layouts/partials/sidebar.html | 2 +- _site/themes/hyde-hyde/static/css/wtf.css | 2 +- docs/404.html | 2 +- docs/categories/index.html | 2 +- docs/css/wtf.css | 2 +- docs/index.html | 2 +- docs/index.xml | 19 +- docs/posts/configuration/index.html | 2 +- docs/posts/glossary/index.html | 2 +- docs/posts/index.html | 9 +- docs/posts/index.xml | 19 +- docs/posts/modules/bamboohr/index.html | 2 +- docs/posts/modules/clocks/index.html | 2 +- docs/posts/modules/index.html | 4 +- docs/posts/modules/newrelic/index.html | 2 +- docs/posts/modules/opsgenie/index.html | 2 +- docs/posts/modules/security/index.html | 2 +- docs/posts/modules/textfile/index.html | 7 +- docs/posts/modules/weather/index.html | 168 ++++++++++++++++++ docs/sitemap.xml | 9 +- docs/tags/index.html | 2 +- textfile/widget.go | 4 +- todo/widget.go | 4 +- weather/widget.go | 14 +- wtf/billboard_modal.go | 2 +- 28 files changed, 314 insertions(+), 39 deletions(-) create mode 100644 _site/content/posts/modules/weather.md create mode 100644 docs/posts/modules/weather/index.html diff --git a/_site/content/posts/modules.md b/_site/content/posts/modules.md index 99cfea1d..83a13246 100644 --- a/_site/content/posts/modules.md +++ b/_site/content/posts/modules.md @@ -31,5 +31,5 @@ Available modules:
  • Security
  • Text File
  • Todo -
  • Weather +
  • Weather diff --git a/_site/content/posts/modules/textfile.md b/_site/content/posts/modules/textfile.md index 71864eea..13eee68c 100644 --- a/_site/content/posts/modules/textfile.md +++ b/_site/content/posts/modules/textfile.md @@ -22,12 +22,11 @@ None. ## Keyboard Commands -Key: `h`
    +Key: `/`
    Action: Open/close the widget's help window. Key: `o`
    -Action: Opens the text file in whichever -text editor is associated with that file type. +Action: Opens the text file in whichever text editor is associated with that file type. ## Configuration diff --git a/_site/content/posts/modules/weather.md b/_site/content/posts/modules/weather.md new file mode 100644 index 00000000..fd97cb33 --- /dev/null +++ b/_site/content/posts/modules/weather.md @@ -0,0 +1,59 @@ +--- +title: "Weather" +date: 2018-05-09T11:44:13-07:00 +draft: false +--- + +## Description + +## Source Code + +```bash +wtf/weather/ +``` + +## Required ENV Variables + +Key: `WTF_OWM_API_KEY`
    +Action: Your OpenWeatherMap API key. + +## Keyboard Commands + +Key: `/`
    +Action: Open/close the widget's help window. + +Key: `h`
    +Action: Show the previous weather location. + +Key: `l`
    +Action: Show the next weather location. + +Key: `←`
    +Action: Show the previous weather location. + +Key: `→`
    +Action: Show the next weather location. + +## Configuration + +```yaml +weather: + cityids: + - 6173331 + - 3128760 + - 6167865 + - 6176823 + colors: + current: "lightblue" + enabled: true + language: "EN" + position: + top: 0 + left: 2 + height: 1 + width: 1 + refreshInterval: 900 + tempUnit: "C" +``` + +### Attributes diff --git a/_site/themes/hyde-hyde/layouts/partials/sidebar.html b/_site/themes/hyde-hyde/layouts/partials/sidebar.html index 9b6ce1d3..7252f6c4 100644 --- a/_site/themes/hyde-hyde/layouts/partials/sidebar.html +++ b/_site/themes/hyde-hyde/layouts/partials/sidebar.html @@ -28,7 +28,7 @@
  • - + diff --git a/_site/themes/hyde-hyde/static/css/wtf.css b/_site/themes/hyde-hyde/static/css/wtf.css index 5db9d0d6..568e030f 100644 --- a/_site/themes/hyde-hyde/static/css/wtf.css +++ b/_site/themes/hyde-hyde/static/css/wtf.css @@ -18,7 +18,7 @@ span.caption { display: inline-block; font-weight: bold; margin-right: 4px; - min-width: 50px; + min-width: 58px; text-align: right; } diff --git a/docs/404.html b/docs/404.html index 342d7ca8..7fab3b69 100644 --- a/docs/404.html +++ b/docs/404.html @@ -68,7 +68,7 @@ - + diff --git a/docs/categories/index.html b/docs/categories/index.html index 73712ba4..6ea34ab7 100644 --- a/docs/categories/index.html +++ b/docs/categories/index.html @@ -70,7 +70,7 @@ - + diff --git a/docs/css/wtf.css b/docs/css/wtf.css index 5db9d0d6..568e030f 100644 --- a/docs/css/wtf.css +++ b/docs/css/wtf.css @@ -18,7 +18,7 @@ span.caption { display: inline-block; font-weight: bold; margin-right: 4px; - min-width: 50px; + min-width: 58px; text-align: right; } diff --git a/docs/index.html b/docs/index.html index acaea82d..3b20f983 100644 --- a/docs/index.html +++ b/docs/index.html @@ -69,7 +69,7 @@ - + diff --git a/docs/index.xml b/docs/index.xml index 9620d0b3..5cd59360 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -6,11 +6,26 @@ Recent content on WTF Hugo -- gohugo.io en-us - Wed, 09 May 2018 11:13:11 -0700 + Wed, 09 May 2018 11:44:13 -0700 + + Weather + http://wtfutil.com/posts/modules/weather/ + Wed, 09 May 2018 11:44:13 -0700 + + http://wtfutil.com/posts/modules/weather/ + Description Source Code wtf/weather/ Required ENV Variables Key: WTF_OWM_API_KEY Action: Your OpenWeatherMap API key. +Keyboard Commands Key: / Action: Open/close the widget’s help window. +Key: h Action: Show the previous weather location. +Key: l Action: Show the next weather location. +Key: ← Action: Show the previous weather location. +Key: → Action: Show the next weather location. +Configuration weather: cityids: - 6173331 - 3128760 - 6167865 - 6176823 colors: current: "lightblue" enabled: true language: "EN" position: top: 0 left: 2 height: 1 width: 1 refreshInterval: 900 tempUnit: "C" Attributes + + Textfile http://wtfutil.com/posts/modules/textfile/ @@ -19,7 +34,7 @@ http://wtfutil.com/posts/modules/textfile/ Description Displays the contents of the specified text file in the widget. Source Code wtf/textfile/ Required ENV Variables None. -Keyboard Commands Key: h Action: Open/close the widget’s help window. +Keyboard Commands Key: / Action: Open/close the widget’s help window. Key: o Action: Opens the text file in whichever text editor is associated with that file type. Configuration textfile: enabled: true filename: "notes.md" position: top: 5 left: 4 height: 2 width: 1 refreshInterval: 15 Attributes enabled Determines whether or not this module is executed and if its data displayed onscreen. diff --git a/docs/posts/configuration/index.html b/docs/posts/configuration/index.html index 75da43fc..fca59227 100644 --- a/docs/posts/configuration/index.html +++ b/docs/posts/configuration/index.html @@ -68,7 +68,7 @@ - + diff --git a/docs/posts/glossary/index.html b/docs/posts/glossary/index.html index e1596cf2..3e9b1dcd 100644 --- a/docs/posts/glossary/index.html +++ b/docs/posts/glossary/index.html @@ -68,7 +68,7 @@ - + diff --git a/docs/posts/index.html b/docs/posts/index.html index 2fdd7cfb..6596ea14 100644 --- a/docs/posts/index.html +++ b/docs/posts/index.html @@ -70,7 +70,7 @@ - + @@ -89,6 +89,13 @@

    Posts

    diff --git a/docs/posts/modules/clocks/index.html b/docs/posts/modules/clocks/index.html index b058e189..a74c4074 100644 --- a/docs/posts/modules/clocks/index.html +++ b/docs/posts/modules/clocks/index.html @@ -68,7 +68,7 @@ - + diff --git a/docs/posts/modules/index.html b/docs/posts/modules/index.html index de223c4a..7d3e666b 100644 --- a/docs/posts/modules/index.html +++ b/docs/posts/modules/index.html @@ -68,7 +68,7 @@ - + @@ -128,7 +128,7 @@ display in the “Clocks” widget.

  • Security
  • Text File
  • Todo -
  • Weather +
  • Weather diff --git a/docs/posts/modules/newrelic/index.html b/docs/posts/modules/newrelic/index.html index 4dc53dd7..e1301004 100644 --- a/docs/posts/modules/newrelic/index.html +++ b/docs/posts/modules/newrelic/index.html @@ -68,7 +68,7 @@
  • - + diff --git a/docs/posts/modules/opsgenie/index.html b/docs/posts/modules/opsgenie/index.html index 5493fb47..40bd9e29 100644 --- a/docs/posts/modules/opsgenie/index.html +++ b/docs/posts/modules/opsgenie/index.html @@ -68,7 +68,7 @@ - + diff --git a/docs/posts/modules/security/index.html b/docs/posts/modules/security/index.html index 1e74b947..0c5c019c 100644 --- a/docs/posts/modules/security/index.html +++ b/docs/posts/modules/security/index.html @@ -68,7 +68,7 @@ - + diff --git a/docs/posts/modules/textfile/index.html b/docs/posts/modules/textfile/index.html index dcf07930..27cac139 100644 --- a/docs/posts/modules/textfile/index.html +++ b/docs/posts/modules/textfile/index.html @@ -68,7 +68,7 @@ - + @@ -120,12 +120,11 @@

    Keyboard Commands

    -

    Key: h
    +

    Key: /
    Action: Open/close the widget’s help window.

    Key: o
    -Action: Opens the text file in whichever -text editor is associated with that file type.

    +Action: Opens the text file in whichever text editor is associated with that file type.

    Configuration

    diff --git a/docs/posts/modules/weather/index.html b/docs/posts/modules/weather/index.html new file mode 100644 index 00000000..c14b5eb6 --- /dev/null +++ b/docs/posts/modules/weather/index.html @@ -0,0 +1,168 @@ + + + + + + + + + + + + +Weather | WTF + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    Weather

    + +
    + +
    + + + +

    Description

    + +

    Source Code

    + +
    wtf/weather/
    +
    + +

    Required ENV Variables

    + +

    Key: WTF_OWM_API_KEY
    +Action: Your OpenWeatherMap API key.

    + +

    Keyboard Commands

    + +

    Key: /
    +Action: Open/close the widget’s help window.

    + +

    Key: h
    +Action: Show the previous weather location.

    + +

    Key: l
    +Action: Show the next weather location.

    + +

    Key:
    +Action: Show the previous weather location.

    + +

    Key:
    +Action: Show the next weather location.

    + +

    Configuration

    + +
    weather:
    +  cityids:
    +  - 6173331
    +  - 3128760
    +  - 6167865
    +  - 6176823
    +  colors:
    +    current: "lightblue"
    +  enabled: true
    +  language: "EN"
    +  position:
    +    top: 0
    +    left: 2
    +    height: 1
    +    width: 1
    +  refreshInterval: 900
    +  tempUnit: "C"
    +
    + +

    Attributes

    + +
    + +
    + + + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 96723ada..911d4b62 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -2,6 +2,11 @@ + + http://wtfutil.com/posts/modules/weather/ + 2018-05-09T11:44:13-07:00 + + http://wtfutil.com/posts/modules/textfile/ 2018-05-09T11:13:11-07:00 @@ -54,7 +59,7 @@ http://wtfutil.com/posts/ - 2018-05-09T11:13:11-07:00 + 2018-05-09T11:44:13-07:00 0 @@ -65,7 +70,7 @@ http://wtfutil.com/ - 2018-05-09T11:13:11-07:00 + 2018-05-09T11:44:13-07:00 0 diff --git a/docs/tags/index.html b/docs/tags/index.html index 40db67b3..9fe699e8 100644 --- a/docs/tags/index.html +++ b/docs/tags/index.html @@ -70,7 +70,7 @@ - + diff --git a/textfile/widget.go b/textfile/widget.go index b0762442..ed86e27e 100644 --- a/textfile/widget.go +++ b/textfile/widget.go @@ -16,7 +16,7 @@ var Config *config.Config const helpText = ` Keyboard commands for Textfile: - h: Show/hide this help window + /: Show/hide this help window o: Open the text file in the operating system ` @@ -70,7 +70,7 @@ func (widget *Widget) Refresh() { func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey { switch string(event.Rune()) { - case "h": + case "/": widget.showHelp() return nil case "o": diff --git a/todo/widget.go b/todo/widget.go index ce0e3f45..835276ad 100644 --- a/todo/widget.go +++ b/todo/widget.go @@ -18,7 +18,7 @@ var Config *config.Config const helpText = ` Keyboard commands for Todo: - h: Show/hide this help window + /: Show/hide this help window j: Select the next item in the list k: Select the previous item in the list n: Create a new list item @@ -110,7 +110,7 @@ func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey { widget.persist() widget.display() return nil - case "h": + case "/": widget.showHelp() return nil case "j": diff --git a/weather/widget.go b/weather/widget.go index b651599e..c0e9bff4 100644 --- a/weather/widget.go +++ b/weather/widget.go @@ -17,10 +17,12 @@ var Config *config.Config const helpText = ` Keyboard commands for Weather: - h: Show/hide this help window + /: Show/hide this help window + h: Previous weather location + l: Next weather location - arrow right: Next weather location arrow left: Previous weather location + arrow right: Next weather location ` // Widget is the container for weather data. @@ -214,9 +216,15 @@ func (widget *Widget) icon(data *owm.CurrentWeatherData) string { func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey { switch string(event.Rune()) { - case "h": + case "/": widget.showHelp() return nil + case "h": + widget.Prev() + return nil + case "l": + widget.Next() + return nil } switch event.Key() { diff --git a/wtf/billboard_modal.go b/wtf/billboard_modal.go index d8128b04..552ffb21 100644 --- a/wtf/billboard_modal.go +++ b/wtf/billboard_modal.go @@ -12,7 +12,7 @@ const modalHeight = 22 func NewBillboardModal(text string, closeFunc func()) *tview.Frame { keyboardIntercept := func(event *tcell.EventKey) *tcell.EventKey { switch string(event.Rune()) { - case "h": + case "/": closeFunc() return nil }