[README] Add syntax highlighting to code blocks

This commit is contained in:
chme 2018-10-25 19:20:49 +02:00
parent 1db083fa69
commit 6da97ab866

View File

@ -37,7 +37,7 @@ JSON-Object model:
**Endpoint** **Endpoint**
``` ```http
GET /api/player GET /api/player
``` ```
@ -57,11 +57,11 @@ GET /api/player
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/player" curl -X GET "http://localhost:3689/api/player"
``` ```
``` ```json
{ {
"state": "pause", "state": "pause",
"repeat": "off", "repeat": "off",
@ -81,15 +81,15 @@ Start or resume, pause, stop playback.
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/play PUT /api/player/play
``` ```
``` ```http
PUT /api/player/pause PUT /api/player/pause
``` ```
``` ```http
PUT /api/player/stop PUT /api/player/stop
``` ```
@ -99,15 +99,15 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/play" curl -X PUT "http://localhost:3689/api/player/play"
``` ```
``` ```shell
curl -X PUT "http://localhost:3689/api/player/pause" curl -X PUT "http://localhost:3689/api/player/pause"
``` ```
``` ```shell
curl -X PUT "http://localhost:3689/api/player/stop" curl -X PUT "http://localhost:3689/api/player/stop"
``` ```
@ -118,11 +118,11 @@ Skip forward or backward
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/next PUT /api/player/next
``` ```
``` ```http
PUT /api/player/prev PUT /api/player/prev
``` ```
@ -132,11 +132,11 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/next" curl -X PUT "http://localhost:3689/api/player/next"
``` ```
``` ```shell
curl -X PUT "http://localhost:3689/api/player/prev" curl -X PUT "http://localhost:3689/api/player/prev"
``` ```
@ -147,7 +147,7 @@ Enable or disable shuffle mode
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/shuffle PUT /api/player/shuffle
``` ```
@ -164,7 +164,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/shuffle?state=true" curl -X PUT "http://localhost:3689/api/player/shuffle?state=true"
``` ```
@ -175,7 +175,7 @@ Enable or disable consume mode
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/consume PUT /api/player/consume
``` ```
@ -192,7 +192,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/consume?state=true" curl -X PUT "http://localhost:3689/api/player/consume?state=true"
``` ```
@ -203,7 +203,7 @@ Change repeat mode
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/repeat PUT /api/player/repeat
``` ```
@ -220,7 +220,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/repeat?state=all" curl -X PUT "http://localhost:3689/api/player/repeat?state=all"
``` ```
@ -231,7 +231,7 @@ Change master volume or volume of a specific output.
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/volume PUT /api/player/volume
``` ```
@ -249,11 +249,11 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/volume?volume=50" curl -X PUT "http://localhost:3689/api/player/volume?volume=50"
``` ```
``` ```shell
curl -X PUT "http://localhost:3689/api/player/volume?volume=50&output_id=0" curl -X PUT "http://localhost:3689/api/player/volume?volume=50&output_id=0"
``` ```
@ -264,7 +264,7 @@ Seek to a position in the currently playing track.
**Endpoint** **Endpoint**
``` ```http
PUT /api/player/seek PUT /api/player/seek
``` ```
@ -281,7 +281,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/player/seek?position_ms=2000" curl -X PUT "http://localhost:3689/api/player/seek?position_ms=2000"
``` ```
@ -302,7 +302,7 @@ curl -X PUT "http://localhost:3689/api/player/seek?position_ms=2000"
**Endpoint** **Endpoint**
``` ```http
GET /api/outputs GET /api/outputs
``` ```
@ -328,11 +328,11 @@ GET /api/outputs
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/outputs" curl -X GET "http://localhost:3689/api/outputs"
``` ```
``` ```json
{ {
"outputs": [ "outputs": [
{ {
@ -376,7 +376,7 @@ with the given ids and disables the remaining outputs.
**Endpoint** **Endpoint**
``` ```http
PUT /api/outputs/set PUT /api/outputs/set
``` ```
@ -392,7 +392,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/outputs/set" --data "{\"outputs\":[\"198018693182577\",\"0\"]}" curl -X PUT "http://localhost:3689/api/outputs/set" --data "{\"outputs\":[\"198018693182577\",\"0\"]}"
``` ```
@ -403,7 +403,7 @@ Get an output
**Endpoint** **Endpoint**
``` ```http
GET /api/outputs/{id} GET /api/outputs/{id}
``` ```
@ -419,11 +419,11 @@ On success returns the HTTP `200 OK` success status response code. With the resp
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/outputs/0" curl -X GET "http://localhost:3689/api/outputs/0"
``` ```
``` ```json
{ {
"id": "0", "id": "0",
"name": "Computer", "name": "Computer",
@ -442,7 +442,7 @@ Enable or disable an output and change its volume.
**Endpoint** **Endpoint**
``` ```http
PUT /api/outputs/{id} PUT /api/outputs/{id}
``` ```
@ -465,7 +465,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/outputs/0" --data "{\"selected\":true, \"volume\": 50}" curl -X PUT "http://localhost:3689/api/outputs/0" --data "{\"selected\":true, \"volume\": 50}"
``` ```
@ -489,7 +489,7 @@ Lists the items in the current queue
**Endpoint** **Endpoint**
``` ```http
GET /api/queue GET /api/queue
``` ```
@ -511,11 +511,11 @@ GET /api/queue
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/queue" curl -X GET "http://localhost:3689/api/queue"
``` ```
``` ```json
{ {
"version": 833, "version": 833,
"count": 20, "count": 20,
@ -553,7 +553,7 @@ Remove all items form the current queue
**Endpoint** **Endpoint**
``` ```http
PUT /api/queue/clear PUT /api/queue/clear
``` ```
@ -563,7 +563,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/queue/clear" curl -X PUT "http://localhost:3689/api/queue/clear"
``` ```
@ -574,7 +574,7 @@ Add tracks, playlists artists or albums to the current queue
**Endpoint** **Endpoint**
``` ```http
POST /api/queue/items/add POST /api/queue/items/add
``` ```
@ -591,7 +591,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X POST "http://localhost:3689/api/queue/items/add?uris=library:playlist:68,library:artist:2932599850102967727" curl -X POST "http://localhost:3689/api/queue/items/add?uris=library:playlist:68,library:artist:2932599850102967727"
``` ```
@ -602,7 +602,7 @@ Move a queue item in the current queue
**Endpoint** **Endpoint**
``` ```http
PUT /api/queue/items/{id} PUT /api/queue/items/{id}
``` ```
@ -624,7 +624,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/queue/items/3?new_position=0" curl -X PUT "http://localhost:3689/api/queue/items/3?new_position=0"
``` ```
@ -635,7 +635,7 @@ Remove a queue item from the current queue
**Endpoint** **Endpoint**
``` ```http
DELETE /api/queue/items/{id} DELETE /api/queue/items/{id}
``` ```
@ -651,7 +651,7 @@ On success returns the HTTP `204 No Content` success status response code.
**Example** **Example**
``` ```shell
curl -X PUT "http://localhost:3689/api/queue/items/2" curl -X PUT "http://localhost:3689/api/queue/items/2"
``` ```
@ -681,7 +681,7 @@ Lists the playlists in your library
**Endpoint** **Endpoint**
``` ```http
GET /api/library/playlists GET /api/library/playlists
``` ```
@ -704,11 +704,11 @@ GET /api/library/playlists
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/playlists" curl -X GET "http://localhost:3689/api/library/playlists"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -733,7 +733,7 @@ Get a specific playlists in your library
**Endpoint** **Endpoint**
``` ```http
GET /api/library/playlists/{id} GET /api/library/playlists/{id}
``` ```
@ -750,11 +750,11 @@ On success returns the HTTP `200 OK` success status response code. With the resp
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/playlists/1" curl -X GET "http://localhost:3689/api/library/playlists/1"
``` ```
``` ```json
{ {
"id": 1, "id": 1,
"name": "radio", "name": "radio",
@ -771,7 +771,7 @@ Lists the tracks in a playlists
**Endpoint** **Endpoint**
``` ```http
GET /api/library/playlists/{id}/tracks GET /api/library/playlists/{id}/tracks
``` ```
@ -800,11 +800,11 @@ GET /api/library/playlists/{id}/tracks
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/playlists/1/tracks" curl -X GET "http://localhost:3689/api/library/playlists/1/tracks"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -844,7 +844,7 @@ Lists the artists in your library
**Endpoint** **Endpoint**
``` ```http
GET /api/library/artists GET /api/library/artists
``` ```
@ -867,11 +867,11 @@ GET /api/library/artists
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/artists" curl -X GET "http://localhost:3689/api/library/artists"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -898,7 +898,7 @@ Get a specific artist in your library
**Endpoint** **Endpoint**
``` ```http
GET /api/library/artists/{id} GET /api/library/artists/{id}
``` ```
@ -915,11 +915,11 @@ On success returns the HTTP `200 OK` success status response code. With the resp
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/artists/3815427709949443149" curl -X GET "http://localhost:3689/api/library/artists/3815427709949443149"
``` ```
``` ```json
{ {
"id": "3815427709949443149", "id": "3815427709949443149",
"name": "ABAY", "name": "ABAY",
@ -938,7 +938,7 @@ Lists the albums of an artist
**Endpoint** **Endpoint**
``` ```http
GET /api/library/artists/{id}/albums GET /api/library/artists/{id}/albums
``` ```
@ -967,11 +967,11 @@ GET /api/library/artists/{id}/albums
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/artists/32561671101664759/albums" curl -X GET "http://localhost:3689/api/library/artists/32561671101664759/albums"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -999,7 +999,7 @@ Lists the albums in your library
**Endpoint** **Endpoint**
``` ```http
GET /api/library/albums GET /api/library/albums
``` ```
@ -1022,11 +1022,11 @@ GET /api/library/albums
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/albums" curl -X GET "http://localhost:3689/api/library/albums"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -1054,7 +1054,7 @@ Get a specific album in your library
**Endpoint** **Endpoint**
``` ```http
GET /api/library/albums/{id} GET /api/library/albums/{id}
``` ```
@ -1071,11 +1071,11 @@ On success returns the HTTP `200 OK` success status response code. With the resp
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/albums/8009851123233197743" curl -X GET "http://localhost:3689/api/library/albums/8009851123233197743"
``` ```
``` ```json
{ {
"id": "8009851123233197743", "id": "8009851123233197743",
"name": "Add Violence", "name": "Add Violence",
@ -1095,7 +1095,7 @@ Lists the tracks in an album
**Endpoint** **Endpoint**
``` ```http
GET /api/library/albums/{id}/tracks GET /api/library/albums/{id}/tracks
``` ```
@ -1124,11 +1124,11 @@ GET /api/library/albums/{id}/tracks
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/albums/1/tracks" curl -X GET "http://localhost:3689/api/library/albums/1/tracks"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -1167,7 +1167,7 @@ Get list of genres
**Endpoint** **Endpoint**
``` ```http
GET /api/library/genres GET /api/library/genres
``` ```
**Response** **Response**
@ -1182,11 +1182,11 @@ GET /api/library/genres
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/genres" curl -X GET "http://localhost:3689/api/library/genres"
``` ```
``` ```json
{ {
"items": [ "items": [
{ {
@ -1218,7 +1218,7 @@ Lists the albums in a genre
**Endpoint** **Endpoint**
``` ```http
GET api/search?type=albums&expression=genre+is+\"{genre name}\"" GET api/search?type=albums&expression=genre+is+\"{genre name}\""
``` ```
@ -1242,14 +1242,14 @@ GET api/search?type=albums&expression=genre+is+\"{genre name}\""
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Pop\"" curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Pop\""
curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Rock%2FPop\"" # Rock/Pop curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Rock%2FPop\"" # Rock/Pop
curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Drum%20%26%20Bass\"" # Drum & Bass curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"Drum%20%26%20Bass\"" # Drum & Bass
curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"%2790s%20Alternative\"" # '90 Alternative curl -X GET "http://localhost:3689/api/search?type=albums&expression=genre+is+\"%2790s%20Alternative\"" # '90 Alternative
``` ```
``` ```json
{ {
"albums": { "albums": {
"items": [ "items": [
@ -1297,7 +1297,7 @@ Get information about the number of tracks, artists and albums and the total pla
**Endpoint** **Endpoint**
``` ```http
GET /api/library/count GET /api/library/count
``` ```
@ -1319,11 +1319,11 @@ GET /api/library/count
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/library/count?expression=data_kind+is+file" curl -X GET "http://localhost:3689/api/library/count?expression=data_kind+is+file"
``` ```
``` ```json
{ {
"tracks": 6811, "tracks": 6811,
"artists": 355, "artists": 355,
@ -1349,7 +1349,7 @@ Search for playlists, artists, albums, tracks, genres that include the given que
**Endpoint** **Endpoint**
``` ```http
GET /api/search GET /api/search
``` ```
@ -1377,11 +1377,11 @@ GET /api/search
Search for all tracks, artists, albums and playlists that contain "the" in their title and return the first two results for each type: Search for all tracks, artists, albums and playlists that contain "the" in their title and return the first two results for each type:
``` ```shell
curl -X GET "http://localhost:3689/api/search?type=tracks,artists,albums,playlists&query=the&offset=0&limit=2" curl -X GET "http://localhost:3689/api/search?type=tracks,artists,albums,playlists&query=the&offset=0&limit=2"
``` ```
``` ```json
{ {
"tracks": { "tracks": {
"items": [ "items": [
@ -1492,7 +1492,7 @@ Search for artists, albums, tracks by a smart playlist query expression (see [RE
**Endpoint** **Endpoint**
``` ```http
GET /api/search GET /api/search
``` ```
@ -1518,7 +1518,7 @@ GET /api/search
Search for music tracks ordered descending by the time added to the library and limit result to 2 items: Search for music tracks ordered descending by the time added to the library and limit result to 2 items:
``` ```shell
curl -X GET "http://localhost:3689/api/search?type=tracks&expression=media_kind+is+music+order+by+time_added+desc&offset=0&limit=2" curl -X GET "http://localhost:3689/api/search?type=tracks&expression=media_kind+is+music+order+by+time_added+desc&offset=0&limit=2"
``` ```
@ -1535,7 +1535,7 @@ curl -X GET "http://localhost:3689/api/search?type=tracks&expression=media_kind+
**Endpoint** **Endpoint**
``` ```http
GET /api/config GET /api/config
``` ```
@ -1550,11 +1550,11 @@ GET /api/config
**Example** **Example**
``` ```shell
curl -X GET "http://localhost:3689/api/config" curl -X GET "http://localhost:3689/api/config"
``` ```
``` ```json
{ {
"websocket_port": 3688, "websocket_port": 3688,
"version": "25.0", "version": "25.0",
@ -1598,7 +1598,7 @@ will send a message each time one of the events occurred.
**Example** **Example**
``` ```shell
curl --include \ curl --include \
--no-buffer \ --no-buffer \
--header "Connection: Upgrade" \ --header "Connection: Upgrade" \
@ -1612,7 +1612,7 @@ curl --include \
--data "{ \"notify\": [ \"player\" ] }" --data "{ \"notify\": [ \"player\" ] }"
``` ```
``` ```json
{ {
"notify": [ "notify": [
"player" "player"