Skip to content
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

Request for a minimal hello-world HTML / JS example #209

Open
hq6 opened this issue Nov 9, 2024 · 1 comment
Open

Request for a minimal hello-world HTML / JS example #209

hq6 opened this issue Nov 9, 2024 · 1 comment

Comments

@hq6
Copy link

hq6 commented Nov 9, 2024

I looked around your website and github repo and was not able to find a simple HTML and Javascript example (without the need for helper functions that are not in the main library) of generating a QR Code.

In terms of what I did find, this example is not JS and is not directly runnable without a typescript compiler, while the README examples do not include the wrapping HTML and full set of includes required to get hello world running.

Would you consider adding an example equivalent to this?

@nayuki
Copy link
Owner

nayuki commented Nov 11, 2024

I looked around your website ... and was not able to find a simple HTML and Javascript example

The project's main web page itself is an example. It requires view-source and tracing the compiled JavaScript file, though. https://www.nayuki.io/page/qr-code-generator-library

this example is not JS and is not directly runnable without a typescript compiler

Correct; this is by design. I do not put compiled code in the Git repository. However, you can find pre-compiled code in GitHub releases: https://github.com/nayuki/QR-Code-generator/releases

the README examples do not include the wrapping HTML and full set of includes required to get hello world running

This is by design. If you look over past issues and pull requests, I made the decision to not include graphical support out of the box, because output formats are in a constant state of flux and there is no universal format that can withstand the test of time. Hence, I decided to focus the library purely on computation and being able to retrieve a matrix of binary pixels (QR Code "modules"). All the responsibility and complexity of graphical rendering is pushed onto the user of the library by design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants