(docs): enabled syntax highlighting
... for better readability
This commit is contained in:
parent
0262b817e9
commit
764c2f71eb
1 changed files with 77 additions and 70 deletions
37
README.md
37
README.md
|
|
@ -208,7 +208,7 @@ both of them support all necessary emoji glyphs.
|
||||||
|
|
||||||
Font configuration:
|
Font configuration:
|
||||||
|
|
||||||
```
|
```xml
|
||||||
$ cat ~/.config/fontconfig/fonts.conf
|
$ cat ~/.config/fontconfig/fonts.conf
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
|
||||||
|
|
@ -301,8 +301,8 @@ To fetch information in JSON format, use the following syntax:
|
||||||
This will fetch information on the Detroit region in JSON format. The j1 format code is used to allow for the use of other layouts for the JSON output.
|
This will fetch information on the Detroit region in JSON format. The j1 format code is used to allow for the use of other layouts for the JSON output.
|
||||||
|
|
||||||
The result will look something like the following:
|
The result will look something like the following:
|
||||||
|
```json
|
||||||
{
|
{
|
||||||
"current_condition": [
|
"current_condition": [
|
||||||
{
|
{
|
||||||
"FeelsLikeC": "25",
|
"FeelsLikeC": "25",
|
||||||
|
|
@ -333,7 +333,8 @@ The result will look something like the following:
|
||||||
"windspeedMiles": "4"
|
"windspeedMiles": "4"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
...
|
...
|
||||||
|
```
|
||||||
|
|
||||||
Most of these values are self-explanatory, aside from `weatherCode`. The `weatherCode` is an enumeration which you can find at either [the WorldWeatherOnline website](https://www.worldweatheronline.com/developer/api/docs/weather-icons.aspx) or [in the wttr.in source code](https://github.com/chubin/wttr.in/blob/master/lib/constants.py).
|
Most of these values are self-explanatory, aside from `weatherCode`. The `weatherCode` is an enumeration which you can find at either [the WorldWeatherOnline website](https://www.worldweatheronline.com/developer/api/docs/weather-icons.aspx) or [in the wttr.in source code](https://github.com/chubin/wttr.in/blob/master/lib/constants.py).
|
||||||
|
|
||||||
|
|
@ -349,7 +350,7 @@ This will fetch information on the Detroit region in Prometheus Metrics format.
|
||||||
|
|
||||||
A possible configuration for Prometheus could look like this:
|
A possible configuration for Prometheus could look like this:
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
- job_name: 'wttr_in_detroit'
|
- job_name: 'wttr_in_detroit'
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ['wttr.in']
|
- targets: ['wttr.in']
|
||||||
|
|
@ -535,14 +536,16 @@ WWO key file: `~/.wwo.key`
|
||||||
|
|
||||||
Also, you have to specify the key in the `wego` configuration:
|
Also, you have to specify the key in the `wego` configuration:
|
||||||
|
|
||||||
$ cat ~/.wegorc
|
```json
|
||||||
{
|
$ cat ~/.wegorc
|
||||||
|
{
|
||||||
"APIKey": "00XXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
"APIKey": "00XXXXXXXXXXXXXXXXXXXXXXXXXXX",
|
||||||
"City": "London",
|
"City": "London",
|
||||||
"Numdays": 3,
|
"Numdays": 3,
|
||||||
"Imperial": false,
|
"Imperial": false,
|
||||||
"Lang": "en"
|
"Lang": "en"
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
The `City` parameter in `~/.wegorc` is ignored.
|
The `City` parameter in `~/.wegorc` is ignored.
|
||||||
|
|
||||||
|
|
@ -551,18 +554,21 @@ The `City` parameter in `~/.wegorc` is ignored.
|
||||||
Configure the following environment variables that define the path to the local `wttr.in`
|
Configure the following environment variables that define the path to the local `wttr.in`
|
||||||
installation, to the GeoLite database, and to the `wego` installation. For example:
|
installation, to the GeoLite database, and to the `wego` installation. For example:
|
||||||
|
|
||||||
export WTTR_MYDIR="/home/igor/wttr.in"
|
```bash
|
||||||
export WTTR_GEOLITE="/home/igor/wttr.in/GeoLite2-City.mmdb"
|
export WTTR_MYDIR="/home/igor/wttr.in"
|
||||||
export WTTR_WEGO="/home/igor/go/bin/wego"
|
export WTTR_GEOLITE="/home/igor/wttr.in/GeoLite2-City.mmdb"
|
||||||
export WTTR_LISTEN_HOST="0.0.0.0"
|
export WTTR_WEGO="/home/igor/go/bin/wego"
|
||||||
export WTTR_LISTEN_PORT="8002"
|
export WTTR_LISTEN_HOST="0.0.0.0"
|
||||||
|
export WTTR_LISTEN_PORT="8002"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Configure the HTTP-frontend service
|
### Configure the HTTP-frontend service
|
||||||
|
|
||||||
It's recommended that you also configure the web server that will be used to access the service:
|
It's recommended that you also configure the web server that will be used to access the service:
|
||||||
|
|
||||||
server {
|
```nginx
|
||||||
|
server {
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
server_name wttr.in *.wttr.in;
|
server_name wttr.in *.wttr.in;
|
||||||
access_log /var/log/nginx/wttr.in-access.log main;
|
access_log /var/log/nginx/wttr.in-access.log main;
|
||||||
|
|
@ -589,4 +595,5 @@ It's recommended that you also configure the web server that will be used to acc
|
||||||
|
|
||||||
expires off;
|
expires off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue