Skip to content

Commit

Permalink
📖
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed May 18, 2024
1 parent f01e147 commit 068058c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/Basics/Configuration-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

2 changes: 1 addition & 1 deletion docs/Development/Create-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 31 additions & 1 deletion docs/oauth-options-doc.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
array_shift($lines);
array_pop($lines);

$see = [];
$see = [];
$link = [];

foreach($lines as $line){

Expand All @@ -55,6 +56,13 @@
continue;
}

// collect links for "links"
if(str_starts_with($line, '@link')){
$link[] = $line;

continue;
}

$content[] = $line;
}

Expand Down Expand Up @@ -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";
}

Expand Down

0 comments on commit 068058c

Please sign in to comment.