Skip to content

Conversation

@Shane32
Copy link
Owner

@Shane32 Shane32 commented Oct 9, 2025

Rewriting the readme to achieve the following goals:

  • New/updated badges
  • Simple introduction, easy to identify documentation and changelog links, and easy to read features list
  • Simple quick start guide with:
    • 1-line sample with static method
    • Sample using renderer
    • Sample with payload generator & renderer
  • Logical layout with payload generators and renderers following quick start guide
  • A little sample code for each payload generator / renderer
  • Easy to identify requirements for renderers
  • Advanced features section covering Micro QR codes and QRCodeData format
  • Other information at the bottom of the readme (license / contributing / etc)

@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

    • Added a samples project with runnable examples and helper methods demonstrating PNG, SVG, payload generators, Micro QR and module-matrix usage.
  • Documentation

    • Major README overhaul: new badges, feature-focused layout, NuGet installation and Quick Start samples, expanded Payload Generators, Renderers, Advanced Features, CI Builds, contributing, license, and credits updates.
  • Chores

    • Solution updated to include the samples project and added platform build configurations for Debug/Release.

@Shane32 Shane32 added this to the 1.7.0 milestone Oct 9, 2025
@Shane32 Shane32 requested review from codebude and gfoidl October 9, 2025 00:53
@Shane32 Shane32 self-assigned this Oct 9, 2025
@Shane32 Shane32 added the documentation Project documentation or source code documentation label Oct 9, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 9, 2025

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary of changes
Solution integration
QRCoder.sln
Added QRCoderSamples project entry (GUID {61ED615B-C22C-5E3E-DAAD-A77A820E16DF}); added solution configurations for Debug/Release across ARM/x64/x86 and per-project ActiveCfg/Build.0 mappings for the new project.
Samples project file
QRCoderSamples/QRCoderSamples.csproj
New SDK-style .NET 8 Windows project file; suppresses CA1707 and references ../QRCoder/QRCoder.csproj.
Sample source
QRCoderSamples/ReadmeSamples.cs
New public static class ReadmeSamples with methods: QuickStart_SimplePng, QuickStart_SimpleSvg, PayloadGenerator_Bookmark, MicroQRCode_Simple, QRCodeData_ModuleMatrix demonstrating generator/renderers and payload usage.
Documentation
README.md
Full rewrite: replaced badge set; reorganized into Features/Installation/Quick Start/Payload Generators/Renderers/Advanced Features/CI/Contributing/License/Credits; added concrete code examples and wiki/release links; removed legacy badges and outdated sections.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • codebude
  • gfoidl

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title Check ⚠️ Warning The title “Rewrite README.md” narrowly describes updating the README but omits the addition of a new QRCoderSamples project and accompanying sample code files, so it does not accurately summarize the primary scope of the changes in this pull request. Please revise the title to reflect both the README rewrite and the inclusion of the new QRCoderSamples project with sample code, ensuring it clearly conveys the full scope of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch readme

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc31e2a and 8a93b09.

📒 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 5.0 Windows
  • GitHub Check: Test .NET 6.0 Windows
  • GitHub Check: Test .NET Core 3.1
  • GitHub Check: additional-tests
  • GitHub Check: Test .NET Core 2.1

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between 161aa5f and c7311b5.

📒 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 instantiate QRCodeGenerator and call the instance method CreateQrCode(...).

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(...). Instantiate QRCodeGenerator once and reuse it for both CreateQrCode(...) 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(...). Use CreateQrCode(...) with a negative requestedVersion parameter 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(...). Use CreateQrCode(...) with a negative requestedVersion 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);

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

📥 Commits

Reviewing files that changed from the base of the PR and between c7311b5 and 26085ac.

📒 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.GetQRCode is correctly used and matches the public API.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link
Collaborator

@gfoidl gfoidl left a 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]>
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 instantiate QRCodeGenerator and call CreateQrCode(...) 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

📥 Commits

Reviewing files that changed from the base of the PR and between 5e7e683 and 43dfc0c.

📒 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

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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. Instantiate QRCodeGenerator and call CreateQrCode(...) (with the appropriate arguments, including requestedVersion for 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

📥 Commits

Reviewing files that changed from the base of the PR and between 43dfc0c and be87b89.

📒 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Project documentation or source code documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants