-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Rewrite README.md #660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite README.md #660
Conversation
📝 WalkthroughWalkthroughAdds a new QRCoderSamples project to the solution with its project file and solution configuration mappings; introduces sample source demonstrating PNG/SVG/payload/Micro QR usage; and replaces README.md with a reorganized, example-driven documentation and updated badges and sections. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant Samples as QRCoderSamples
participant Gen as QRCodeGenerator
participant Data as QRCodeData
participant Rndr as Renderer (PngByte/Svg/Ascii)
participant Out as Output
Dev->>Samples: Invoke sample (e.g., QuickStart_SimplePng)
Samples->>Gen: Create payload / Generate QRCodeData
Gen-->>Data: Return QRCodeData
Samples->>Rndr: Render QRCodeData (PNG/SVG/ASCII)
Rndr-->>Out: Emit PNG bytes or SVG/ASCII text
Samples-->>Dev: Return or write output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
QRCoder.sln(2 hunks)QRCoderSamples/QRCoderSamples.csproj(1 hunks)QRCoderSamples/ReadmeSamples.cs(1 hunks)README.md(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
QRCoderSamples/ReadmeSamples.cs (2)
QRCoder/PngByteQRCode.cs (1)
PngByteQRCodeHelper(358-399)QRCoder/QRCodeGenerator.cs (1)
ECCLevel(270-278)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test .NET 6.0 Windows
- GitHub Check: Test .NET Core 3.1
- GitHub Check: Test .NET 5.0 Windows
- GitHub Check: Test .NET Core 2.1
- GitHub Check: Test .NET Framework 4.6.2
- GitHub Check: additional-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (8)
QRCoderSamples/ReadmeSamples.cs (4)
22-28: Fix invalid QRCodeGenerator API usage.Line 25 calls the non-existent static method
QRCodeGenerator.GenerateQrCode(...). The correct pattern is to instantiateQRCodeGeneratorand call the instance methodCreateQrCode(...).Apply this diff:
// Generate a scalable black and white SVG QR code -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); using var svgRenderer = new SvgQRCode(qrCodeData); string svg = svgRenderer.GetGraphic();
33-47: Fix invalid QRCodeGenerator API usage.Lines 39 and 42 call the non-existent static method
QRCodeGenerator.GenerateQrCode(...). InstantiateQRCodeGeneratoronce and reuse it for bothCreateQrCode(...)calls.Apply this diff:
// Create a bookmark payload var bookmarkPayload = new PayloadGenerator.Bookmark("https://github.com/Shane32/QRCoder", "QRCoder Repository"); // Generate the QR code data from the payload -using var qrCodeData = QRCodeGenerator.GenerateQrCode(bookmarkPayload); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode(bookmarkPayload); // Or override the ECC level -using var qrCodeData2 = QRCodeGenerator.GenerateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); +using var qrCodeData2 = qrGenerator.CreateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); // Render the QR code using var pngRenderer = new PngByteQRCode(qrCodeData); byte[] qrCodeImage = pngRenderer.GetGraphic(20);
52-58: Fix invalid QRCodeGenerator API usage.Line 55 calls the non-existent static method
QRCodeGenerator.GenerateMicroQrCode(...). UseCreateQrCode(...)with a negativerequestedVersionparameter for Micro QR codes.Apply this diff:
// Generate a Micro QR code (versions M1-M4, represented as -1 to -4) -using var qrCodeData = QRCodeGenerator.GenerateMicroQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); using var qrCode = new PngByteQRCode(qrCodeData); byte[] qrCodeImage = qrCode.GetGraphic(20);
63-83: Fix invalid QRCodeGenerator API usage.Line 66 calls the non-existent static method
QRCodeGenerator.GenerateQrCode(...). Use the correct instance method pattern.Apply this diff:
// Generate QR code data -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); // Access the module matrix var moduleMatrix = qrCodeData.ModuleMatrix;README.md (4)
36-46: Fix invalid QRCodeGenerator API usage.Line 43 calls the non-existent static method
QRCodeGenerator.GenerateQrCode(...). Update to use the correct instance method pattern.Apply this diff:
// Generate a simple black and white PNG QR code byte[] qrCodeImage = PngByteQRCodeHelper.GetQRCode("Hello World", QRCodeGenerator.ECCLevel.Q, 20); // Generate a scalable black and white SVG QR code -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); using var svgRenderer = new SvgQRCode(qrCodeData); string svg = svgRenderer.GetGraphic();
56-71: Fix invalid QRCodeGenerator API usage.Lines 63 and 66 call the non-existent static method
QRCodeGenerator.GenerateQrCode(...). Instantiate the generator once and reuse it.Apply this diff:
// Create a bookmark payload var bookmarkPayload = new PayloadGenerator.Bookmark("https://github.com/Shane32/QRCoder", "QRCoder Repository"); // Generate the QR code data from the payload -using var qrCodeData = QRCodeGenerator.GenerateQrCode(bookmarkPayload); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode(bookmarkPayload); // Or override the ECC level -using var qrCodeData2 = QRCodeGenerator.GenerateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); +using var qrCodeData2 = qrGenerator.CreateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); // Render the QR code using var pngRenderer = new PngByteQRCode(qrCodeData); byte[] qrCodeImage = pngRenderer.GetGraphic(20);
136-143: Fix invalid QRCodeGenerator API usage.Line 140 calls the non-existent static method
QRCodeGenerator.GenerateMicroQrCode(...). UseCreateQrCode(...)with a negativerequestedVersionfor Micro QR codes.Apply this diff:
// Generate a Micro QR code (versions M1-M4, represented as -1 to -4) -using var qrCodeData = QRCodeGenerator.GenerateMicroQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); using var qrCode = new PngByteQRCode(qrCodeData); byte[] qrCodeImage = qrCode.GetGraphic(20);
153-174: Fix invalid QRCodeGenerator API usage.Line 157 calls the non-existent static method
QRCodeGenerator.GenerateQrCode(...). Use the correct instance method pattern.Apply this diff:
// Generate QR code data -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); // Access the module matrix var moduleMatrix = qrCodeData.ModuleMatrix;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
QRCoderSamples/ReadmeSamples.cs(1 hunks)README.md(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
QRCoderSamples/ReadmeSamples.cs (2)
QRCoder/PngByteQRCode.cs (1)
PngByteQRCodeHelper(358-399)QRCoder/QRCodeGenerator.cs (1)
ECCLevel(270-278)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: Test .NET Core 3.1
- GitHub Check: Test .NET Core 2.1
- GitHub Check: Test .NET 5.0 Windows
- GitHub Check: Test .NET 6.0 Windows
- GitHub Check: Test .NET Framework 4.6.2
- GitHub Check: additional-tests
🔇 Additional comments (1)
QRCoderSamples/ReadmeSamples.cs (1)
13-17: LGTM!The static helper method
PngByteQRCodeHelper.GetQRCodeis correctly used and matches the public API.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
gfoidl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than @codebude's suggestions LGTM.
Co-authored-by: Günther Foidl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (1)
README.md (1)
42-45: Fix README samples to call the supported API surface.The README still shows
QRCodeGenerator.GenerateQrCode(...)/GenerateMicroQrCode(...), but those static helpers don’t exist. Anyone copying the quick-start, payload, or Micro QR samples will hit compiler errors. Please instantiateQRCodeGeneratorand callCreateQrCode(...)before rendering.using QRCoder; // Generate a scalable black and white SVG QR code -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); using var svgRenderer = new SvgQRCode(qrCodeData); string svg = svgRenderer.GetGraphic(); @@ -using var qrCodeData = QRCodeGenerator.GenerateQrCode(bookmarkPayload); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode(bookmarkPayload); @@ -using var qrCodeData2 = QRCodeGenerator.GenerateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); +using var qrCodeData2 = qrGenerator.CreateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); @@ -using var qrCodeData = QRCodeGenerator.GenerateMicroQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2);Also applies to: 63-70, 139-142
🧹 Nitpick comments (2)
README.md (2)
9-13: Consider adding a milestones link alongside docs & changelog.Linking the repository milestones here would surface release planning where readers already look for documentation and notes.
134-145: Call out Micro QR data capacity explicitly.Since space is the main trade-off, adding the approximate module/byte limits for Micro QR versions (e.g., M1≈20 bits, M4≈128 bytes at L) would set expectations and deflect common “why doesn’t my payload fit?” questions.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Test .NET 5.0 Windows
- GitHub Check: Test .NET 6.0 Windows
- GitHub Check: Test .NET Core 2.1
- GitHub Check: additional-tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (1)
README.md (1)
44-46: Fix README samples to use the public API.The snippets still call
QRCodeGenerator.GenerateQrCode(...)/GenerateMicroQrCode(...), but those static helpers don’t exist. Readers copying these examples will hit compile errors. InstantiateQRCodeGeneratorand callCreateQrCode(...)(with the appropriate arguments, includingrequestedVersionfor Micro QR) before handing the data to the renderer.// Generate a scalable black and white SVG QR code -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); // Generate the QR code data from the payload -using var qrCodeData = QRCodeGenerator.GenerateQrCode(bookmarkPayload); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode(bookmarkPayload); // Or override the ECC level -using var qrCodeData2 = QRCodeGenerator.GenerateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); +using var qrCodeData2 = qrGenerator.CreateQrCode(bookmarkPayload, QRCodeGenerator.ECCLevel.H); // Generate a Micro QR code (versions M1-M4, represented as -1 to -4) -using var qrCodeData = QRCodeGenerator.GenerateMicroQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello", QRCodeGenerator.ECCLevel.L, requestedVersion: -2); // Generate QR code data -using var qrCodeData = QRCodeGenerator.GenerateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q); +using var qrGenerator = new QRCodeGenerator(); +using var qrCodeData = qrGenerator.CreateQrCode("Hello World", QRCodeGenerator.ECCLevel.Q);Also applies to: 64-67, 141-143, 158-161
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
README.md(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Test .NET 6.0 Windows
- GitHub Check: Test .NET Core 3.1
- GitHub Check: Test .NET 5.0 Windows
- GitHub Check: Test .NET Core 2.1
- GitHub Check: additional-tests
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Rewriting the readme to achieve the following goals:
@codebude You're credited in the opening paragraph with a link to https://raffaelherrmann.de . However, I've removed the blog links; I hope this is okay. Please let me know if you'd like the credit link/text changed.
@codebude @gfoidl Please review if you have time; I suggest comparing the new file to the existing readme in separate windows versus trying to comprehend a diff. Let me know if you think I've omitted anything important or if you have any other suggestions.
@codebude @gfoidl I don't have any other plans for 1.7.0. Please review and let me know if you'd like to make any other changes before I issue a release. Thanks to both of you for your continued support and assistance!
Summary by CodeRabbit
New Features
Documentation
Chores