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

Feature: add createASCII method #54

Merged
merged 2 commits into from
Sep 1, 2018

Conversation

ahwayakchih
Copy link
Contributor

@ahwayakchih ahwayakchih commented Jun 19, 2018

Hi,

This re-applies ASCII output feature from #6. It does not change existing code, it just adds new method.

I use ASCII output in command line tools/scripts :).

Changes:

  • Added createASCII method that outputs QR code rendered using ASCII blocks.
  • Added JS development dependency on mocha to run new tests for basic GIF and ASCII output.

UPDATE: below is a screenshot of how it looks in terminal :).

qrcode-generator-createascii

Regards

- Added `createASCII` method that outputs QR code rendered using ASCII blocks.
- Added JS development dependency on `mocha` to run new tests for basic GIF and ASCII output.
@nayuki
Copy link

nayuki commented Aug 31, 2018

Two problems:

  • You named the method createASCII(), but the block characters are in Unicode.
  • How do you account for the fact that some text terminals are white-on-black, and some are black-on-white?

@ahwayakchih
Copy link
Contributor Author

@nayuki thanks for comment. You're right that it's actually Unicode. We can rename the method, e.g., "createUnicode" or call it something else. I was going for reminding about "ASCII drawing", but it looks that i was wrong. Any ideas how to name it better?

It returns a string, it's up to the caller to style it with control sequences in terminal, or CSS in web browser.

@kazuhikoarase kazuhikoarase merged commit 40a8a25 into kazuhikoarase:master Sep 1, 2018
@kazuhikoarase
Copy link
Owner

I was going for reminding about "ASCII drawing",

I agree.

Thanks a lot!

@ahwayakchih
Copy link
Contributor Author

Thanks :).

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

Successfully merging this pull request may close these issues.

3 participants