diff --git a/docs/Basics/Configuration-settings.md b/docs/Basics/Configuration-settings.md index 01a575e..6dc3854 100644 --- a/docs/Basics/Configuration-settings.md +++ b/docs/Basics/Configuration-settings.md @@ -98,7 +98,7 @@ The file storage root path (requires permissions 0777) The length of the PKCE challenge verifier (43-128 characters) -**See also:** +**Links:** - [datatracker.ietf.org/doc/html/rfc7636#section-4.1](https://datatracker.ietf.org/doc/html/rfc7636#section-4.1) diff --git a/docs/Development/Create-provider.md b/docs/Development/Create-provider.md index cf50831..0a7d655 100644 --- a/docs/Development/Create-provider.md +++ b/docs/Development/Create-provider.md @@ -92,7 +92,7 @@ class Mastodon extends OAuth2Provider{ ## Informational values In order to automatically create the fancy table under [supported providers](../Basics/Overview.md#supported-providers), -a provider class can implement the following informational properties (that can be accessed via magic `__get()`): +a provider class can implement the following informational properties: - `$apiDocs` - a link to the API documentation for this service - `$applicationURL` - links to the OAuth application page, where a developer can obtain (or apply for) credentials diff --git a/docs/oauth-options-doc.php b/docs/oauth-options-doc.php index 1036e20..73e30d6 100644 --- a/docs/oauth-options-doc.php +++ b/docs/oauth-options-doc.php @@ -35,7 +35,8 @@ array_shift($lines); array_pop($lines); - $see = []; + $see = []; + $link = []; foreach($lines as $line){ @@ -55,6 +56,13 @@ continue; } + // collect links for "links" + if(str_starts_with($line, '@link')){ + $link[] = $line; + + continue; + } + $content[] = $line; } @@ -88,6 +96,28 @@ } + if(!empty($link)){ + $content[] = "\n**Links:**\n"; + + foreach($link as $line){ + $line = substr($line, 6); // cut off the "@link " + + // skip non-url + if(!str_starts_with($line, 'http')){ + continue; + } + + $url = explode(' ', $line, 2); + + $content[] = match(count($url)){ + 1 => sprintf('- [%s](%s)', explode('://', $url[0])[1], $url[0]), + 2 => sprintf('- [%s](%s)', trim($url[1]), $url[0]), + }; + + } + + } + $content[] = "\n"; }