Skip to content

Commit dffa6d8

Browse files
committed
Updated docusaurus and fixed some links
1 parent 9e34428 commit dffa6d8

File tree

7 files changed

+3396
-2497
lines changed

7 files changed

+3396
-2497
lines changed

SpotifyAPI.Docs/docusaurus.config.js

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,22 @@ module.exports = {
1919
alt: 'SpotifyAPI-NET',
2020
src: 'img/logo.svg',
2121
},
22-
links: [
22+
items: [
2323
{
2424
activeBasePath: 'docs',
2525
label: 'Docs',
2626
position: 'left',
2727
items: [
2828
{
29-
label: 'Latest/Next',
30-
to: 'docs/next/introduction',
29+
label: '6.X (current)',
30+
to: 'docs/introduction',
3131
},
32-
{
33-
label: versions[0],
34-
to: 'docs/home',
35-
},
36-
...versions.slice(1).map((version) => ({
32+
...versions.map((version) => ({
3733
label: version,
3834
to: `docs/${version}/home`,
39-
}))
40-
]
35+
})),
36+
],
4137
},
42-
{ to: 'news', label: 'News', position: 'left' },
4338
{
4439
href: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET',
4540
label: 'GitHub',
@@ -54,25 +49,29 @@ module.exports = {
5449
},
5550
presets: [
5651
[
57-
5852
'@docusaurus/preset-classic',
5953
{
6054
docs: {
6155
sidebarPath: require.resolve('./sidebars.js'),
6256
// Please change this to your repo.
63-
editUrl:
64-
'https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/',
57+
editUrl: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/',
6558
showLastUpdateAuthor: true,
6659
showLastUpdateTime: true,
60+
lastVersion: 'current',
61+
versions: {
62+
current: {
63+
label: '6.X',
64+
path: '',
65+
},
66+
},
6767
},
6868
blog: {
6969
path: 'news',
7070
routeBasePath: 'news',
7171
showReadingTime: true,
7272
feedOptions: undefined,
7373
// Please change this to your repo.
74-
editUrl:
75-
'https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/blog/',
74+
editUrl: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/blog/',
7675
},
7776
theme: {
7877
customCss: require.resolve('./src/css/custom.css'),

SpotifyAPI.Docs/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"start": "docusaurus start",
6+
"start": "docusaurus start --no-open",
77
"build": "docusaurus build",
88
"swizzle": "docusaurus swizzle",
99
"deploy": "docusaurus deploy"
@@ -14,11 +14,11 @@
1414
}
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "^2.0.0-alpha.56",
18-
"@docusaurus/preset-classic": "^2.0.0-alpha.56",
19-
"classnames": "^2.2.6",
20-
"react": "^16.8.4",
21-
"react-dom": "^16.8.4",
17+
"@docusaurus/core": "^2.0.0-alpha.72",
18+
"@docusaurus/preset-classic": "^2.0.0-alpha.72",
19+
"classnames": "^2.3.1",
20+
"react": "^17.0.2",
21+
"react-dom": "^17.0.2",
2222
"react-github-btn": "^1.2.0"
2323
},
2424
"browserslist": {
@@ -35,7 +35,7 @@
3535
},
3636
"devDependencies": {
3737
"import-sort-style-module": "^6.0.0",
38-
"prettier": "^2.0.5",
39-
"prettier-plugin-import-sort": "^0.0.4"
38+
"prettier": "^2.2.1",
39+
"prettier-plugin-import-sort": "^0.0.6"
4040
}
4141
}

SpotifyAPI.Docs/src/pages/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const features = [
6262
description: () => (
6363
<>
6464
<code>SpotifyAPI-NET</code> is built on a modular structure, which allows easy testing through mocks and stubs.
65-
Learn more by visiting the <Link to={useBaseUrl('docs/next/testing')}>Testing Guide</Link>
65+
Learn more by visiting the <Link to={useBaseUrl('docs/unit_testing')}>Testing Guide</Link>
6666
</>
6767
),
6868
},
@@ -124,7 +124,7 @@ function Home() {
124124
<div className={styles.buttons}>
125125
<Link
126126
className={classnames('button button--outline button--secondary button--lg', styles.getStarted)}
127-
to={useBaseUrl('docs/next/introduction')}
127+
to={useBaseUrl('docs/introduction')}
128128
>
129129
Get Started
130130
</Link>

SpotifyAPI.Docs/versioned_docs/version-5.1.1/auth/token_swap.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,18 @@ requests to Spotify, as well as requests that return back to the "server URI".
1111

1212
The exchange server **must** be able to:
1313

14-
* Return the authorization code from Spotify API authenticate page via GET request to the "server URI".
15-
* Request the token response object via POST to the Spotify API token page.
16-
* Request a refreshed token response object via POST to the Spotify API token page.
14+
- Return the authorization code from Spotify API authenticate page via GET request to the "server URI".
15+
- Request the token response object via POST to the Spotify API token page.
16+
- Request a refreshed token response object via POST to the Spotify API token page.
1717

1818
**The good news is that you do not need to code it yourself.**
1919

20-
The advantages of this method are that the client ID and redirect URI are very well hidden and almost unexposed, but more importantly, your client secret is **never** exposed and is completely hidden compared to other methods (excluding [ImplicitGrantAuth](/SpotifyWebAPI/auth#implicitgrantauth)
20+
The advantages of this method are that the client ID and redirect URI are very well hidden and almost unexposed, but more importantly, your client secret is **never** exposed and is completely hidden compared to other methods (excluding [ImplicitGrantAuth](implicit_grant.md)
2121
as it does not deal with a client secret). This means
2222
your Spotify app **cannot** be spoofed by a malicious third party.
2323

2424
## Using TokenSwapWebAPIFactory
25+
2526
The TokenSwapWebAPIFactory will create and configure a SpotifyWebAPI object for you.
2627

2728
It does this through the method GetWebApiAsync **asynchronously**, which means it will not halt execution of your program while obtaining it for you. If you would like to halt execution, which is **synchronous**, use `GetWebApiAsync().Result` without using **await**.
@@ -55,6 +56,7 @@ catch (Exception ex)
5556
```
5657

5758
## Using TokenSwapAuth
59+
5860
Since the TokenSwapWebAPIFactory not only simplifies the whole process but offers additional functionality too
5961
(such as AutoRefresh and AuthSuccess AuthFailure events), use of this way is very verbose and is only
6062
recommended if you are having issues with TokenSwapWebAPIFactory or need access to the tokens.
@@ -84,25 +86,30 @@ auth.OpenBrowser();
8486
```
8587

8688
## Token Swap Endpoint
89+
8790
To keep your client secret completely secure and your client ID and redirect URI as secure as possible, use of a web server (such as a php website) is required.
8891

8992
To use this method, an external HTTP Server (that you may need to create) needs to be able to supply the following HTTP Endpoints to your application:
9093

9194
`/swap` - Swaps out an `authorization_code` with an `access_token` and `refresh_token` - The following parameters are required in the JSON POST Body:
95+
9296
- `grant_type` (set to `"authorization_code"`)
9397
- `code` (the `authorization_code`)
9498
- `redirect_uri`
9599
- - **Important** The page that the redirect URI links to must return the authorization code json to your `serverUri` (default is 'http://localhost:4002') but to the folder 'auth', like this: 'http://localhost:4002/auth'.
96100

97101
`/refresh` - Refreshes an `access_token` - The following parameters are required in the JSON POST Body:
102+
98103
- `grant_type` (set to `"refresh_token"`)
99104
- `refresh_token`
100105

101106
The following open-source token swap endpoint code can be used for your website:
107+
102108
- [rollersteaam/spotify-token-swap-php](https://github.com/rollersteaam/spotify-token-swap-php)
103109
- [simontaen/SpotifyTokenSwap](https://github.com/simontaen/SpotifyTokenSwap)
104110

105111
## Remarks
112+
106113
It should be noted that GitHub Pages does not support hosting php scripts. Hosting php scripts through it will cause the php to render as plain HTML, potentially compromising your client secret while doing absolutely nothing.
107114

108115
Be sure you have whitelisted your redirect uri in the Spotify Developer Dashboard otherwise the authorization will always fail.

SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/getting_started.md

Lines changed: 78 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ using SpotifyAPI.Web.Models; //Models for the JSON-responses
2323
### Basic-Usage
2424

2525
Now you can actually start doing calls to the SpotifyAPI, just create a new Instance of SpotifyWebAPI:
26+
2627
```csharp
2728
private static SpotifyWebAPI _spotify;
2829

@@ -50,11 +51,12 @@ _spotify = new SpotifyWebAPI()
5051
}
5152
```
5253

53-
For more info, visit the [Getting Started of SpotifyAPI.Web.Auth](/auth/getting_started/)
54-
54+
For more info, visit the [Getting Started of SpotifyAPI.Web.Auth](auth/getting_started.md)
5555

5656
## Error-Handling
57+
5758
Every API-Call returns a reponse-model which consists of base-error model. To check if a specific API-Call was successful, use the following approach:
59+
5860
```csharp
5961
PrivateProfile profile = _spotify.GetPrivateProfile();
6062
if (profile.HasError())
@@ -67,6 +69,7 @@ if (profile.HasError())
6769
In case some or all of the returned values are null, consult error status and message, they can lead to an explanation!
6870

6971
## Sync vs Asynchronous
72+
7073
Every API-Call has an `asynchronous` and `synchronous` method.
7174

7275
```csharp
@@ -82,88 +85,99 @@ Note that the `synchronous` call will block the current Thread!
8285
## API-Reference
8386

8487
### Albums
85-
* [GetAlbumTracks](/web/albums.md#getalbumtracks)
86-
* [GetAlbum](/web/albums.md#getalbum)
87-
* [GetSeveralAlbums](/web/albums.md#getseveralalbums)
88+
89+
- [GetAlbumTracks](/web/albums.md#getalbumtracks)
90+
- [GetAlbum](/web/albums.md#getalbum)
91+
- [GetSeveralAlbums](/web/albums.md#getseveralalbums)
8892

8993
### Artists
90-
* [GetArtist](/web/artists.md#getartist)
91-
* [GetRelatedArtists](/web/artists.md#getrelatedartists)
92-
* [GetArtistsTopTracks](/web/artists.md#getartiststoptracks)
93-
* [GetArtistsAlbums](/web/artists.md#getartistsalbums)
94-
* [GetSeveralArtists](/web/artists.md#getseveralartists)
94+
95+
- [GetArtist](/web/artists.md#getartist)
96+
- [GetRelatedArtists](/web/artists.md#getrelatedartists)
97+
- [GetArtistsTopTracks](/web/artists.md#getartiststoptracks)
98+
- [GetArtistsAlbums](/web/artists.md#getartistsalbums)
99+
- [GetSeveralArtists](/web/artists.md#getseveralartists)
95100

96101
### Browse
97-
* [GetFeaturedPlaylists](/web/browse.md#getfeaturedplaylists)
98-
* [GetNewAlbumReleases](/web/browse.md#getnewalbumreleases)
99-
* [GetCategories](/web/browse.md#getcategories)
100-
* [GetCategory](/web/browse.md#getcategory)
101-
* [GetCategoryPlaylists](/web/browse.md#getcategoryplaylists)
102+
103+
- [GetFeaturedPlaylists](/web/browse.md#getfeaturedplaylists)
104+
- [GetNewAlbumReleases](/web/browse.md#getnewalbumreleases)
105+
- [GetCategories](/web/browse.md#getcategories)
106+
- [GetCategory](/web/browse.md#getcategory)
107+
- [GetCategoryPlaylists](/web/browse.md#getcategoryplaylists)
102108

103109
### Follow
104-
* [Follow](/web/follow.md#follow)
105-
* [Unfollow](/web/follow.md#unfollow)
106-
* [IsFollowing](/web/follow.md#isfollowing)
107-
* [FollowPlaylist](/web/follow.md#followplaylist)
108-
* [UnfollowPlaylist](/web/follow.md#unfollowplaylist)
109-
* [IsFollowingPlaylist](/web/follow.md#isfollowingplaylist)
110+
111+
- [Follow](/web/follow.md#follow)
112+
- [Unfollow](/web/follow.md#unfollow)
113+
- [IsFollowing](/web/follow.md#isfollowing)
114+
- [FollowPlaylist](/web/follow.md#followplaylist)
115+
- [UnfollowPlaylist](/web/follow.md#unfollowplaylist)
116+
- [IsFollowingPlaylist](/web/follow.md#isfollowingplaylist)
110117

111118
### Library
112-
* [SaveTracks](/web/library.md#savetracks)
113-
* [SaveTrack](/web/library.md#savetrack)
114-
* [GetSavedTracks](/web/library.md#getsavedtracks)
115-
* [RemoveSavedTracks](/web/library.md#removesavedtracks)
116-
* [CheckSavedTracks](/web/library.md#checksavedtracks)
117-
* [SaveAlbums](/web/library.md#savealbums)
118-
* [SaveAlbum](/web/library.md#savealbum)
119-
* [GetSavedAlbums](/web/library.md#getsavedalbums)
120-
* [RemoveSavedAlbums](/web/library.md#removesavedalbums)
121-
* [CheckSavedAlbums](/web/library.md#checksavedalbums)
119+
120+
- [SaveTracks](/web/library.md#savetracks)
121+
- [SaveTrack](/web/library.md#savetrack)
122+
- [GetSavedTracks](/web/library.md#getsavedtracks)
123+
- [RemoveSavedTracks](/web/library.md#removesavedtracks)
124+
- [CheckSavedTracks](/web/library.md#checksavedtracks)
125+
- [SaveAlbums](/web/library.md#savealbums)
126+
- [SaveAlbum](/web/library.md#savealbum)
127+
- [GetSavedAlbums](/web/library.md#getsavedalbums)
128+
- [RemoveSavedAlbums](/web/library.md#removesavedalbums)
129+
- [CheckSavedAlbums](/web/library.md#checksavedalbums)
122130

123131
### Personalization
124-
* [GetUsersTopTracks](/web/personalization.md#getuserstoptracks)
125-
* [GetUsersTopArtists](/web/personalization.md#getuserstopartists)
126-
* [GetUsersRecentlyPlayedTracks](/web/personalization.md#getusersrecentlyplayedtracks)
132+
133+
- [GetUsersTopTracks](/web/personalization.md#getuserstoptracks)
134+
- [GetUsersTopArtists](/web/personalization.md#getuserstopartists)
135+
- [GetUsersRecentlyPlayedTracks](/web/personalization.md#getusersrecentlyplayedtracks)
127136

128137
### Player
129138

130-
* [GetDevices](/web/player.md#getdevices)
131-
* [GetPlayback](/web/player.md#getplayback)
132-
* [GetPlayingTrack](/web/player.md#getplayingtrack)
133-
* [TransferPlayback](/web/player.md#transferplayback)
134-
* [ResumePlayback](/web/player.md#resumeplayback)
135-
* [PausePlayback](/web/player.md#pauseplayback)
136-
* [SkipPlaybackToNext](/web/player.md#skipplaybacktonext)
137-
* [SkipPlaybackToPrevious](/web/player.md#skipplaybacktoprevious)
138-
* [SetRepeatMode](/web/player.md#setrepeatmode)
139-
* [SetVolume](/web/player.md#setvolume)
140-
* [SetShuffle](/web/player.md#setshuffle)
139+
- [GetDevices](/web/player.md#getdevices)
140+
- [GetPlayback](/web/player.md#getplayback)
141+
- [GetPlayingTrack](/web/player.md#getplayingtrack)
142+
- [TransferPlayback](/web/player.md#transferplayback)
143+
- [ResumePlayback](/web/player.md#resumeplayback)
144+
- [PausePlayback](/web/player.md#pauseplayback)
145+
- [SkipPlaybackToNext](/web/player.md#skipplaybacktonext)
146+
- [SkipPlaybackToPrevious](/web/player.md#skipplaybacktoprevious)
147+
- [SetRepeatMode](/web/player.md#setrepeatmode)
148+
- [SetVolume](/web/player.md#setvolume)
149+
- [SetShuffle](/web/player.md#setshuffle)
141150

142151
### Playlists
143-
* [GetUserPlaylists](/web/playlists.md#getuserplaylists)
144-
* [GetPlaylist](/web/playlists.md#getplaylist)
145-
* [GetPlaylistTracks](/web/playlists.md#getplaylisttracks)
146-
* [CreatePlaylist](/web/playlists.md#createplaylist)
147-
* [UpdatePlaylist](/web/playlists.md#updateplaylist)
148-
* [ReplacePlaylistTracks](/web/playlists.md#replaceplaylisttracks)
149-
* [RemovePlaylistTracks](/web/playlists.md#removeplaylisttracks)
150-
* [RemovePlaylistTrack](/web/playlists.md#removeplaylisttrack)
151-
* [AddPlaylistTracks](/web/playlists.md#addplaylisttracks)
152-
* [AddPlaylistTrack](/web/playlists.md#addplaylisttrack)
153-
* [ReorderPlaylist](/web/playlists.md#reorderplaylist)
152+
153+
- [GetUserPlaylists](/web/playlists.md#getuserplaylists)
154+
- [GetPlaylist](/web/playlists.md#getplaylist)
155+
- [GetPlaylistTracks](/web/playlists.md#getplaylisttracks)
156+
- [CreatePlaylist](/web/playlists.md#createplaylist)
157+
- [UpdatePlaylist](/web/playlists.md#updateplaylist)
158+
- [ReplacePlaylistTracks](/web/playlists.md#replaceplaylisttracks)
159+
- [RemovePlaylistTracks](/web/playlists.md#removeplaylisttracks)
160+
- [RemovePlaylistTrack](/web/playlists.md#removeplaylisttrack)
161+
- [AddPlaylistTracks](/web/playlists.md#addplaylisttracks)
162+
- [AddPlaylistTrack](/web/playlists.md#addplaylisttrack)
163+
- [ReorderPlaylist](/web/playlists.md#reorderplaylist)
154164

155165
### Profiles
156-
* [GetPublicProfile](/web/profiles.md#getpublicprofile)
157-
* [GetPrivateProfile](/web/profiles.md#getprivateprofile)
166+
167+
- [GetPublicProfile](/web/profiles.md#getpublicprofile)
168+
- [GetPrivateProfile](/web/profiles.md#getprivateprofile)
158169

159170
### Search
160-
* [SearchItems](/web/search.md#searchitems)
161-
* [SearchItemsEscaped](/web/search.md#searchitemsescaped)
171+
172+
- [SearchItems](/web/search.md#searchitems)
173+
- [SearchItemsEscaped](/web/search.md#searchitemsescaped)
162174

163175
### Tracks
164-
* [GetSeveralTracks](/web/tracks.md#getseveraltracks)
165-
* [GetTrack](/web/tracks.md#gettrack)
166-
* [GetAudioAnalysis](/web/tracks.md#getaudioanalysis)
176+
177+
- [GetSeveralTracks](/web/tracks.md#getseveraltracks)
178+
- [GetTrack](/web/tracks.md#gettrack)
179+
- [GetAudioAnalysis](/web/tracks.md#getaudioanalysis)
167180

168181
### Util
169-
* [Utility-Functions](/web/utils.md)
182+
183+
- [Utility-Functions](/web/utilities.md)

SpotifyAPI.Docs/versions.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
[
2-
"5.1.1"
3-
]
1+
["5.1.1"]

0 commit comments

Comments
 (0)