smiley 1 yıl önce
ebeveyn
işleme
22869ae8e2

+ 1 - 0
.phpdoc/template/base.html.twig

@@ -7,6 +7,7 @@
 	],
 	"social": [
 		{ "iconClass": "fab fa-github", "url": "https://github.com/chillerlan/php-qrcode"},
+		{ "iconClass": "fas fa-envelope-open-text", "url": "https://github.com/chillerlan/php-qrcode/discussions"},
 	]
 }
 %}

+ 3 - 1
docs/Built-In-Output/QRMarkupXML.md

@@ -80,7 +80,9 @@ Render the output:
 $data = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
 $out  = (new QRCode($options))->render($data); // -> XML, rendered as SVG
 
-printf('<img alt="%s" src="%s" />', $alt, $out);
+header('Content-type: application/xml');
+
+echo $out;
 ```
 
 The associated [XML schema](https://www.w3.org/XML/Schema) can be found over at GitHub: [`qrcode.schema.xsd`](https://github.com/chillerlan/php-qrcode/blob/main/src/Output/qrcode.schema.xsd)

+ 3 - 3
docs/index.rst

@@ -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|.
 

+ 32 - 3
docs/qroptions-doc.php

@@ -35,7 +35,8 @@ foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $re
 	array_shift($lines);
 	array_pop($lines);
 
-	$see = [];
+	$see  = [];
+	$link = [];
 
 	foreach($lines as $line){
 
@@ -50,7 +51,14 @@ foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $re
 
 		// 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;
 		}
@@ -63,7 +71,6 @@ foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $re
 		$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')){
@@ -88,6 +95,28 @@ foreach($reflectionClass->getProperties(ReflectionProperty::IS_PROTECTED) as $re
 
 	}
 
+	// 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";
 }