Skip to content

Commit

Permalink
📖
Browse files Browse the repository at this point in the history
  • Loading branch information
codemasher committed Nov 21, 2024
1 parent a54c1a5 commit bbb2414
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/Usage/Configuration-settings.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Configuration settings
<!-- This file is auto generated from the source of QROptionsTrait.php -->
<!-- This file is auto generated from the source of QROptions.php -->
## version

QR Code version number
Expand Down
3 changes: 2 additions & 1 deletion docs/Usage/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ It also features a QR Code reader based on a [PHP port](https://github.com/khana
- PHP 7.4+
- [`ext-mbstring`](https://www.php.net/manual/book.mbstring.php)
- optional:
- [`ext-fileinfo`](https://www.php.net/manual/book.fileinfo.php) (required by `QRImagick` output)
- [`ext-gd`](https://www.php.net/manual/book.image)
- [`ext-imagick`](https://github.com/Imagick/imagick) with [ImageMagick](https://imagemagick.org) installed
- [`ext-fileinfo`](https://www.php.net/manual/book.fileinfo.php) (required by `QRImagick` output)
- [`setasign/fpdf`](https://github.com/setasign/fpdf) for the PDF output module

For the QR Code reader, either `ext-gd` or `ext-imagick` is required!
Expand All @@ -54,6 +54,7 @@ For the QR Code reader, either `ext-gd` or `ext-imagick` is required!
- [floating-share-button](https://github.com/qriouslad/floating-share-button)
- WoltLab Suite
- [two-step-verification](http://pluginstore.woltlab.com/file/3007-two-step-verification/)
- [[Developer] PHP QR Code](https://www.woltlab.com/pluginstore/file/7995-entwickler-php-qr-code/)
- other uses:
- [dependents](https://github.com/chillerlan/php-qrcode/network/dependents) / [packages](https://github.com/chillerlan/php-qrcode/network/dependents?dependent_type=PACKAGE)
- [Appwrite](https://github.com/appwrite/appwrite)
Expand Down
6 changes: 3 additions & 3 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.. php-qrcode documentation master file, created by sphinx-quickstart on Sun Jul 9 21:45:56 2023.
markdown-rst converter: https://pandoc.org/try/
=================
PHP-QRCode Manual
=================
============================
chillerlan PHP-QRCode Manual
============================

User manual for `chillerlan/php-qrcode <https://github.com/chillerlan/php-qrcode/>`__ [|version|]. Updated on |today|.

Expand Down
35 changes: 32 additions & 3 deletions docs/qroptions-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 @@ -50,7 +51,14 @@

// collect links for "see also"
if(str_starts_with($line, '@see')){
$see[] = $line;
$see[] = substr($line, 5); // cut off the "@see "

continue;
}

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

continue;
}
Expand All @@ -63,7 +71,6 @@
$content[] = "\n**See also:**\n";

foreach($see as $line){
$line = substr($line, 5); // cut off the "@see "

// normal links
if(str_starts_with($line, 'http')){
Expand All @@ -88,6 +95,28 @@

}

// add "Links" section
if(!empty($link)){
$content[] = "\n**Links:**\n";

foreach($link as $line){

// 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 bbb2414

Please sign in to comment.