Fix docs : Replace relative links to files with full URL (#4059)

This commit is contained in:
sysadminstory 2024-04-04 19:28:56 +02:00 committed by GitHub
parent 001dd47439
commit 3ff2ef94e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,6 +8,8 @@ $this->getInput('your input name here');
`getInput` will either return the value for your parameter `getInput` will either return the value for your parameter
or `null` if the parameter is unknown or not specified. or `null` if the parameter is unknown or not specified.
[Defined in lib/BridgeAbstract.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/BridgeAbstract.php)
# getKey # getKey
The `getKey` function is used to receive the key name to a selected list The `getKey` function is used to receive the key name to a selected list
value given the name of the list, specified in `const PARAMETERS` value given the name of the list, specified in `const PARAMETERS`
@ -39,6 +41,8 @@ $this->getKey('country');
`getKey` will either return the key name for your parameter or `null` if the parameter `getKey` will either return the key name for your parameter or `null` if the parameter
is unknown or not specified. is unknown or not specified.
[Defined in lib/BridgeAbstract.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/BridgeAbstract.php)
# getContents # getContents
The `getContents` function uses [cURL](https://secure.php.net/manual/en/book.curl.php) to acquire data from the specified URI while respecting the various settings defined at a global level by RSS-Bridge (i.e., proxy host, user agent, etc.). This function accepts a few parameters: The `getContents` function uses [cURL](https://secure.php.net/manual/en/book.curl.php) to acquire data from the specified URI while respecting the various settings defined at a global level by RSS-Bridge (i.e., proxy host, user agent, etc.). This function accepts a few parameters:
@ -55,6 +59,8 @@ $opts = array(CURLOPT_POST => 1);
$html = getContents($url, $header, $opts); $html = getContents($url, $header, $opts);
``` ```
[Defined in lib/contents.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/contents.php)
# getSimpleHTMLDOM # getSimpleHTMLDOM
The `getSimpleHTMLDOM` function is a wrapper for the The `getSimpleHTMLDOM` function is a wrapper for the
[simple_html_dom](https://simplehtmldom.sourceforge.io/) [file_get_html](https://simplehtmldom.sourceforge.io/docs/1.9/api/file_get_html/) function in order to provide context by design. [simple_html_dom](https://simplehtmldom.sourceforge.io/) [file_get_html](https://simplehtmldom.sourceforge.io/docs/1.9/api/file_get_html/) function in order to provide context by design.
@ -62,6 +68,9 @@ The `getSimpleHTMLDOM` function is a wrapper for the
```PHP ```PHP
$html = getSimpleHTMLDOM('your URI'); $html = getSimpleHTMLDOM('your URI');
``` ```
[Defined in lib/contents.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/contents.php)
# getSimpleHTMLDOMCached # getSimpleHTMLDOMCached
The `getSimpleHTMLDOMCached` function does the same as the The `getSimpleHTMLDOMCached` function does the same as the
[`getSimpleHTMLDOM`](#getsimplehtmldom) function, [`getSimpleHTMLDOM`](#getsimplehtmldom) function,
@ -76,6 +85,8 @@ This function allows to specify the cache duration with the second parameter.
$html = getSimpleHTMLDOMCached('your URI', 86400); // Duration 24h $html = getSimpleHTMLDOMCached('your URI', 86400); // Duration 24h
``` ```
[Defined in lib/contents.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/contents.php)
# returnClientError # returnClientError
The `returnClientError` function aborts execution of the current bridge The `returnClientError` function aborts execution of the current bridge
and returns the given error message with error code **400**: and returns the given error message with error code **400**:
@ -86,6 +97,8 @@ returnClientError('Your error message')
Use this function when the user provided invalid parameter or a required parameter is missing. Use this function when the user provided invalid parameter or a required parameter is missing.
[Defined in lib/utils.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/utils.php)
# returnServerError # returnServerError
The `returnServerError` function aborts execution of the current bridge and returns the given error message with error code **500**: The `returnServerError` function aborts execution of the current bridge and returns the given error message with error code **500**:
@ -96,6 +109,8 @@ returnServerError('Your error message')
Use this function when a problem occurs that has nothing to do with the parameters provided by the user. Use this function when a problem occurs that has nothing to do with the parameters provided by the user.
(like: Host service gone missing, empty data received, etc...) (like: Host service gone missing, empty data received, etc...)
[Defined in lib/utils.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/utils.php)
# defaultLinkTo # defaultLinkTo
Automatically replaces any relative URL in a given string or DOM object Automatically replaces any relative URL in a given string or DOM object
(i.e. the one returned by [getSimpleHTMLDOM](#getsimplehtmldom)) with an absolute URL. (i.e. the one returned by [getSimpleHTMLDOM](#getsimplehtmldom)) with an absolute URL.
@ -122,6 +137,8 @@ $html = defaultLinkTo($html, $this->getURI()); // Using bridge URL
// <img src="https://www.github.com/rss-bridge/rss-bridge/blob/master/README.md"> // <img src="https://www.github.com/rss-bridge/rss-bridge/blob/master/README.md">
``` ```
[Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# backgroundToImg # backgroundToImg
Replaces tags with styles of `backgroud-image` by `<img />` tags. Replaces tags with styles of `backgroud-image` by `<img />` tags.
@ -131,6 +148,8 @@ backgroundToImg(mixed $htmlContent) : object
Returns a DOM object (even if provided a string). Returns a DOM object (even if provided a string).
[Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# extractFromDelimiters # extractFromDelimiters
Extract the first part of a string matching the specified start and end delimiters. Extract the first part of a string matching the specified start and end delimiters.
```php ```php
@ -151,6 +170,8 @@ $extracted = extractFromDelimiters($string, $start, $end);
// 'John Doe' // 'John Doe'
``` ```
[Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# stripWithDelimiters # stripWithDelimiters
Remove one or more part(s) of a string using a start and end delimiter. Remove one or more part(s) of a string using a start and end delimiter.
It is the inverse of `extractFromDelimiters`. It is the inverse of `extractFromDelimiters`.
@ -173,6 +194,8 @@ $cleaned = stripWithDelimiters($string, $start, $end);
// 'foobar' // 'foobar'
``` ```
[Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# stripRecursiveHTMLSection # stripRecursiveHTMLSection
Remove HTML sections containing one or more sections using the same HTML tag. Remove HTML sections containing one or more sections using the same HTML tag.
@ -192,6 +215,8 @@ $cleaned = stripRecursiveHTMLSection($string, $tag_name, $tag_start);
// 'foobar' // 'foobar'
``` ```
[Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# markdownToHtml # markdownToHtml
Converts markdown input to HTML using [Parsedown](https://parsedown.org/). Converts markdown input to HTML using [Parsedown](https://parsedown.org/).
@ -234,6 +259,7 @@ $html = markdownToHtml($input);
// </ul> // </ul>
``` ```
[Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# e # e
The `e` function is used to convert special characters to HTML entities The `e` function is used to convert special characters to HTML entities
@ -244,7 +270,7 @@ e('0 < 1 and 2 > 1');
`e` will return the content of the string escape that can be rendered as is in HTML `e` will return the content of the string escape that can be rendered as is in HTML
[Defined in lib/html.php](/lib/html.php) [Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# truncate # truncate
The `truncate` function is used to shorten a string if exceeds a certain length, and add a string indicating that the string has been shortened. The `truncate` function is used to shorten a string if exceeds a certain length, and add a string indicating that the string has been shortened.
@ -253,7 +279,7 @@ The `truncate` function is used to shorten a string if exceeds a certain length,
truncate('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a neque nunc. Nam nibh sem.', 20 , '...'); truncate('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed a neque nunc. Nam nibh sem.', 20 , '...');
``` ```
[Defined in lib/html.php](/lib/html.php) [Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# sanitize # sanitize
The `sanitize` function is used to remove some tags from a given HTML text. The `sanitize` function is used to remove some tags from a given HTML text.
@ -272,7 +298,7 @@ sanitize($html, $tags_to_remove, $attributes_to_keep, $text_to_keep);
This function returns a simplehtmldom object of the remaining contents. This function returns a simplehtmldom object of the remaining contents.
[Defined in lib/html.php](/lib/html.php) [Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# convertLazyLoading # convertLazyLoading
The `convertLazyLoading` function is used to convert onvert lazy-loading images and frames (video embeds) into static elements. It accepts the HTML content as HTML objects or string objects. It returns the HTML content with fixed image/frame URLs (same type as input). The `convertLazyLoading` function is used to convert onvert lazy-loading images and frames (video embeds) into static elements. It accepts the HTML content as HTML objects or string objects. It returns the HTML content with fixed image/frame URLs (same type as input).
@ -286,8 +312,7 @@ $html = '<html>
backgroundToImg($html); backgroundToImg($html);
``` ```
[Defined in lib/html.php](/lib/html.php) [Defined in lib/html.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/html.php)
# Json::encode # Json::encode
The `Json::encode` function is used to encode a value as à JSON string. The `Json::encode` function is used to encode a value as à JSON string.
@ -300,7 +325,7 @@ $array = [
Json::encode($array, true, true); Json::encode($array, true, true);
``` ```
[Defined in lib/utils.php](/lib/utils.php) [Defined in lib/utils.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/utils.php)
# Json::decode # Json::decode
The `Json::decode` function is used to decode a JSON string into à PHP variable. The `Json::decode` function is used to decode a JSON string into à PHP variable.
@ -313,4 +338,4 @@ $json = '{
Json::decode($json); Json::decode($json);
``` ```
[Defined in lib/utils.php](/lib/utils.php) [Defined in lib/utils.php](https://github.com/RSS-Bridge/rss-bridge/blob/master/lib/utils.php)