-
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from cmfcmf/docs
Add real Documentation using Docusaurus
- Loading branch information
Showing
26 changed files
with
10,376 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/docs export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
- name: Use Node.js 10.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10.x | ||
- name: Build Docs | ||
run: | | ||
cd docs | ||
yarn install | ||
yarn build | ||
- name: Upload to GitHub Pages | ||
if: github.ref == 'refs/heads/master' | ||
uses: peaceiris/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_PAT }} | ||
PUBLISH_BRANCH: gh-pages | ||
PUBLISH_DIR: ./docs/build | ||
with: | ||
emptyCommits: false | ||
keepFiles: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
``` | ||
$ yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
``` | ||
$ yarn start | ||
``` | ||
|
||
This command starts a local development server and open up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
``` | ||
$ yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
``` | ||
$ GIT_USER=<Your GitHub username> USE_SSH=true yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: API Key | ||
--- | ||
|
||
All requests require a free API key (sometimes called "APPID") from OpenWeaterMap. | ||
To retrieve your API key, [sign up for an OpenWeatherMap account](https://home.openweathermap.org/users/sign_up). | ||
|
||
After you received your API key, **it might take a ["couple of hours"](https://openweathermap.org/appid) for it to be activated! Other users [reported](https://github.com/cmfcmf/OpenWeatherMap-PHP-API/issues/46) that it took about 10 minutes** until the API key worked. | ||
|
||
Please also take note of the license OpenWeatherMap provides the data under. At the time of | ||
writing, all data is licensed under the **CC BY-SA 4.0**, even for paid accounts. However, | ||
remember that this project is not affiliated with OpenWeatherMap, this information may be | ||
outdated and I can't give you legal advice. Make sure to check on the terms and conditions | ||
yourself: | ||
|
||
- https://openweathermap.org/terms | ||
- https://openweathermap.org/price | ||
|
||
*If something with your API key or account does not work as expected, | ||
please [contact OpenWeatherMap directly](https://openweathermap.force.com/s/contactsupport) | ||
instead of opening an issue, since I most likely cannot help you with your account.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
--- | ||
title: Air Pollution API | ||
sidebar_label: 'API: Air Pollution' | ||
--- | ||
|
||
This API allows you to retrieve the current, forecast and historic ultraviolet index (UV index). | ||
|
||
> Corresponding OpenWeatherMap documentation: | ||
> | ||
> - [Carbon Monoxide (CO)](https://openweathermap.org/api/pollution/co) | ||
> - [Ozone (O3)](https://openweathermap.org/api/pollution/o3) | ||
> - [Nitrogen Dioxide (NO2)](https://openweathermap.org/api/pollution/no2) | ||
> - [Sulfor Dioxide (SO2)](https://openweathermap.org/api/pollution/so2) | ||
## Usage | ||
|
||
- `$type`: Can be one of `"O3"`, `"NO2"`, `"SO2"`, or `"CO"`. | ||
- `$lat` / `$lng`: Latitude and longitude must be provided as strings, because | ||
the number of digits after the decimal point determines the search radius. | ||
Specifying more digits leads to closer results, but too many digits can lead | ||
to no result at all. | ||
- `$date`: Date to retrieve data from. `"current"` requests the newest available | ||
information. You can also specify a date in ISO 8601 format. More information on | ||
that can be found [in the OpenWeatherMap documentation](https://openweathermap.org/api/pollution/co). | ||
|
||
```php | ||
// $type = | ||
$co = $owm->getAirPollution($type, $lat, $lng, $date = "current"); | ||
``` | ||
|
||
The return value depends on the `$type` and is discussed in the next sections. | ||
|
||
### Carbon Monoxide (CO) | ||
|
||
```php | ||
$co = $owm->getAirPollution("CO", "52", "13"); | ||
if ($co === null) { | ||
// No data available | ||
} else { | ||
foreach ($co->values as $data) { | ||
echo $data["value"]; | ||
echo $data["value"]->getPrecision(); | ||
echo $data["pressure"]; | ||
} | ||
} | ||
``` | ||
|
||
### Ozone (O3) | ||
|
||
```php | ||
$o3 = $owm->getAirPollution("O3", "52", "13"); | ||
if ($o3 === null) { | ||
// No data available | ||
} else { | ||
echo $o3->value; | ||
} | ||
``` | ||
|
||
### Nitrogen Dioxide (NO2) | ||
|
||
```php | ||
$no2 = $owm->getAirPollution("NO2", "52", "13"); | ||
if ($no2 === null) { | ||
// No data available | ||
} else { | ||
echo $no2->value; | ||
echo $no2->valueStratosphere; | ||
echo $no2->valueTroposphere; | ||
} | ||
``` | ||
|
||
### Sulfor Dioxide (SO2) | ||
|
||
```php | ||
$so2 = $owm->getAirPollution("SO2", "52", "13"); | ||
if ($so2 === null) { | ||
// No data available | ||
} else { | ||
foreach ($so2->values as $data) { | ||
echo $data["value"]; | ||
echo $data["value"]->getPrecision(); | ||
echo $data["pressure"]; | ||
} | ||
} | ||
``` |
Oops, something went wrong.